Class CompactedResponse.Builder
-
- All Implemented Interfaces:
public final class CompactedResponse.BuilderA builder for CompactedResponse.
-
-
Method Summary
Modifier and Type Method Description final CompactedResponse.Builderid(String id)The unique identifier for the compacted response. final CompactedResponse.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final CompactedResponse.BuildercreatedAt(Long createdAt)Unix timestamp (in seconds) when the compacted conversation was created. final CompactedResponse.BuildercreatedAt(JsonField<Long> createdAt)Sets Builder.createdAt to an arbitrary JSON value. final CompactedResponse.Builderobject_(JsonValue object_)Sets the field to an arbitrary JSON value. final CompactedResponse.Builderoutput(List<ResponseOutputItem> output)The compacted list of output items. final CompactedResponse.Builderoutput(JsonField<List<ResponseOutputItem>> output)Sets Builder.output to an arbitrary JSON value. final CompactedResponse.BuilderaddOutput(ResponseOutputItem output)Adds a single ResponseOutputItem to Builder.output. final CompactedResponse.BuilderaddOutput(ResponseOutputMessage message)Alias for calling addOutput with ResponseOutputItem.ofMessage(message).final CompactedResponse.BuilderaddOutput(ResponseFileSearchToolCall fileSearchCall)Alias for calling addOutput with ResponseOutputItem.ofFileSearchCall(fileSearchCall).final CompactedResponse.BuilderaddOutput(ResponseFunctionToolCall functionCall)Alias for calling addOutput with ResponseOutputItem.ofFunctionCall(functionCall).final CompactedResponse.BuilderaddOutput(ResponseFunctionWebSearch webSearchCall)Alias for calling addOutput with ResponseOutputItem.ofWebSearchCall(webSearchCall).final CompactedResponse.BuilderaddOutput(ResponseComputerToolCall computerCall)Alias for calling addOutput with ResponseOutputItem.ofComputerCall(computerCall).final CompactedResponse.BuilderaddOutput(ResponseReasoningItem reasoning)Alias for calling addOutput with ResponseOutputItem.ofReasoning(reasoning).final CompactedResponse.BuilderaddOutput(ResponseCompactionItem compaction)Alias for calling addOutput with ResponseOutputItem.ofCompaction(compaction).final CompactedResponse.BuilderaddOutput(ResponseOutputItem.ImageGenerationCall imageGenerationCall)Alias for calling addOutput with ResponseOutputItem.ofImageGenerationCall(imageGenerationCall).final CompactedResponse.BuilderaddOutput(ResponseCodeInterpreterToolCall codeInterpreterCall)Alias for calling addOutput with ResponseOutputItem.ofCodeInterpreterCall(codeInterpreterCall).final CompactedResponse.BuilderaddOutput(ResponseOutputItem.LocalShellCall localShellCall)Alias for calling addOutput with ResponseOutputItem.ofLocalShellCall(localShellCall).final CompactedResponse.BuilderaddOutput(ResponseFunctionShellToolCall shellCall)Alias for calling addOutput with ResponseOutputItem.ofShellCall(shellCall).final CompactedResponse.BuilderaddOutput(ResponseFunctionShellToolCallOutput shellCallOutput)Alias for calling addOutput with ResponseOutputItem.ofShellCallOutput(shellCallOutput).final CompactedResponse.BuilderaddOutput(ResponseApplyPatchToolCall applyPatchCall)Alias for calling addOutput with ResponseOutputItem.ofApplyPatchCall(applyPatchCall).final CompactedResponse.BuilderaddOutput(ResponseApplyPatchToolCallOutput applyPatchCallOutput)Alias for calling addOutput with ResponseOutputItem.ofApplyPatchCallOutput(applyPatchCallOutput).final CompactedResponse.BuilderaddOutput(ResponseOutputItem.McpCall mcpCall)Alias for calling addOutput with ResponseOutputItem.ofMcpCall(mcpCall).final CompactedResponse.BuilderaddOutput(ResponseOutputItem.McpListTools mcpListTools)Alias for calling addOutput with ResponseOutputItem.ofMcpListTools(mcpListTools).final CompactedResponse.BuilderaddOutput(ResponseOutputItem.McpApprovalRequest mcpApprovalRequest)Alias for calling addOutput with ResponseOutputItem.ofMcpApprovalRequest(mcpApprovalRequest).final CompactedResponse.BuilderaddOutput(ResponseCustomToolCall customToolCall)Alias for calling addOutput with ResponseOutputItem.ofCustomToolCall(customToolCall).final CompactedResponse.Builderusage(ResponseUsage usage)Token accounting for the compaction pass, including cached, reasoning, and total tokens. final CompactedResponse.Builderusage(JsonField<ResponseUsage> usage)Sets Builder.usage to an arbitrary JSON value. final CompactedResponse.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final CompactedResponse.BuilderputAdditionalProperty(String key, JsonValue value)final CompactedResponse.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final CompactedResponse.BuilderremoveAdditionalProperty(String key)final CompactedResponse.BuilderremoveAllAdditionalProperties(Set<String> keys)final CompactedResponsebuild()Returns an immutable instance of CompactedResponse. -
-
Method Detail
-
id
final CompactedResponse.Builder id(String id)
The unique identifier for the compacted response.
-
id
final CompactedResponse.Builder id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
createdAt
final CompactedResponse.Builder createdAt(Long createdAt)
Unix timestamp (in seconds) when the compacted conversation was created.
-
createdAt
final CompactedResponse.Builder createdAt(JsonField<Long> createdAt)
Sets Builder.createdAt to an arbitrary JSON value.
You should usually call Builder.createdAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
object_
final CompactedResponse.Builder object_(JsonValue object_)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("response.compaction")This method is primarily for setting the field to an undocumented or not yet supported value.
-
output
final CompactedResponse.Builder output(List<ResponseOutputItem> output)
The compacted list of output items. This is a list of all user messages, followed by a single compaction item.
-
output
final CompactedResponse.Builder output(JsonField<List<ResponseOutputItem>> output)
Sets Builder.output to an arbitrary JSON value.
You should usually call Builder.output with a well-typed
List<ResponseOutputItem>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputItem output)
Adds a single ResponseOutputItem to Builder.output.
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputMessage message)
Alias for calling addOutput with
ResponseOutputItem.ofMessage(message).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseFileSearchToolCall fileSearchCall)
Alias for calling addOutput with
ResponseOutputItem.ofFileSearchCall(fileSearchCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseFunctionToolCall functionCall)
Alias for calling addOutput with
ResponseOutputItem.ofFunctionCall(functionCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseFunctionWebSearch webSearchCall)
Alias for calling addOutput with
ResponseOutputItem.ofWebSearchCall(webSearchCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseComputerToolCall computerCall)
Alias for calling addOutput with
ResponseOutputItem.ofComputerCall(computerCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseReasoningItem reasoning)
Alias for calling addOutput with
ResponseOutputItem.ofReasoning(reasoning).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseCompactionItem compaction)
Alias for calling addOutput with
ResponseOutputItem.ofCompaction(compaction).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputItem.ImageGenerationCall imageGenerationCall)
Alias for calling addOutput with
ResponseOutputItem.ofImageGenerationCall(imageGenerationCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseCodeInterpreterToolCall codeInterpreterCall)
Alias for calling addOutput with
ResponseOutputItem.ofCodeInterpreterCall(codeInterpreterCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputItem.LocalShellCall localShellCall)
Alias for calling addOutput with
ResponseOutputItem.ofLocalShellCall(localShellCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseFunctionShellToolCall shellCall)
Alias for calling addOutput with
ResponseOutputItem.ofShellCall(shellCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseFunctionShellToolCallOutput shellCallOutput)
Alias for calling addOutput with
ResponseOutputItem.ofShellCallOutput(shellCallOutput).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseApplyPatchToolCall applyPatchCall)
Alias for calling addOutput with
ResponseOutputItem.ofApplyPatchCall(applyPatchCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseApplyPatchToolCallOutput applyPatchCallOutput)
Alias for calling addOutput with
ResponseOutputItem.ofApplyPatchCallOutput(applyPatchCallOutput).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputItem.McpCall mcpCall)
Alias for calling addOutput with
ResponseOutputItem.ofMcpCall(mcpCall).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputItem.McpListTools mcpListTools)
Alias for calling addOutput with
ResponseOutputItem.ofMcpListTools(mcpListTools).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseOutputItem.McpApprovalRequest mcpApprovalRequest)
Alias for calling addOutput with
ResponseOutputItem.ofMcpApprovalRequest(mcpApprovalRequest).
-
addOutput
final CompactedResponse.Builder addOutput(ResponseCustomToolCall customToolCall)
Alias for calling addOutput with
ResponseOutputItem.ofCustomToolCall(customToolCall).
-
usage
final CompactedResponse.Builder usage(ResponseUsage usage)
Token accounting for the compaction pass, including cached, reasoning, and total tokens.
-
usage
final CompactedResponse.Builder usage(JsonField<ResponseUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed ResponseUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final CompactedResponse.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final CompactedResponse.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final CompactedResponse.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final CompactedResponse.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final CompactedResponse.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final CompactedResponse build()
Returns an immutable instance of CompactedResponse.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() .createdAt() .output() .usage()
-
-
-
-