-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feat: Add Gemini tool-calling support and get_weather integration #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Added src/tools/get_weather.py - Registered tool in src/tools/__init__.py - Bound tool in coordinator (nodes.py)
|
|
|
@FanXia26 Do you mind click the CLA button to sign the CLA agreement? |
Hi Willem I signed the CLA. |
| return create_react_agent( | ||
| name=agent_name, | ||
| model=get_llm_by_type(AGENT_LLM_MAP[agent_type]), | ||
| model=get_llm_by_type(AGENT_LLM_MAP[agent_type], tools = tools), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why double tools configured in create_react_agent?
| "ppt_composer": "basic", | ||
| "prose_writer": "basic", | ||
| "prompt_enhancer": "basic", | ||
| "coordinator": "gemini", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change these to gemini?
| response = ( | ||
| get_llm_by_type(AGENT_LLM_MAP["coordinator"]) | ||
| .bind_tools([handoff_to_planner]) | ||
| get_llm_by_type(AGENT_LLM_MAP["coordinator"],tools=[handoff_to_planner]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated to bind_tools,
| get_llm_by_type(AGENT_LLM_MAP["coordinator"]) | ||
| .bind_tools([handoff_to_planner]) | ||
| get_llm_by_type(AGENT_LLM_MAP["coordinator"],tools=[handoff_to_planner]) | ||
| .bind_tools([handoff_to_planner, get_weather]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why get_weather is so special?
| "reasoning": "REASONING_MODEL", | ||
| "basic": "BASIC_MODEL", | ||
| "vision": "VISION_MODEL", | ||
| "gemini": "GEMINI_MODEL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gemini is not the same level concept with others.
| llm_type: LLMType, conf: Dict[str, Any] | ||
| ) -> ChatOpenAI | ChatDeepSeek: | ||
| llm_type: LLMType, conf: Dict[str, Any], tools:list | None = None | ||
| ) -> ChatOpenAI | ChatDeepSeek | ChatGoogleGenerativeAI: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, original func is bad I have to say.
|
|
||
| cur = weather["current_weather"] | ||
| daily = weather["daily"] | ||
| out = f"**{city}** 目前 {cur['temperature']}°{('C' if units=='metric' else 'F')},风速 {cur['windspeed']} km/h。\n\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using english in codes is recommended.
Summary
This PR adds Gemini LLM support with tool-calling capabilities and integrates a simple
get_weathertool.Changes
agents.py,llm.py, andagents configget_weather.pytool and registered it.bind_tools([handoff_to_planner, get_weather])Test
Basic functionality verified locally with tool call triggering successfully.