@@ -60,7 +60,8 @@ def create_vectorstore_agent(
60
60
61
61
vector_store = InMemoryVectorStore.from_texts(
62
62
[
63
- "Dogs are great companions, known for their loyalty and friendliness.",
63
+ "Dogs are great companions, "
64
+ "known for their loyalty and friendliness.",
64
65
"Cats are independent pets that often enjoy their own space.",
65
66
],
66
67
OpenAIEmbeddings(),
@@ -81,18 +82,20 @@ def create_vectorstore_agent(
81
82
step["messages"][-1].pretty_print()
82
83
83
84
Args:
84
- llm (BaseLanguageModel): LLM that will be used by the agent
85
- toolkit (VectorStoreToolkit): Set of tools for the agent
86
- callback_manager (Optional[BaseCallbackManager], optional): Object to handle the callback [ Defaults to None. ]
87
- prefix (str, optional): The prefix prompt for the agent. If not provided uses default PREFIX.
88
- verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ]
89
- agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ]
85
+ llm: LLM that will be used by the agent
86
+ toolkit: Set of tools for the agent
87
+ callback_manager: Object to handle the callback [ Defaults to None. ]
88
+ prefix: The prefix prompt for the agent. If not provided uses default PREFIX.
89
+ verbose: If you want to see the content of the scratchpad. [ Defaults to False ]
90
+ agent_executor_kwargs: If there is any other parameter you want to send to the
91
+ agent. [ Defaults to None ]
90
92
kwargs: Additional named parameters to pass to the ZeroShotAgent.
91
93
92
94
Returns:
93
- AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response
95
+ Returns a callable AgentExecutor object.
96
+ Either you can call it or use run method with the query to get the response.
94
97
95
- """ # noqa: E501
98
+ """
96
99
tools = toolkit .get_tools ()
97
100
prompt = ZeroShotAgent .create_prompt (tools , prefix = prefix )
98
101
llm_chain = LLMChain (
@@ -155,7 +158,8 @@ def create_vectorstore_router_agent(
155
158
156
159
pet_vector_store = InMemoryVectorStore.from_texts(
157
160
[
158
- "Dogs are great companions, known for their loyalty and friendliness.",
161
+ "Dogs are great companions, "
162
+ "known for their loyalty and friendliness.",
159
163
"Cats are independent pets that often enjoy their own space.",
160
164
],
161
165
OpenAIEmbeddings(),
@@ -179,7 +183,7 @@ def create_vectorstore_router_agent(
179
183
food_vector_store.as_retriever(),
180
184
"food_information_retriever",
181
185
"Fetches information about food.",
182
- )
186
+ ),
183
187
]
184
188
185
189
agent = create_react_agent(llm, tools)
@@ -191,18 +195,22 @@ def create_vectorstore_router_agent(
191
195
step["messages"][-1].pretty_print()
192
196
193
197
Args:
194
- llm (BaseLanguageModel): LLM that will be used by the agent
195
- toolkit (VectorStoreRouterToolkit): Set of tools for the agent which have routing capability with multiple vector stores
196
- callback_manager (Optional[BaseCallbackManager], optional): Object to handle the callback [ Defaults to None. ]
197
- prefix (str, optional): The prefix prompt for the router agent. If not provided uses default ROUTER_PREFIX.
198
- verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ]
199
- agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ]
198
+ llm: LLM that will be used by the agent
199
+ toolkit: Set of tools for the agent which have routing capability with multiple
200
+ vector stores
201
+ callback_manager: Object to handle the callback [ Defaults to None. ]
202
+ prefix: The prefix prompt for the router agent.
203
+ If not provided uses default ROUTER_PREFIX.
204
+ verbose: If you want to see the content of the scratchpad. [ Defaults to False ]
205
+ agent_executor_kwargs: If there is any other parameter you want to send to the
206
+ agent. [ Defaults to None ]
200
207
kwargs: Additional named parameters to pass to the ZeroShotAgent.
201
208
202
209
Returns:
203
- AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response.
210
+ Returns a callable AgentExecutor object.
211
+ Either you can call it or use run method with the query to get the response.
204
212
205
- """ # noqa: E501
213
+ """
206
214
tools = toolkit .get_tools ()
207
215
prompt = ZeroShotAgent .create_prompt (tools , prefix = prefix )
208
216
llm_chain = LLMChain (
0 commit comments