Slide 23
Slide 23 text
© NTT Communications Corporation All Rights Reserved. 23
Agent
❖ エージェントは会話の状態を追跡
➢ 複数ターンの会話に対応可能
❖ Clarification questions
➢ クエリに答えるのに十分な情報を
持っていない場合、明確な質問を要求
❖ Explanation
➢ なぜその回答になったかの
理由を説明してもらう
❖ Rephrase Question
➢ より正確な回答を得たい場合に
LLM側に質問を言い換えてもらう
from pandasai import Agent
# Sample DataFrames
sales_by_country = pd.DataFrame({
"country": ["United States", "United Kingdom", "France",
"Germany", "Italy", "Spain", "Canada", "Australia", "Japan",
"China"],
"sales": [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600,
4500, 7000],
"deals_opened": [142, 80, 70, 90, 60, 50, 40, 30, 110, 120],
"deals_closed": [120, 70, 60, 80, 50, 40, 30, 20, 100, 110]
})
agent = Agent(sales_by_country)
agent.chat('Which are the top 5 countries by sales?')
# Output: China, United States, Japan, Germany, Australia
agent.chat('And which one has the most deals?')
# Output: United States has the most deals