You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and refacto format_tools in providers/gemini/chat.rb
def format_tools(tools)
return [] if tools.empty?
formatted_tools = tools.map do |tool|
if tool.is_a?(Hash) && tool.key?(:google_search)
tool
else
{
functionDeclarations: [function_declaration_for(tool)]
}
end
end
formatted_tools.flatten
end
What do you think ?
The text was updated successfully, but these errors were encountered:
chat = RubyLLM.chat(model: 'gemini-2.0-flash')
chat.with_google_search.ask "What is Google Stock Price Today"
=>
#<RubyLLM::Message:0x0000000127f32f00
@content=
"Here's the information on Google's stock price today, March 19, 2025:\n\n**GOOG (Alphabet Inc. Class C):**\n\n* The current price is $162.67 USD.\n* It has decreased by -2.34% in the past 24 hours.\n\n**GOOGL (Alphabet Inc. Class A):**\n\n* The previous close was $165.49.\n* Today's high: $165.82\n* Today's low: $162.78\n\nKeep in mind that real-time data may have a delay of at least 15 minutes.\n",
@input_tokens=6,
@model_id="gemini-2.0-flash",
@output_tokens=153,
@role=:assistant,
@tool_call_id=nil,
@tool_calls=nil>
Hi,
It would be great if the gem would support Gemini's built-in tools like GoogleSearch.
To enable it in the API, the request is as follows:
I was thinking of using it this way
I suggest to update providers/gemini/chat.rb with this method
and refacto format_tools in providers/gemini/chat.rb
What do you think ?
The text was updated successfully, but these errors were encountered: