create_pbi_agent#
- langchain_community.agent_toolkits.powerbi.base.create_pbi_agent(llm: BaseLanguageModel, toolkit: PowerBIToolkit | None = None, powerbi: PowerBIDataset | None = None, callback_manager: BaseCallbackManager | None = None, prefix: str = 'You are an agent designed to help users interact with a PowerBI Dataset.\n\nAgent has access to a tool that can write a query based on the question and then run those against PowerBI, Microsofts business intelligence tool. The questions from the users should be interpreted as related to the dataset that is available and not general questions about the world. If the question does not seem related to the dataset, return "This does not appear to be part of this dataset." as the answer.\n\nGiven an input question, ask to run the questions against the dataset, then look at the results and return the answer, the 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. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I can first ask which tables I have, then how each table is defined and then ask the query tool the question I need, and finally create a nice sentence that answers the question.\n{agent_scratchpad}', format_instructions: str | None = None, examples: str | None = None, input_variables: List[str] | None = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Dict[str, Any] | None = None, **kwargs: Any) AgentExecutor [source]#
Construct a Power BI agent from an LLM and tools.
- Parameters:
llm (BaseLanguageModel) – The language model to use.
toolkit (Optional[PowerBIToolkit]) – Optional. The Power BI toolkit. Default is None.
powerbi (Optional[PowerBIDataset]) – Optional. The Power BI dataset. Default is None.
callback_manager (Optional[BaseCallbackManager]) – Optional. The callback manager. Default is None.
prefix (str) – Optional. The prefix for the prompt. Default is POWERBI_PREFIX.
suffix (str) – Optional. The suffix for the prompt. Default is POWERBI_SUFFIX.
format_instructions (Optional[str]) – Optional. The format instructions for the prompt. Default is None.
examples (Optional[str]) – Optional. The examples for the prompt. Default is None.
input_variables (Optional[List[str]]) – Optional. The input variables for the prompt. Default is None.
top_k (int) – Optional. The top k for the prompt. Default is 10.
verbose (bool) – Optional. Whether to print verbose output. Default is False.
agent_executor_kwargs (Optional[Dict[str, Any]]) – Optional. The agent executor kwargs. Default is None.
kwargs (Any) – Any. Additional keyword arguments.
- Returns:
The agent executor.
- Return type:
Examples using create_pbi_agent