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
工具包(VectorStoreRouterToolkit) – 具有多个向量存储路由能力的代理工具集
回调管理器(可选[BaseCallbackManager],可选) – 处理回调的对象 [默认为 None. ]
前缀(str,可选) – 路由代理的前缀提示。如果未提供,则使用默认的 ROUTER_PREFIX。
详细输出(bool,可选) – 如果你想查看便签本的内容。 [默认为 False ]
代理执行器参数(可选[Dict[str,Any]],可选) – 如果你想向代理发送其他任何参数。 [默认为 None ]
参数(Any) – 传递给ZeroShotAgent的附加命名参数。
- 返回值
返回一个可调用的AgentExecutor对象。你既可以调用它,也可以使用run方法并通过查询获取响应。
- 返回类型