# By default, unless you choose a different LLM, it will use BambooLLM. # You can get your free API key signing up at https://pandabi.ai (you can also configure it in your .env file) os.environ["PANDASAI_API_KEY"] = "YOUR_API_KEY"
agent = Agent(sales_by_country) agent.chat('Which are the top 5 countries by sales?') ## Output # China, United States, Japan, Germany, Australia
# 使用 ollama本地大模型作为自然语言理解模型 from pandasai import SmartDataframe from pandasai.llm.local_llm import LocalLLM
# Assuming you have a local server running that hosts the Llama 3.1 model llm = LocalLLM(api_base="http://localhost:11434/v1", model="qwen2.5") df = SmartDataframe("data.xlsx", config={"llm": llm})