|
|
@ -12,7 +12,7 @@ from deepsearcher.vector_db.base import BaseVectorDB |
|
|
|
current_dir = os.path.dirname(os.path.abspath(__file__)) |
|
|
|
DEFAULT_CONFIG_YAML_PATH = os.path.join(current_dir, "config.yaml") |
|
|
|
|
|
|
|
FeatureType = Literal["llm", "embedding", "file_loader", "web_crawler", "vector_db"] |
|
|
|
FeatureType = Literal["llm", "embedding", "file_loader", "vector_db"] |
|
|
|
|
|
|
|
|
|
|
|
class Configuration: |
|
|
@ -55,7 +55,7 @@ class Configuration: |
|
|
|
Set the provider and its configurations for a given feature. |
|
|
|
|
|
|
|
Args: |
|
|
|
feature: The feature to configure (e.g., 'llm', 'file_loader', 'web_crawler'). |
|
|
|
feature: The feature to configure (e.g., 'llm', 'file_loader'). |
|
|
|
provider: The provider name (e.g., 'openai', 'deepseek'). |
|
|
|
provider_configs: A dictionary with configurations specific to the provider. |
|
|
|
|
|
|
@ -73,7 +73,7 @@ class Configuration: |
|
|
|
Get the current provider and configuration for a given feature. |
|
|
|
|
|
|
|
Args: |
|
|
|
feature: The feature to retrieve (e.g., 'llm', 'file_loader', 'web_crawler'). |
|
|
|
feature: The feature to retrieve (e.g., 'llm', 'file_loader'). |
|
|
|
|
|
|
|
Returns: |
|
|
|
A dictionary with provider and its configurations. |
|
|
@ -91,7 +91,7 @@ class ModuleFactory: |
|
|
|
""" |
|
|
|
Factory class for creating instances of various modules in the DeepSearcher system. |
|
|
|
|
|
|
|
This class creates instances of LLMs, embedding models, file loaders, web crawlers, |
|
|
|
This class creates instances of LLMs, embedding models, file loaders |
|
|
|
and vector databases based on the configuration settings. |
|
|
|
""" |
|
|
|
|
|
|
@ -175,7 +175,7 @@ def init_config(config: Configuration): |
|
|
|
Initialize the global configuration and create instances of all required modules. |
|
|
|
|
|
|
|
This function initializes the global variables for the LLM, embedding model, |
|
|
|
file loader, web crawler, vector database, and RAG agents. |
|
|
|
file loader, vector database, and RAG agents. |
|
|
|
|
|
|
|
Args: |
|
|
|
config: The Configuration object to use for initialization. |
|
|
@ -199,6 +199,5 @@ def init_config(config: Configuration): |
|
|
|
vector_db=vector_db, |
|
|
|
max_iter=config.query_settings["max_iter"], |
|
|
|
route_collection=False, |
|
|
|
text_window_splitter=True, |
|
|
|
enable_web_search=config.query_settings.get("enable_web_search", True), |
|
|
|
text_window_splitter=True |
|
|
|
) |
|
|
|