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]ΒΆ

Construct a Power BI agent from a Chat LLM and tools.

If you supply only a toolkit and no Power BI dataset, the same LLM is used for both.

Parameters
  • llm (BaseChatModel) –

  • toolkit (Optional[PowerBIToolkit]) –

  • powerbi (Optional[PowerBIDataset]) –

  • callback_manager (Optional[BaseCallbackManager]) –

  • output_parser (Optional[AgentOutputParser]) –

  • prefix (str) –

  • suffix (str) –

  • examples (Optional[str]) –

  • input_variables (Optional[List[str]]) –

  • memory (Optional[BaseChatMemory]) –

  • top_k (int) –

  • verbose (bool) –

  • agent_executor_kwargs (Optional[Dict[str, Any]]) –

  • kwargs (Any) –

Return type

AgentExecutor