public sealed class FunctionDeclaration : IMessage<FunctionDeclaration>, IEquatable<FunctionDeclaration>, IDeepCloneable<FunctionDeclaration>, IBufferMessage, IMessage
Reference documentation and code samples for the Vertex AI v1beta1 API class FunctionDeclaration.
Structured representation of a function declaration as defined by the
OpenAPI 3.0 specification. Included
in this declaration are the function name, description, parameters and
response type. This FunctionDeclaration is a representation of a block of
code that can be used as a Tool by the model and executed by the client.
Required. The name of the function to call.
Must start with a letter or an underscore.
Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a
maximum length of 64.
Optional. Describes the parameters to this function in JSON Schema Object
format. Reflects the Open API 3.03 Parameter Object. string Key: the name
of the parameter. Parameter names are case sensitive. Schema Value: the
Schema defining the type used for the parameter. For function with no
parameters, this can be left unset. Parameter names must start with a
letter or an underscore and must only contain chars a-z, A-Z, 0-9, or
underscores with a maximum length of 64. Example with 1 required and 1
optional parameter: type: OBJECT properties:
param1:
type: STRING
param2:
type: INTEGER
required:
Optional. Describes the parameters to the function in JSON Schema format.
The schema must describe an object where the properties are the parameters
to the function. For example:
Optional. Describes the output from this function in JSON Schema format.
Reflects the Open API 3.03 Response Object. The Schema defines the type
used for the response value of the function.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eFunctionDeclaration\u003c/code\u003e class in the Vertex AI v1beta1 API represents a function declaration according to the OpenAPI 3.0 specification, including its name, description, parameters, and response type.\u003c/p\u003e\n"],["\u003cp\u003eThis class is designed to be used as a \u003ccode\u003eTool\u003c/code\u003e by models, enabling clients to execute blocks of code defined by the function.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFunctionDeclaration\u003c/code\u003e includes properties for the function's \u003ccode\u003eName\u003c/code\u003e, \u003ccode\u003eDescription\u003c/code\u003e, \u003ccode\u003eParameters\u003c/code\u003e, and \u003ccode\u003eResponse\u003c/code\u003e, all of which are represented in JSON Schema Object format.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers two constructors: one default and another that enables cloning existing \u003ccode\u003eFunctionDeclaration\u003c/code\u003e instances.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the FunctionDeclaration class is 1.0.0-beta21, with prior version 1.0.0-beta20 also available.\u003c/p\u003e\n"]]],[],null,["# Vertex AI v1beta1 API - Class FunctionDeclaration (1.0.0-beta47)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta47 (latest)](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.FunctionDeclaration)\n- [1.0.0-beta46](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/1.0.0-beta46/Google.Cloud.AIPlatform.V1Beta1.FunctionDeclaration) \n\n public sealed class FunctionDeclaration : IMessage\u003cFunctionDeclaration\u003e, IEquatable\u003cFunctionDeclaration\u003e, IDeepCloneable\u003cFunctionDeclaration\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Vertex AI v1beta1 API class FunctionDeclaration.\n\nStructured representation of a function declaration as defined by the\n[OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included\nin this declaration are the function name, description, parameters and\nresponse type. This FunctionDeclaration is a representation of a block of\ncode that can be used as a `Tool` by the model and executed by the client. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e FunctionDeclaration \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[FunctionDeclaration](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.FunctionDeclaration), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[FunctionDeclaration](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.FunctionDeclaration), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[FunctionDeclaration](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.FunctionDeclaration), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.AIPlatform.V1Beta1](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.AIPlatform.V1Beta1.dll\n\nConstructors\n------------\n\n### FunctionDeclaration()\n\n public FunctionDeclaration()\n\n### FunctionDeclaration(FunctionDeclaration)\n\n public FunctionDeclaration(FunctionDeclaration other)\n\nProperties\n----------\n\n### Description\n\n public string Description { get; set; }\n\nOptional. Description and purpose of the function.\nModel uses it to decide how and whether to call the function.\n\n### Name\n\n public string Name { get; set; }\n\nRequired. The name of the function to call.\nMust start with a letter or an underscore.\nMust be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a\nmaximum length of 64.\n\n### Parameters\n\n public OpenApiSchema Parameters { get; set; }\n\nOptional. Describes the parameters to this function in JSON Schema Object\nformat. Reflects the Open API 3.03 Parameter Object. string Key: the name\nof the parameter. Parameter names are case sensitive. Schema Value: the\nSchema defining the type used for the parameter. For function with no\nparameters, this can be left unset. Parameter names must start with a\nletter or an underscore and must only contain chars a-z, A-Z, 0-9, or\nunderscores with a maximum length of 64. Example with 1 required and 1\noptional parameter: type: OBJECT properties:\nparam1:\ntype: STRING\nparam2:\ntype: INTEGER\nrequired:\n\n- param1\n\n### ParametersJsonSchema\n\n public Value ParametersJsonSchema { get; set; }\n\nOptional. Describes the parameters to the function in JSON Schema format.\nThe schema must describe an object where the properties are the parameters\nto the function. For example: \n\n {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"age\": { \"type\": \"integer\" }\n },\n \"additionalProperties\": false,\n \"required\": [\"name\", \"age\"],\n \"propertyOrdering\": [\"name\", \"age\"]\n }\n\nThis field is mutually exclusive with `parameters`.\n\n### Response\n\n public OpenApiSchema Response { get; set; }\n\nOptional. Describes the output from this function in JSON Schema format.\nReflects the Open API 3.03 Response Object. The Schema defines the type\nused for the response value of the function.\n\n### ResponseJsonSchema\n\n public Value ResponseJsonSchema { get; set; }\n\nOptional. Describes the output from this function in JSON Schema format.\nThe value specified by the schema is the response value of the function.\n\nThis field is mutually exclusive with `response`."]]