Working enrichment
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import click
|
||||
from loguru import logger
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
from loguru import logger
|
||||
|
||||
|
||||
# Configure logging to output to both file and stdout as specified in requirements
|
||||
def setup_logging():
|
||||
@@ -28,17 +29,24 @@ def ping():
|
||||
click.echo("pong")
|
||||
|
||||
|
||||
@cli.command(name="enrich", help="Load documents from data directory and store in vector database")
|
||||
@click.option('--data-dir', default="../../../data", help="Path to the data directory")
|
||||
@click.option('--collection-name', default="documents", help="Name of the vector store collection")
|
||||
@cli.command(
|
||||
name="enrich",
|
||||
help="Load documents from data directory and store in vector database",
|
||||
)
|
||||
@click.option("--data-dir", default="../../../data", help="Path to the data directory")
|
||||
@click.option(
|
||||
"--collection-name",
|
||||
default="documents_langchain",
|
||||
help="Name of the vector store collection",
|
||||
)
|
||||
def enrich(data_dir, collection_name):
|
||||
"""Load documents from data directory and store in vector database"""
|
||||
logger.info(f"Starting enrichment process for directory: {data_dir}")
|
||||
|
||||
try:
|
||||
# Import here to avoid circular dependencies
|
||||
from vector_storage import initialize_vector_store
|
||||
from enrichment import run_enrichment_process
|
||||
from vector_storage import initialize_vector_store
|
||||
|
||||
# Initialize vector store
|
||||
vector_store = initialize_vector_store(collection_name=collection_name)
|
||||
@@ -55,4 +63,4 @@ def enrich(data_dir, collection_name):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli()
|
||||
cli()
|
||||
|
||||
Reference in New Issue
Block a user