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和工具中构建向量存储代理。

参数
  • llm (BaseLanguageModel) – 代理将使用的LLM

  • toolkit (VectorStoreToolkit) – 代理的工具集

  • optional)- 处理回调的对象 [默认为 None。]

  • prefixstr可选)- 代理的提示前缀。如果没有提供,将使用默认的 PREFIX。

  • verbosebool可选)- 如果您想查看备忘录的内容。 [默认为 False ]

  • agent_executor_kwargs可选Dict[strAny],可选)- 如果有其他参数您想发送给代理。 [默认为 None ]

  • kwargs任何)- 传递给 ZeroShotAgent 的额外命名参数。

返回值

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

返回类型

AgentExecutor