FunctionResponsePart

class FunctionResponsePart : Part


Represents function call output to be returned to the model when it requests a function call.

Summary

Public companion functions

FunctionResponsePart
@PublicPreviewAPI
createWithThinking(
    name: String,
    response: JsonObject,
    id: String?,
    parts: List<Part>,
    isThought: Boolean,
    thoughtSignature: String?
)

Creates a FunctionResponsePart with advanced thinking metadata.

FunctionResponsePart
from(jsonObject: JsonObject, parts: List<Part>)

Public constructors

FunctionResponsePart(
    name: String,
    response: JsonObject,
    id: String?,
    parts: List<Part>
)

Public companion functions

createWithThinking

@PublicPreviewAPI
fun createWithThinking(
    name: String,
    response: JsonObject,
    id: String?,
    parts: List<Part>,
    isThought: Boolean,
    thoughtSignature: String?
): FunctionResponsePart

Creates a FunctionResponsePart with advanced thinking metadata.

Parameters
name: String

The name of the called function.

response: JsonObject

The response produced by the function as a JsonObject.

id: String?

Matching id for a FunctionCallPart, if one was provided.

parts: List<Part>

Additional response parts, if any.

isThought: Boolean

Indicates whether the response is a thought.

thoughtSignature: String?

The signature associated with the thought, if any.

from

fun from(jsonObject: JsonObject, parts: List<Part> = emptyList()): FunctionResponsePart

Public constructors

FunctionResponsePart

FunctionResponsePart(
    name: String,
    response: JsonObject,
    id: String? = null,
    parts: List<Part> = emptyList()
)
Parameters
name: String

The name of the called function.

response: JsonObject

The response produced by the function as a JSONObject.

id: String? = null

Matching id for a FunctionCallPart, if one was provided.

Public properties

id

val idString?

isThought

open val isThoughtBoolean

name

val nameString

parts

val partsList<Part>

response

val responseJsonObject

thoughtSignature

val thoughtSignatureString?