Firebase.AI.Tool

A helper tool that the model may use when generating responses.

Summary

ATool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

Constructors and Destructors

Tool(paramsFunctionDeclaration[] functionDeclarations)
Creates a tool that allows the model to perform function calling.
Tool(IEnumerable<FunctionDeclaration > functionDeclarations)
Creates a tool that allows the model to perform function calling.
Tool(GoogleSearch googleSearch)
Creates a tool that allows the model to use Grounding with Google Search.
Tool(CodeExecution codeExecution)
Creates a tool that allows the model to use Code Execution.
Tool(UrlContext urlContext)
Creates a tool that allows you to provide additional context to the models in the form of public web URLs.

Public functions

Tool

Firebase::AI::Tool::Tool(paramsFunctionDeclaration[]functionDeclarations)

Creates a tool that allows the model to perform function calling.

Details
Parameters
functionDeclarations
A list ofFunctionDeclarations available to the model that can be used for function calling.

Tool

Firebase::AI::Tool::Tool(IEnumerable<FunctionDeclaration>functionDeclarations)

Creates a tool that allows the model to perform function calling.

Details
Parameters
functionDeclarations
A list ofFunctionDeclarations available to the model that can be used for function calling.

Tool

Firebase::AI::Tool::Tool(GoogleSearchgoogleSearch)

Creates a tool that allows the model to use Grounding with Google Search.

Details
Parameters
googleSearch
An emptyGoogleSearch object. The presence of this object in the list of tools enables the model to use Google Search.

Tool

Firebase::AI::Tool::Tool(CodeExecutioncodeExecution)

Creates a tool that allows the model to use Code Execution.

Details
Parameters
codeExecution
An emptyCodeExecution object. The presence of this object in the list of tools enables the model to use Code Execution.

Tool

Firebase::AI::Tool::Tool(UrlContexturlContext)

Creates a tool that allows you to provide additional context to the models in the form of public web URLs.

Details
Parameters
urlContext
An emptyUrlContext object. The presence of this object in the list of tools enables the model to use Url Contexts.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-16 UTC.