renamed flows to aiflow
Browse filesFiles changed (7)
- ChromaDBFlow.py+2-2
- ChromaDBFlow.yaml+1-1
- README.md+3-3
- VectorStoreFlow.py+2-2
- VectorStoreFlow.yaml+1-1
- demo.yaml+15-15
- run.py+7-7
6 unmodified lines78910101112136 unmodified lines20212223232425266 unmodified lines
from chromadb import Client as ChromaClient
from flows.base_flows import AtomicFlowfrom aiflows.base_flows import AtomicFlow
import hydra
6 unmodified lines - `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 flows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten: 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. - `n_results` (int): The number of results to retrieve when reading from the database. Default: 51 unmodified line234556781 unmodified linedescription: ChromaDB is a document store that uses vector embeddings to store and retrieve documents
backend: _target_: flows.backends.llm_lite.LiteLLMBackend _target_: aiflows.backends.llm_lite.LiteLLMBackend api_infos: ??? model_name: "" #Not used in current implementationinput_interface:41 unmodified lines424344454546474898 unmodified lines14714814915015015115215315 unmodified lines16917017117217217317417541 unmodified lines- `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 thedefault parameters of LiteLLMBackend (see flows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten: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.- `n_results` (int): The number of results to retrieve when reading from the database. Default: 598 unmodified lines- `description` (str): A description of the flow. This description is used to generate the help message of the flow.Default: "VectorStoreFlow"- `backend` (Dict[str, Any]): The configuration of the backend which is used to fetch api keys. Default: LiteLLMBackend with thedefault parameters of LiteLLMBackend (see flows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten: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.- `type` (str): The type of the vector store. It can be "chroma" or "faiss". Default: "chroma"15 unmodified lines- `backend` (`LiteLLMBackend`): The backend of the flow (used to retrieve the API key)- `vector_db` (`VectorStoreRetriever`): The vector store retriever- `type` (`str`): The type of the vector store- `\**kwargs`: Additional arguments to pass to the flow. See :class:`flows.base_flows.AtomicFlow` for more details.- `\**kwargs`: Additional arguments to pass to the flow. See :class:`aiflows.base_flows.AtomicFlow` for more details.
<a id="VectorStoreFlow.VectorStoreFlow.instantiate_from_config"></a>
8 unmodified lines91011121213141529 unmodified lines45464748484950518 unmodified linesfrom langchain.vectorstores import Chroma, FAISSfrom langchain.vectorstores.base import VectorStoreRetriever
from flows.base_flows import AtomicFlowfrom aiflows.base_flows import AtomicFlowimport hydra
29 unmodified lines :type vector_db: VectorStoreRetriever :param type: The type of the vector store :type type: str :param \**kwargs: Additional arguments to pass to the flow. See :class:`flows.base_flows.AtomicFlow` for more details. :param \**kwargs: Additional arguments to pass to the flow. See :class:`aiflows.base_flows.AtomicFlow` for more details. """ REQUIRED_KEYS_CONFIG = ["type"]
1 unmodified line234556781 unmodified linedescription: "VectorStoreFlow"
backend: _target_: flows.backends.llm_lite.LiteLLMBackend _target_: aiflows.backends.llm_lite.LiteLLMBackend api_infos: ??? model_name: "" #Not used in current implementation 3 unmodified lines4567789101112131314151516171818192021222324252526272829293031322 unmodified lines353637383839404142424344454 unmodified lines50515253535455565757585959606162636465666667686970707172732 unmodified lines7677787979808182838384853 unmodified lines - "content" output_interface: - "retrieved" _target_: flows.base_flows.SequentialFlow.instantiate_from_default_config _target_: aiflows.base_flows.SequentialFlow.instantiate_from_default_config name: "demoChromaDBFlow" description: "An example flow of how to read and writed in a ChromaDBFlowModule." subflows_config: chroma_db: input_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["operation","content"] _target_: aiflows.VectorStoreFlowModule.ChromaDBFlow.instantiate_from_default_config _target_: flow_modules.aiflows.VectorStoreFlowModule.ChromaDBFlow.instantiate_from_default_config backend: _target_: flows.backends.llm_lite.LiteLLMBackend _target_: aiflows.backends.llm_lite.LiteLLMBackend api_infos: ??? model_name: "" #Not used in current implementation n_results: 1 # number of results to retrieve when query topology: - goal: Write content to the ChromaDB input_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["operation","content"] flow: chroma_db output_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_set: operation: "read" keys_to_rename:2 unmodified lines
- goal: Read content from the ChromaDB input_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["operation","content"] flow: chroma_db output_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["retrieved"]
vector_store_demo_flow:4 unmodified lines - "retrieved" name: "demoVectorStoreFlow" description: "An example flow of how to read and write in a VectorStoreFlowModule." _target_: flows.base_flows.SequentialFlow.instantiate_from_default_config _target_: aiflows.base_flows.SequentialFlow.instantiate_from_default_config subflows_config: vs_db: _target_: aiflows.VectorStoreFlowModule.VectorStoreFlow.instantiate_from_default_config _target_: flow_modules.aiflows.VectorStoreFlowModule.VectorStoreFlow.instantiate_from_default_config backend: _target_: flows.backends.llm_lite.LiteLLMBackend _target_: aiflows.backends.llm_lite.LiteLLMBackend api_infos: ??? model_name: "" #Not used in current implementation
topology: - goal: Write content to the VectorStore input_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["operation","content"] flow: vs_db output_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_set: operation: "read" keys_to_rename:2 unmodified lines
- goal: Read content from the VectorStore input_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["operation","content"] flow: vs_db output_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_select: ["retrieved"] 2 unmodified lines34567891011678910111213143 unmodified lines18192021212223242 unmodified lines
import hydra
import flowsfrom flows.flow_launchers import FlowLauncherfrom flows.utils.general_helpers import read_yaml_filefrom flows.backends.api_info import ApiInfofrom flows import loggingfrom flows.flow_cache import CACHING_PARAMETERS, clear_cacheimport aiflowsfrom aiflows.flow_launchers import FlowLauncherfrom aiflows.utils.general_helpers import read_yaml_filefrom aiflows.backends.api_info import ApiInfofrom aiflows import loggingfrom aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
CACHING_PARAMETERS.do_caching = False # Set to True to enable caching# clear_cache() # Uncomment this line to clear the cache3 unmodified linesdependencies = [ {"url": "aiflows/VectorStoreFlowModule", "revision": os.getcwd()},]from flows import flow_versefrom aiflows import flow_verseflow_verse.sync_dependencies(dependencies)
if __name__ == "__main__":ChromaDBFlow.py+2-2
ChromaDBFlow.yaml+1-1
README.md+3-3
VectorStoreFlow.py+2-2
VectorStoreFlow.yaml+1-1
demo.yaml+15-15
run.py+7-7