Class CallableFunctionDeclaration (1.60.0)

CallableFunctionDeclaration(
 name: str,
 function: typing.Callable[[...], typing.Any],
 parameters: typing.Dict[str, typing.Any],
 description: typing.Optional[str] = None,
)

A function declaration plus a function.

Methods

CallableFunctionDeclaration

CallableFunctionDeclaration(
 name: str,
 function: typing.Callable[[...], typing.Any],
 parameters: typing.Dict[str, typing.Any],
 description: typing.Optional[str] = None,
)

Constructs a FunctionDeclaration.

Parameters
Name Description
name str

The name of the function that the model can call.

parameters typing.Dict[str, typing.Any]

Describes the parameters to this function in JSON Schema Object format.

description typing.Optional[str]

Description and purpose of the function. Model uses it to decide how and whether to call the function.

from_func

from_func(
 func: typing.Callable[[...], typing.Any]
) -> vertexai.generative_models._generative_models.CallableFunctionDeclaration

Automatically creates a CallableFunctionDeclaration from a Python function.

The function parameter schema is automatically extracted.

Parameter
Name Description
func typing.Callable[..., typing.Any]

The function from which to extract schema.

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

Last updated 2025年10月30日 UTC.