Skip to content

Conversation

@FanXia26
Copy link

@FanXia26 FanXia26 commented Jun 18, 2025

Summary

This PR adds Gemini LLM support with tool-calling capabilities and integrates a simple get_weather tool.

Changes

  • Added Gemini support in agents.py, llm.py, and agents config
  • Created get_weather.py tool and registered it
  • Bound tools in flow using .bind_tools([handoff_to_planner, get_weather])

Test

Basic functionality verified locally with tool call triggering successfully.

- Added src/tools/get_weather.py
- Registered tool in src/tools/__init__.py
- Bound tool in coordinator (nodes.py)
@CLAassistant
Copy link

CLAassistant commented Jun 18, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ WillemJiang
❌ FanXia0926
You have signed the CLA already but the status is still pending? Let us recheck it.

@FanXia26 FanXia26 changed the title Feat/gemini support Feat: Add Gemini tool-calling support and get_weather integration Jun 18, 2025
@WillemJiang
Copy link
Collaborator

@FanXia26 Do you mind click the CLA button to sign the CLA agreement?

@FanXia26
Copy link
Author

@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),
Copy link

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",
Copy link

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])
Copy link

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])
Copy link

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"
Copy link

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:
Copy link

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"
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants