langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent

langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent(llm: BaseLanguageModel, toolkit: VectorStoreRouterToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to answer questions.\nYou have access to tools for interacting with different sources, and the inputs to the tools are questions.\nYour main task is to decide which of the tools is relevant for answering question at hand.\nFor complex questions, you can break the question down into sub questions and use tools to answers the sub questions.\n', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) AgentExecutor[source]

从LLM和工具构建一个VectorStore路由代理。

参数:

llm (BaseLanguageModel): 将被代理使用的LLM toolkit (VectorStoreRouterToolkit): 代理的工具集,具有与多个向量存储进行路由的能力 callback_manager (Optional[BaseCallbackManager], optional): 处理回调的对象 [默认为None] prefix (str, optional): 路由代理的前缀提示。如果未提供,则使用默认的ROUTER_PREFIX。 verbose (bool, optional): 如果您想查看scratchpad的内容。[默认为False] agent_executor_kwargs (Optional[Dict[str, Any]], optional): 如果有任何其他参数要发送给代理。[默认为None] **kwargs: 传递给ZeroShotAgent的其他命名参数。

返回:

AgentExecutor: 返回一个可调用的AgentExecutor对象。您可以调用它或使用run方法与查询一起获取响应。

Parameters
Return type

AgentExecutor