FirebaseVertexAI Framework Reference

Tool

public struct Tool
extension Tool: Encodable

Helper tools that the model may use to generate response.

A Tool 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.

  • Constructs a new Tool.

    Declaration

    Swift

    public init(functionDeclarations: [FunctionDeclaration]?)

    Parameters

    functionDeclarations

    A list of FunctionDeclarations available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall in functionCall(_:) with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse in functionResponse(_:) with the role “function”, providing generation context for the next model turn.