Class StructuredMessage.Builder
-
- All Implemented Interfaces:
public final class StructuredMessage.Builder<T extends Object>A builder for StructuredMessage.
-
-
Method Summary
-
-
Method Detail
-
id
final StructuredMessage.Builder<T> id(String id)
-
id
final StructuredMessage.Builder<T> 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.
-
container
final StructuredMessage.Builder<T> container(BetaContainer container)
-
container
final StructuredMessage.Builder<T> container(Optional<BetaContainer> container)
Alias for calling Builder.container with
container.orElse(null).
-
container
final StructuredMessage.Builder<T> container(JsonField<BetaContainer> container)
Sets Builder.container to an arbitrary JSON value.
You should usually call Builder.container with a well-typed BetaContainer value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
content
final StructuredMessage.Builder<T> content(List<BetaContentBlock> content)
-
content
final StructuredMessage.Builder<T> content(JsonField<List<BetaContentBlock>> content)
Sets Builder.content to an arbitrary JSON value.
You should usually call Builder.content with a well-typed
List<BetaContentBlock>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addContent
final StructuredMessage.Builder<T> addContent(BetaContentBlock content)
Adds a single BetaContentBlock to Builder.content.
-
addContent
final StructuredMessage.Builder<T> addContent(BetaTextBlock text)
Alias for calling addContent with
BetaContentBlock.ofText(text).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaThinkingBlock thinking)
Alias for calling addContent with
BetaContentBlock.ofThinking(thinking).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaRedactedThinkingBlock redactedThinking)
Alias for calling addContent with
BetaContentBlock.ofRedactedThinking(redactedThinking).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaToolUseBlock toolUse)
Alias for calling addContent with
BetaContentBlock.ofToolUse(toolUse).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaServerToolUseBlock serverToolUse)
Alias for calling addContent with
BetaContentBlock.ofServerToolUse(serverToolUse).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaWebSearchToolResultBlock webSearchToolResult)
Alias for calling addContent with
BetaContentBlock.ofWebSearchToolResult(webSearchToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaWebFetchToolResultBlock webFetchToolResult)
Alias for calling addContent with
BetaContentBlock.ofWebFetchToolResult(webFetchToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaAdvisorToolResultBlock advisorToolResult)
Alias for calling addContent with
BetaContentBlock.ofAdvisorToolResult(advisorToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaCodeExecutionToolResultBlock codeExecutionToolResult)
Alias for calling addContent with
BetaContentBlock.ofCodeExecutionToolResult(codeExecutionToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaBashCodeExecutionToolResultBlock bashCodeExecutionToolResult)
Alias for calling addContent with
BetaContentBlock.ofBashCodeExecutionToolResult(bashCodeExecutionToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaTextEditorCodeExecutionToolResultBlock textEditorCodeExecutionToolResult)
Alias for calling addContent with
BetaContentBlock.ofTextEditorCodeExecutionToolResult(textEditorCodeExecutionToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaToolSearchToolResultBlock toolSearchToolResult)
Alias for calling addContent with
BetaContentBlock.ofToolSearchToolResult(toolSearchToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaMcpToolUseBlock mcpToolUse)
Alias for calling addContent with
BetaContentBlock.ofMcpToolUse(mcpToolUse).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaMcpToolResultBlock mcpToolResult)
Alias for calling addContent with
BetaContentBlock.ofMcpToolResult(mcpToolResult).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaContainerUploadBlock containerUpload)
Alias for calling addContent with
BetaContentBlock.ofContainerUpload(containerUpload).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaCompactionBlock compaction)
Alias for calling addContent with
BetaContentBlock.ofCompaction(compaction).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaFallbackBlock fallback)
Alias for calling addContent with
BetaContentBlock.ofFallback(fallback).
-
addContent
final StructuredMessage.Builder<T> addContent(BetaMcpToolListingBlock mcpToolListing)
Alias for calling addContent with
BetaContentBlock.ofMcpToolListing(mcpToolListing).
-
addRedactedThinkingContent
final StructuredMessage.Builder<T> addRedactedThinkingContent(String data)
Alias for calling addContent with the following:
BetaRedactedThinkingBlock.builder() .data(data) .build()
-
addContainerUploadContent
final StructuredMessage.Builder<T> addContainerUploadContent(String fileId)
Alias for calling addContent with the following:
BetaContainerUploadBlock.builder() .fileId(fileId) .build()
-
contextManagement
final StructuredMessage.Builder<T> contextManagement(BetaContextManagementResponse contextManagement)
-
contextManagement
final StructuredMessage.Builder<T> contextManagement(Optional<BetaContextManagementResponse> contextManagement)
Alias for calling Builder.contextManagement with
contextManagement.orElse(null).
-
contextManagement
final StructuredMessage.Builder<T> contextManagement(JsonField<BetaContextManagementResponse> contextManagement)
Sets Builder.contextManagement to an arbitrary JSON value.
You should usually call Builder.contextManagement with a well-typed BetaContextManagementResponse value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
diagnostics
final StructuredMessage.Builder<T> diagnostics(BetaDiagnostics diagnostics)
-
diagnostics
final StructuredMessage.Builder<T> diagnostics(Optional<BetaDiagnostics> diagnostics)
Alias for calling Builder.diagnostics with
diagnostics.orElse(null).
-
diagnostics
final StructuredMessage.Builder<T> diagnostics(JsonField<BetaDiagnostics> diagnostics)
Sets Builder.diagnostics to an arbitrary JSON value.
You should usually call Builder.diagnostics with a well-typed BetaDiagnostics value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final StructuredMessage.Builder<T> model(Model model)
-
model
final StructuredMessage.Builder<T> model(JsonField<Model> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed Model value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final StructuredMessage.Builder<T> model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed Model constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
role
final StructuredMessage.Builder<T> role(JsonValue role)
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("assistant")This method is primarily for setting the field to an undocumented or not yet supported value.
-
stopDetails
final StructuredMessage.Builder<T> stopDetails(BetaRefusalStopDetails stopDetails)
-
stopDetails
final StructuredMessage.Builder<T> stopDetails(Optional<BetaRefusalStopDetails> stopDetails)
Alias for calling Builder.stopDetails with
stopDetails.orElse(null).
-
stopDetails
final StructuredMessage.Builder<T> stopDetails(JsonField<BetaRefusalStopDetails> stopDetails)
Sets Builder.stopDetails to an arbitrary JSON value.
You should usually call Builder.stopDetails with a well-typed BetaRefusalStopDetails value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
stopReason
final StructuredMessage.Builder<T> stopReason(BetaStopReason stopReason)
-
stopReason
final StructuredMessage.Builder<T> stopReason(Optional<BetaStopReason> stopReason)
Alias for calling Builder.stopReason with
stopReason.orElse(null).
-
stopReason
final StructuredMessage.Builder<T> stopReason(JsonField<BetaStopReason> stopReason)
Sets Builder.stopReason to an arbitrary JSON value.
You should usually call Builder.stopReason with a well-typed BetaStopReason value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
stopSequence
final StructuredMessage.Builder<T> stopSequence(String stopSequence)
-
stopSequence
final StructuredMessage.Builder<T> stopSequence(Optional<String> stopSequence)
Alias for calling Builder.stopSequence with
stopSequence.orElse(null).
-
stopSequence
final StructuredMessage.Builder<T> stopSequence(JsonField<String> stopSequence)
Sets Builder.stopSequence to an arbitrary JSON value.
You should usually call Builder.stopSequence with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final StructuredMessage.Builder<T> type(JsonValue type)
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("message")This method is primarily for setting the field to an undocumented or not yet supported value.
-
usage
final StructuredMessage.Builder<T> usage(BetaUsage usage)
-
usage
final StructuredMessage.Builder<T> usage(JsonField<BetaUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed BetaUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputTransformations
final StructuredMessage.Builder<T> inputTransformations(List<BetaInputTransformation> inputTransformations)
-
inputTransformations
final StructuredMessage.Builder<T> inputTransformations(Optional<List<BetaInputTransformation>> inputTransformations)
Alias for calling Builder.inputTransformations with
inputTransformations.orElse(null).
-
inputTransformations
final StructuredMessage.Builder<T> inputTransformations(JsonField<List<BetaInputTransformation>> inputTransformations)
Sets Builder.inputTransformations to an arbitrary JSON value.
You should usually call Builder.inputTransformations with a well-typed
List<BetaInputTransformation>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInputTransformation
final StructuredMessage.Builder<T> addInputTransformation(BetaInputTransformation inputTransformation)
Adds a single BetaInputTransformation to inputTransformations.
-
addInputTransformation
final StructuredMessage.Builder<T> addInputTransformation(BetaThinkingDroppedInputTransformation thinkingDropped)
Alias for calling addInputTransformation with
BetaInputTransformation.ofThinkingDropped(thinkingDropped).
-
addInputTransformation
final StructuredMessage.Builder<T> addInputTransformation(BetaThinkingMismatchAllowedInputTransformation thinkingMismatchAllowed)
Alias for calling addInputTransformation with
BetaInputTransformation.ofThinkingMismatchAllowed(thinkingMismatchAllowed).
-
additionalProperties
final StructuredMessage.Builder<T> additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final StructuredMessage.Builder<T> putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final StructuredMessage.Builder<T> putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final StructuredMessage.Builder<T> removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final StructuredMessage.Builder<T> removeAllAdditionalProperties(Set<String> keys)
-
build
final StructuredMessage<T> build()
Returns an immutable instance of StructuredMessage.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() .container() .content() .contextManagement() .diagnostics() .model() .stopDetails() .stopReason() .stopSequence() .usage()
-
-
-
-