A simple script to run a Flow that can be used for development and debugging.
A flow that uses the ChromaDB model to write and read memories stored in a database
-
name (str): The name of the flow. Default: "chroma_db"
-
description (str): A description of the flow. This description is used to generate the help message of the flow.
Default: "ChromaDB is a document store that uses vector embeddings to store and retrieve documents."
-
backend (Dict[str, Any]): The configuration of the backend which is used to fetch api keys. Default: LiteLLMBackend with the
default parameters of LiteLLMBackend (see aiflows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten:
api_infos (List[Dict[str, Any]]): The list of api infos. Default: No default value, this parameter is required.
model_name (str): The name of the model. Default: "". In the current implementation, this parameter is not used.
-
similarity_search_kwargs (Dict[str, Any]): The parameters to pass to the similarity search method of the ChromaDB. Default:
k (int): The number of documents to retrieve. Default: 2
filter (str): The filter to apply to the documents. Default: null
-
paths_to_data (List[str]): The paths to the data to store in the database at instantiation. Default: []
-
chunk_size (int): The size of the chunks to split the documents into. Default: 700
-
seperator (str): The separator to use to split the documents. Default: "\n"
-
chunk_overlap (int): The overlap between the chunks. Default: 0
-
persist_directory (str): The directory to persist the database. Default: "./demo_db_dir"
-
Other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
1@classmethod
2def instantiate_from_config(cls, config)
This method runs the flow. It runs the ChromaDBFlow. It either writes or reads memories from the database.
A flow that uses the VectorStore model to write and read memories stored in a database (see VectorStoreFlow.yaml for the default configuration)
1@classmethod
2def instantiate_from_config(cls, config: Dict[str, Any])
1@staticmethod
2def package_documents(documents: List[str]) -> List[Document]
This method packages the documents in a list of Documents.
This method runs the flow. It either writes or reads memories from the database.