langchain_community.agent_toolkits.powerbi.chat_base
.create_pbi_chat_agent¶
- langchain_community.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent(llm: BaseChatModel, toolkit: Optional[PowerBIToolkit] = None, powerbi: Optional[PowerBIDataset] = None, callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Assistant is a large language model built to help users interact with a PowerBI Dataset.\n\nAssistant should try to create a correct and complete answer to the question from the user. If the user asks a question not related to the dataset it should return "This does not appear to be part of this dataset." as the answer. The user might make a mistake with the spelling of certain values, if you think that is the case, ask the user to confirm the spelling of the value and then run the query again. Unless the user specifies a specific number of examples they wish to obtain, and the results are too large, limit your query to at most {top_k} results, but make it clear when answering which field was used for the filtering. The user has access to these tables: {{tables}}.\n\nThe answer should be a complete sentence that answers the question, if multiple rows are asked find a way to write that in a easily readable format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. \n', suffix: str = "TOOLS\n------\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\n\n{{tools}}\n\n{format_instructions}\n\nUSER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):\n\n{{{{input}}}}\n", examples: Optional[str] = None, input_variables: Optional[List[str]] = None, memory: Optional[BaseChatMemory] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) AgentExecutor [source]¶
从聊天LLM和工具构建Power BI代理。
如果您只提供工具包而没有Power BI数据集,则将使用相同的LLM。
- 参数
llm (BaseChatModel) – 要使用的语言模型。
toolkit (可选[PowerBIToolkit]) – 可选。Power BI工具包。默认为None。
powerbi (可选[]PowerBIDataset]) – 可选。Power BI 数据集。默认值是 None。
callback_manager (可选[]BaseCallbackManager]) – 可选。回调管理器。默认值是 None。
output_parser (可选[]AgentOutputParser]) – 可选。输出解析器。默认值是 None。
prefix (str) – 可选。提示的前缀。默认值是 POWERBI_CHAT_PREFIX。
suffix (str) – 可选。提示的后缀。默认值是 POWERBI_CHAT_SUFFIX。
examples (可选[]str) – 可选。提示的示例。默认值是 None。
input_variables (可选[]List[str]) – 可选。提示的输入变量。默认值是 None。
memory (可选[]BaseChatMemory]) – 可选。内存。默认值是 None。
top_k (int) – 可选。提示的 top k。默认值是 10。
verbose (bool) – 可选。是否打印详细输出。默认值是 False。
agent_executor_kwargs (可选[]Dict[str, Any]) – 可选。代理执行器 kwargs。默认值是 None。
kwargs (Any) – 任何。额外的关键字参数。
- 返回
代理执行器。
- 返回类型