FunctionResponse class final

The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of aFunctionCall made based on model prediction.

Inheritance
  • Object
  • ProtoMessage
  • FunctionResponse

Constructors

FunctionResponse({String id = '', required String name, required Struct? response, List<FunctionResponsePart> parts = const [], bool willContinue = false, FunctionResponse_Scheduling? scheduling})
FunctionResponse.fromJson(Object? j)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call id.
final
name String
Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
final
parts List<FunctionResponsePart>
Optional. Ordered Parts that constitute a function response. Parts may have different IANA MIME types.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
response → Struct?
Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheduling FunctionResponse_Scheduling?
Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
final
willContinue bool
Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty response with will_continue=False to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set scheduling to SILENT.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

fullyQualifiedName → const String