langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent

langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent(llm: BaseLanguageModel, toolkit: VectorStoreToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to answer questions about sets of documents.\nYou have access to tools for interacting with the documents, and the inputs to the tools are questions.\nSometimes, you will be asked to provide sources for your questions, in which case you should use the appropriate tool to do so.\nIf the question does not seem relevant to any of the tools provided, just return "I don\'t know" as the answer.\n', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) AgentExecutor[source]

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

参数:

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

返回:

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

Parameters
Return type

AgentExecutor