Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class FunctionDeclaration.
Structured representation of a function declaration as defined by theOpenAPI 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 aToolby the model and executed by the client.
Generated from protobuf messagegoogle.cloud.aiplatform.v1.FunctionDeclaration
Namespace
Google \ Cloud \ AIPlatform \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
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.
↳ description
string
Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
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: - param1
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:{ "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] }This field is mutually exclusive withparameters.
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.
Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive withresponse.
getName
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.
Returns
Type
Description
string
setName
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.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDescription
Optional. Description and purpose of the function.
Model uses it to decide how and whether to call the function.
Returns
Type
Description
string
setDescription
Optional. Description and purpose of the function.
Model uses it to decide how and whether to call the function.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getParameters
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 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:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Ai Platform V1 Client - Class FunctionDeclaration (1.35.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.35.0 (latest)](/php/docs/reference/cloud-ai-platform/latest/V1.FunctionDeclaration)\n- [1.34.0](/php/docs/reference/cloud-ai-platform/1.34.0/V1.FunctionDeclaration)\n- [1.33.0](/php/docs/reference/cloud-ai-platform/1.33.0/V1.FunctionDeclaration)\n- [1.32.1](/php/docs/reference/cloud-ai-platform/1.32.1/V1.FunctionDeclaration)\n- [1.31.0](/php/docs/reference/cloud-ai-platform/1.31.0/V1.FunctionDeclaration)\n- [1.30.0](/php/docs/reference/cloud-ai-platform/1.30.0/V1.FunctionDeclaration)\n- [1.26.0](/php/docs/reference/cloud-ai-platform/1.26.0/V1.FunctionDeclaration)\n- [1.23.0](/php/docs/reference/cloud-ai-platform/1.23.0/V1.FunctionDeclaration)\n- [1.22.0](/php/docs/reference/cloud-ai-platform/1.22.0/V1.FunctionDeclaration)\n- [1.21.0](/php/docs/reference/cloud-ai-platform/1.21.0/V1.FunctionDeclaration)\n- [1.20.0](/php/docs/reference/cloud-ai-platform/1.20.0/V1.FunctionDeclaration)\n- [1.19.0](/php/docs/reference/cloud-ai-platform/1.19.0/V1.FunctionDeclaration)\n- [1.18.0](/php/docs/reference/cloud-ai-platform/1.18.0/V1.FunctionDeclaration)\n- [1.17.0](/php/docs/reference/cloud-ai-platform/1.17.0/V1.FunctionDeclaration)\n- [1.16.0](/php/docs/reference/cloud-ai-platform/1.16.0/V1.FunctionDeclaration)\n- [1.15.0](/php/docs/reference/cloud-ai-platform/1.15.0/V1.FunctionDeclaration)\n- [1.14.0](/php/docs/reference/cloud-ai-platform/1.14.0/V1.FunctionDeclaration)\n- [1.13.1](/php/docs/reference/cloud-ai-platform/1.13.1/V1.FunctionDeclaration)\n- [1.12.0](/php/docs/reference/cloud-ai-platform/1.12.0/V1.FunctionDeclaration)\n- [1.11.0](/php/docs/reference/cloud-ai-platform/1.11.0/V1.FunctionDeclaration)\n- [1.10.0](/php/docs/reference/cloud-ai-platform/1.10.0/V1.FunctionDeclaration)\n- [1.9.0](/php/docs/reference/cloud-ai-platform/1.9.0/V1.FunctionDeclaration)\n- [1.8.0](/php/docs/reference/cloud-ai-platform/1.8.0/V1.FunctionDeclaration)\n- [1.7.0](/php/docs/reference/cloud-ai-platform/1.7.0/V1.FunctionDeclaration)\n- [1.6.0](/php/docs/reference/cloud-ai-platform/1.6.0/V1.FunctionDeclaration)\n- [1.5.0](/php/docs/reference/cloud-ai-platform/1.5.0/V1.FunctionDeclaration)\n- [1.4.0](/php/docs/reference/cloud-ai-platform/1.4.0/V1.FunctionDeclaration)\n- [1.3.0](/php/docs/reference/cloud-ai-platform/1.3.0/V1.FunctionDeclaration)\n- [1.2.0](/php/docs/reference/cloud-ai-platform/1.2.0/V1.FunctionDeclaration)\n- [1.1.0](/php/docs/reference/cloud-ai-platform/1.1.0/V1.FunctionDeclaration)\n- [1.0.0](/php/docs/reference/cloud-ai-platform/1.0.0/V1.FunctionDeclaration)\n- [0.39.0](/php/docs/reference/cloud-ai-platform/0.39.0/V1.FunctionDeclaration)\n- [0.38.0](/php/docs/reference/cloud-ai-platform/0.38.0/V1.FunctionDeclaration)\n- [0.37.1](/php/docs/reference/cloud-ai-platform/0.37.1/V1.FunctionDeclaration)\n- [0.32.0](/php/docs/reference/cloud-ai-platform/0.32.0/V1.FunctionDeclaration)\n- [0.31.0](/php/docs/reference/cloud-ai-platform/0.31.0/V1.FunctionDeclaration)\n- [0.30.0](/php/docs/reference/cloud-ai-platform/0.30.0/V1.FunctionDeclaration)\n- [0.29.0](/php/docs/reference/cloud-ai-platform/0.29.0/V1.FunctionDeclaration)\n- [0.28.0](/php/docs/reference/cloud-ai-platform/0.28.0/V1.FunctionDeclaration)\n- [0.27.0](/php/docs/reference/cloud-ai-platform/0.27.0/V1.FunctionDeclaration)\n- [0.26.2](/php/docs/reference/cloud-ai-platform/0.26.2/V1.FunctionDeclaration)\n- [0.25.0](/php/docs/reference/cloud-ai-platform/0.25.0/V1.FunctionDeclaration)\n- [0.24.0](/php/docs/reference/cloud-ai-platform/0.24.0/V1.FunctionDeclaration)\n- [0.23.0](/php/docs/reference/cloud-ai-platform/0.23.0/V1.FunctionDeclaration)\n- [0.22.0](/php/docs/reference/cloud-ai-platform/0.22.0/V1.FunctionDeclaration)\n- [0.21.0](/php/docs/reference/cloud-ai-platform/0.21.0/V1.FunctionDeclaration)\n- [0.20.0](/php/docs/reference/cloud-ai-platform/0.20.0/V1.FunctionDeclaration)\n- [0.19.0](/php/docs/reference/cloud-ai-platform/0.19.0/V1.FunctionDeclaration)\n- [0.18.0](/php/docs/reference/cloud-ai-platform/0.18.0/V1.FunctionDeclaration)\n- [0.17.0](/php/docs/reference/cloud-ai-platform/0.17.0/V1.FunctionDeclaration)\n- [0.16.0](/php/docs/reference/cloud-ai-platform/0.16.0/V1.FunctionDeclaration)\n- [0.15.0](/php/docs/reference/cloud-ai-platform/0.15.0/V1.FunctionDeclaration)\n- [0.13.0](/php/docs/reference/cloud-ai-platform/0.13.0/V1.FunctionDeclaration)\n- [0.12.0](/php/docs/reference/cloud-ai-platform/0.12.0/V1.FunctionDeclaration)\n- [0.11.1](/php/docs/reference/cloud-ai-platform/0.11.1/V1.FunctionDeclaration)\n- [0.10.0](/php/docs/reference/cloud-ai-platform/0.10.0/V1.FunctionDeclaration) \nReference documentation and code samples for the Google Cloud Ai Platform V1 Client 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\nGenerated from protobuf message `google.cloud.aiplatform.v1.FunctionDeclaration`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ AIPlatform \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. The name of the function to call.\n\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### setName\n\nRequired. The name of the function to call.\n\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### getDescription\n\nOptional. Description and purpose of the function.\n\nModel uses it to decide how and whether to call the function.\n\n### setDescription\n\nOptional. Description and purpose of the function.\n\nModel uses it to decide how and whether to call the function.\n\n### getParameters\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### hasParameters\n\n### clearParameters\n\n### setParameters\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### getParametersJsonSchema\n\nOptional. Describes the parameters to the function in JSON Schema format.\n\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### hasParametersJsonSchema\n\n### clearParametersJsonSchema\n\n### setParametersJsonSchema\n\nOptional. Describes the parameters to the function in JSON Schema format.\n\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### getResponse\n\nOptional. Describes the output from this function in JSON Schema format.\n\nReflects the Open API 3.03 Response Object. The Schema defines the type\nused for the response value of the function.\n\n### hasResponse\n\n### clearResponse\n\n### setResponse\n\nOptional. Describes the output from this function in JSON Schema format.\n\nReflects the Open API 3.03 Response Object. The Schema defines the type\nused for the response value of the function.\n\n### getResponseJsonSchema\n\nOptional. Describes the output from this function in JSON Schema format.\n\nThe value specified by the schema is the response value of the function.\nThis field is mutually exclusive with `response`.\n\n### hasResponseJsonSchema\n\n### clearResponseJsonSchema\n\n### setResponseJsonSchema\n\nOptional. Describes the output from this function in JSON Schema format.\n\nThe value specified by the schema is the response value of the function.\nThis field is mutually exclusive with `response`."]]