Class FunctionDeclarationMaker (1.22.0)

public final class FunctionDeclarationMaker

Inheritance

java.lang.Object > FunctionDeclarationMaker

Static Methods

fromFunc(String functionDescription, Method function, String[] orderedParameterNames)

public static FunctionDeclaration fromFunc(String functionDescription, Method function, String[] orderedParameterNames)

Creates a FunctionDeclaration from a Java static method

Note:: If you don't want to manually provide parameter names, you can ignore orderedParameterNames and compile your code with the "-parameters" flag. In this case, the parameter names can be auto retrieved from reflection.

Parameters
NameDescription
functionDescriptionString

A description of the method.

functionMethod

A Java static method.

orderedParameterNamesString[]

A list of parameter names in the order they are passed to the method.

Returns
TypeDescription
FunctionDeclaration

a com.google.cloud.vertexai.api.FunctionDeclaration instance.

fromJsonObject(JsonObject jsonObject)

public static FunctionDeclaration fromJsonObject(JsonObject jsonObject)

Creates a FunctionDeclaration from a JsonObject

Parameter
NameDescription
jsonObjectcom.google.gson.JsonObject

A valid Json Object that can be parsed to a FunctionDeclaration.

Returns
TypeDescription
FunctionDeclaration

a FunctionDeclaration by parsing the input json Object.

Exceptions
TypeDescription
InvalidProtocolBufferException

if the jsonObject can't be parsed into a FunctionDeclaration proto.

fromJsonString(String jsonString)

public static FunctionDeclaration fromJsonString(String jsonString)

Creates a FunctionDeclaration from a JsonString

Parameter
NameDescription
jsonStringString

A valid Json String that can be parsed to a FunctionDeclaration.

Returns
TypeDescription
FunctionDeclaration

a FunctionDeclaration by parsing the input json String.

Exceptions
TypeDescription
InvalidProtocolBufferException

if the String can't be parsed into a FunctionDeclaration proto.

Constructors

FunctionDeclarationMaker()

public FunctionDeclarationMaker()