Class FunctionResponse.Builder
-
- All Implemented Interfaces:
public abstract class FunctionResponse.BuilderBuilder for FunctionResponse.
-
-
Constructor Summary
Constructors Constructor Description FunctionResponse.Builder()
-
Method Summary
Modifier and Type Method Description abstract FunctionResponse.BuilderwillContinue(boolean willContinue)Setter for willContinue. FunctionResponse.BuilderclearWillContinue()Clears the value of willContinue field. abstract FunctionResponse.Builderscheduling(FunctionResponseScheduling scheduling)Setter for scheduling. FunctionResponse.BuilderclearScheduling()Clears the value of scheduling field. FunctionResponse.Builderscheduling(FunctionResponseScheduling.Known knownType)Setter for scheduling given a known enum. FunctionResponse.Builderscheduling(String scheduling)Setter for scheduling given a string. abstract FunctionResponse.Builderparts(List<FunctionResponsePart> parts)Setter for parts. FunctionResponse.Builderparts(Array<FunctionResponsePart> parts)Setter for parts. FunctionResponse.Builderparts(Array<FunctionResponsePart.Builder> partsBuilders)Setter for parts builder. FunctionResponse.BuilderclearParts()Clears the value of parts field. abstract FunctionResponse.Builderid(String id)Setter for id. FunctionResponse.BuilderclearId()Clears the value of id field. abstract FunctionResponse.Buildername(String name)Setter for name. FunctionResponse.BuilderclearName()Clears the value of name field. abstract FunctionResponse.Builderresponse(Map<String, Object> response)Setter for response. FunctionResponse.BuilderclearResponse()Clears the value of response field. abstract FunctionResponsebuild()-
-
Method Detail
-
willContinue
abstract FunctionResponse.Builder willContinue(boolean willContinue)
Setter for willContinue.
willContinue: 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 (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. 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.
-
clearWillContinue
@CanIgnoreReturnValue() FunctionResponse.Builder clearWillContinue()
Clears the value of willContinue field.
-
scheduling
abstract FunctionResponse.Builder scheduling(FunctionResponseScheduling scheduling)
Setter for scheduling.
scheduling: Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
-
clearScheduling
@CanIgnoreReturnValue() FunctionResponse.Builder clearScheduling()
Clears the value of scheduling field.
-
scheduling
@CanIgnoreReturnValue() FunctionResponse.Builder scheduling(FunctionResponseScheduling.Known knownType)
Setter for scheduling given a known enum.
scheduling: Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
-
scheduling
@CanIgnoreReturnValue() FunctionResponse.Builder scheduling(String scheduling)
Setter for scheduling given a string.
scheduling: Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
-
parts
abstract FunctionResponse.Builder parts(List<FunctionResponsePart> parts)
Setter for parts.
parts: List of parts that constitute a function response. Each part may have a different IANA MIME type.
-
parts
@CanIgnoreReturnValue() FunctionResponse.Builder parts(Array<FunctionResponsePart> parts)
Setter for parts.
parts: List of parts that constitute a function response. Each part may have a different IANA MIME type.
-
parts
@CanIgnoreReturnValue() FunctionResponse.Builder parts(Array<FunctionResponsePart.Builder> partsBuilders)
Setter for parts builder.
parts: List of parts that constitute a function response. Each part may have a different IANA MIME type.
-
clearParts
@CanIgnoreReturnValue() FunctionResponse.Builder clearParts()
Clears the value of parts field.
-
id
abstract FunctionResponse.Builder id(String id)
Setter for id.
id: Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
-
clearId
@CanIgnoreReturnValue() FunctionResponse.Builder clearId()
Clears the value of id field.
-
name
abstract FunctionResponse.Builder name(String name)
Setter for name.
name: Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
-
clearName
@CanIgnoreReturnValue() FunctionResponse.Builder clearName()
Clears the value of name field.
-
response
abstract FunctionResponse.Builder response(Map<String, Object> response)
Setter for response.
response: Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
-
clearResponse
@CanIgnoreReturnValue() FunctionResponse.Builder clearResponse()
Clears the value of response field.
-
build
abstract FunctionResponse build()
-
-
-
-