Proper Doc
Browse files
README.md
CHANGED
|
@@ -1,15 +1,12 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
-
|
| 5 |
# Table of Contents
|
| 6 |
|
| 7 |
* [run](#run)
|
| 8 |
* [ChromaDBFlow](#ChromaDBFlow)
|
| 9 |
* [ChromaDBFlow](#ChromaDBFlow.ChromaDBFlow)
|
| 10 |
* [instantiate\_from\_config](#ChromaDBFlow.ChromaDBFlow.instantiate_from_config)
|
| 11 |
-
* [get\_input\_keys](#ChromaDBFlow.ChromaDBFlow.get_input_keys)
|
| 12 |
-
* [get\_output\_keys](#ChromaDBFlow.ChromaDBFlow.get_output_keys)
|
| 13 |
* [run](#ChromaDBFlow.ChromaDBFlow.run)
|
| 14 |
* [VectorStoreFlow](#VectorStoreFlow)
|
| 15 |
* [VectorStoreFlow](#VectorStoreFlow.VectorStoreFlow)
|
|
@@ -22,6 +19,8 @@ license: mit
|
|
| 22 |
|
| 23 |
# run
|
| 24 |
|
|
|
|
|
|
|
| 25 |
<a id="ChromaDBFlow"></a>
|
| 26 |
|
| 27 |
# ChromaDBFlow
|
|
@@ -45,7 +44,14 @@ Default: "ChromaDB is a document store that uses vector embeddings to store and
|
|
| 45 |
default parameters of LiteLLMBackend (see aiflows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten:
|
| 46 |
- `api_infos` (List[Dict[str, Any]]): The list of api infos. Default: No default value, this parameter is required.
|
| 47 |
- `model_name` (str): The name of the model. Default: "". In the current implementation, this parameter is not used.
|
| 48 |
-
- `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
- Other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
|
| 50 |
|
| 51 |
*Input Interface*:
|
|
@@ -81,51 +87,19 @@ This method instantiates the flow from a configuration file
|
|
| 81 |
|
| 82 |
`ChromaDBFlow`: The instantiated flow.
|
| 83 |
|
| 84 |
-
<a id="ChromaDBFlow.ChromaDBFlow.get_input_keys"></a>
|
| 85 |
-
|
| 86 |
-
#### get\_input\_keys
|
| 87 |
-
|
| 88 |
-
```python
|
| 89 |
-
def get_input_keys() -> List[str]
|
| 90 |
-
```
|
| 91 |
-
|
| 92 |
-
This method returns the input keys of the flow.
|
| 93 |
-
|
| 94 |
-
**Returns**:
|
| 95 |
-
|
| 96 |
-
`List[str]`: The input keys of the flow.
|
| 97 |
-
|
| 98 |
-
<a id="ChromaDBFlow.ChromaDBFlow.get_output_keys"></a>
|
| 99 |
-
|
| 100 |
-
#### get\_output\_keys
|
| 101 |
-
|
| 102 |
-
```python
|
| 103 |
-
def get_output_keys() -> List[str]
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
-
This method returns the output keys of the flow.
|
| 107 |
-
|
| 108 |
-
**Returns**:
|
| 109 |
-
|
| 110 |
-
`List[str]`: The output keys of the flow.
|
| 111 |
-
|
| 112 |
<a id="ChromaDBFlow.ChromaDBFlow.run"></a>
|
| 113 |
|
| 114 |
#### run
|
| 115 |
|
| 116 |
```python
|
| 117 |
-
def run(
|
| 118 |
```
|
| 119 |
|
| 120 |
This method runs the flow. It runs the ChromaDBFlow. It either writes or reads memories from the database.
|
| 121 |
|
| 122 |
**Arguments**:
|
| 123 |
|
| 124 |
-
- `
|
| 125 |
-
|
| 126 |
-
**Returns**:
|
| 127 |
-
|
| 128 |
-
`Dict[str, Any]`: The output data of the flow.
|
| 129 |
|
| 130 |
<a id="VectorStoreFlow"></a>
|
| 131 |
|
|
@@ -147,7 +121,7 @@ A flow that uses the VectorStore model to write and read memories stored in a da
|
|
| 147 |
- `description` (str): A description of the flow. This description is used to generate the help message of the flow.
|
| 148 |
Default: "VectorStoreFlow"
|
| 149 |
- `backend` (Dict[str, Any]): The configuration of the backend which is used to fetch api keys. Default: LiteLLMBackend with the
|
| 150 |
-
default parameters of LiteLLMBackend (see
|
| 151 |
- `api_infos` (List[Dict[str, Any]]): The list of api infos. Default: No default value, this parameter is required.
|
| 152 |
- `model_name` (str): The name of the model. Default: "". In the current implementation, this parameter is not used.
|
| 153 |
- `type` (str): The type of the vector store. It can be "chroma" or "faiss". Default: "chroma"
|
|
@@ -214,18 +188,14 @@ This method packages the documents in a list of Documents.
|
|
| 214 |
#### run
|
| 215 |
|
| 216 |
```python
|
| 217 |
-
def run(
|
| 218 |
```
|
| 219 |
|
| 220 |
This method runs the flow. It either writes or reads memories from the database.
|
| 221 |
|
| 222 |
**Arguments**:
|
| 223 |
|
| 224 |
-
- `
|
| 225 |
-
|
| 226 |
-
**Returns**:
|
| 227 |
-
|
| 228 |
-
`Dict[str, Any]`: The output data of the flow.
|
| 229 |
|
| 230 |
<a id="__init__"></a>
|
| 231 |
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
|
|
|
| 4 |
# Table of Contents
|
| 5 |
|
| 6 |
* [run](#run)
|
| 7 |
* [ChromaDBFlow](#ChromaDBFlow)
|
| 8 |
* [ChromaDBFlow](#ChromaDBFlow.ChromaDBFlow)
|
| 9 |
* [instantiate\_from\_config](#ChromaDBFlow.ChromaDBFlow.instantiate_from_config)
|
|
|
|
|
|
|
| 10 |
* [run](#ChromaDBFlow.ChromaDBFlow.run)
|
| 11 |
* [VectorStoreFlow](#VectorStoreFlow)
|
| 12 |
* [VectorStoreFlow](#VectorStoreFlow.VectorStoreFlow)
|
|
|
|
| 19 |
|
| 20 |
# run
|
| 21 |
|
| 22 |
+
A simple script to run a Flow that can be used for development and debugging.
|
| 23 |
+
|
| 24 |
<a id="ChromaDBFlow"></a>
|
| 25 |
|
| 26 |
# ChromaDBFlow
|
|
|
|
| 44 |
default parameters of LiteLLMBackend (see aiflows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten:
|
| 45 |
- `api_infos` (List[Dict[str, Any]]): The list of api infos. Default: No default value, this parameter is required.
|
| 46 |
- `model_name` (str): The name of the model. Default: "". In the current implementation, this parameter is not used.
|
| 47 |
+
- `similarity_search_kwargs` (Dict[str, Any]): The parameters to pass to the similarity search method of the ChromaDB. Default:
|
| 48 |
+
- `k` (int): The number of documents to retrieve. Default: 2
|
| 49 |
+
- `filter` (str): The filter to apply to the documents. Default: null
|
| 50 |
+
- `paths_to_data` (List[str]): The paths to the data to store in the database at instantiation. Default: []
|
| 51 |
+
- `chunk_size` (int): The size of the chunks to split the documents into. Default: 700
|
| 52 |
+
- `chunk_overlap` (int): The overlap between the chunks. Default: 0
|
| 53 |
+
- `persist_directory` (str): The directory to persist the database. Default: "./demo_db_dir"
|
| 54 |
+
|
| 55 |
- Other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
|
| 56 |
|
| 57 |
*Input Interface*:
|
|
|
|
| 87 |
|
| 88 |
`ChromaDBFlow`: The instantiated flow.
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
<a id="ChromaDBFlow.ChromaDBFlow.run"></a>
|
| 91 |
|
| 92 |
#### run
|
| 93 |
|
| 94 |
```python
|
| 95 |
+
def run(input_message: FlowMessage)
|
| 96 |
```
|
| 97 |
|
| 98 |
This method runs the flow. It runs the ChromaDBFlow. It either writes or reads memories from the database.
|
| 99 |
|
| 100 |
**Arguments**:
|
| 101 |
|
| 102 |
+
- `input_message` (`FlowMessage`): The input message of the flow.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
<a id="VectorStoreFlow"></a>
|
| 105 |
|
|
|
|
| 121 |
- `description` (str): A description of the flow. This description is used to generate the help message of the flow.
|
| 122 |
Default: "VectorStoreFlow"
|
| 123 |
- `backend` (Dict[str, Any]): The configuration of the backend which is used to fetch api keys. Default: LiteLLMBackend with the
|
| 124 |
+
default parameters of LiteLLMBackend (see flows.backends.LiteLLMBackend). Except for the following parameter whose default value is overwritten:
|
| 125 |
- `api_infos` (List[Dict[str, Any]]): The list of api infos. Default: No default value, this parameter is required.
|
| 126 |
- `model_name` (str): The name of the model. Default: "". In the current implementation, this parameter is not used.
|
| 127 |
- `type` (str): The type of the vector store. It can be "chroma" or "faiss". Default: "chroma"
|
|
|
|
| 188 |
#### run
|
| 189 |
|
| 190 |
```python
|
| 191 |
+
def run(input_message: FlowMessage)
|
| 192 |
```
|
| 193 |
|
| 194 |
This method runs the flow. It either writes or reads memories from the database.
|
| 195 |
|
| 196 |
**Arguments**:
|
| 197 |
|
| 198 |
+
- `input_message` (`FlowMessage`): The input data of the flow.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
<a id="__init__"></a>
|
| 201 |
|