FunctionCallPart

public final class FunctionCallPart implements Part


Represents function call name and params received from requests.

Summary

Nested types

public static class FunctionCallPart.Companion

Public fields

final @NonNull Map<@NonNull String, @NonNull JsonElement>
final String
boolean
final @NonNull String
final String

Public constructors

FunctionCallPart(
    @NonNull String name,
    @NonNull Map<@NonNull String, @NonNull JsonElement> args,
    String id
)

Public methods

static final @NonNull FunctionCallPart
@PublicPreviewAPI
createWithThinking(
    @NonNull String name,
    @NonNull Map<@NonNull String, @NonNull JsonElement> args,
    String id,
    boolean isThought,
    String thoughtSignature
)

Creates a FunctionCallPart with advanced thinking metadata.

Public fields

args

public final @NonNull Map<@NonNull String, @NonNull JsonElementargs

id

public final String id

isThought

public boolean isThought

name

public final @NonNull String name

thoughtSignature

public final String thoughtSignature

Public constructors

FunctionCallPart

public FunctionCallPart(
    @NonNull String name,
    @NonNull Map<@NonNull String, @NonNull JsonElement> args,
    String id
)
Parameters
@NonNull String name

the name of the function to call

@NonNull Map<@NonNull String, @NonNull JsonElement> args

the function parameters and values as a Map

String id

Unique id of the function call. If present, the returned FunctionResponsePart should have a matching id field.

Public methods

createWithThinking

@PublicPreviewAPI
public static final @NonNull FunctionCallPart createWithThinking(
    @NonNull String name,
    @NonNull Map<@NonNull String, @NonNull JsonElement> args,
    String id,
    boolean isThought,
    String thoughtSignature
)

Creates a FunctionCallPart with advanced thinking metadata.

Parameters
@NonNull String name

The name of the function to call.

@NonNull Map<@NonNull String, @NonNull JsonElement> args

The function parameters and values as a Map.

String id

Unique id of the function call.

boolean isThought

Indicates whether the response is a thought.

String thoughtSignature

The signature associated with the thought, if any.