Class ChatKitThreadUserMessageItem.Content
-
- All Implemented Interfaces:
public final class ChatKitThreadUserMessageItem.ContentContent blocks that comprise a user message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceChatKitThreadUserMessageItem.Content.VisitorAn interface that defines how to map each variant of Content to a value of type T.
public final classChatKitThreadUserMessageItem.Content.InputTextText block that a user contributed to the thread.
public final classChatKitThreadUserMessageItem.Content.QuotedTextQuoted snippet that the user referenced in their message.
-
Method Summary
Modifier and Type Method Description final Optional<ChatKitThreadUserMessageItem.Content.InputText>inputText()Text block that a user contributed to the thread. final Optional<ChatKitThreadUserMessageItem.Content.QuotedText>quotedText()Quoted snippet that the user referenced in their message. final BooleanisInputText()final BooleanisQuotedText()final ChatKitThreadUserMessageItem.Content.InputTextasInputText()Text block that a user contributed to the thread. final ChatKitThreadUserMessageItem.Content.QuotedTextasQuotedText()Quoted snippet that the user referenced in their message. final Optional<JsonValue>_json()final <T extends Any> Taccept(ChatKitThreadUserMessageItem.Content.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ChatKitThreadUserMessageItem.Contentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ChatKitThreadUserMessageItem.ContentofInputText(ChatKitThreadUserMessageItem.Content.InputText inputText)Text block that a user contributed to the thread. final static ChatKitThreadUserMessageItem.ContentofQuotedText(ChatKitThreadUserMessageItem.Content.QuotedText quotedText)Quoted snippet that the user referenced in their message. -
-
Method Detail
-
inputText
final Optional<ChatKitThreadUserMessageItem.Content.InputText> inputText()
Text block that a user contributed to the thread.
-
quotedText
final Optional<ChatKitThreadUserMessageItem.Content.QuotedText> quotedText()
Quoted snippet that the user referenced in their message.
-
isInputText
final Boolean isInputText()
-
isQuotedText
final Boolean isQuotedText()
-
asInputText
final ChatKitThreadUserMessageItem.Content.InputText asInputText()
Text block that a user contributed to the thread.
-
asQuotedText
final ChatKitThreadUserMessageItem.Content.QuotedText asQuotedText()
Quoted snippet that the user referenced in their message.
-
accept
final <T extends Any> T accept(ChatKitThreadUserMessageItem.Content.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = content.accept(new Content.Visitor<Optional<String>>() { @Override public Optional<String> visitInputText(InputText inputText) { return Optional.of(inputText.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ChatKitThreadUserMessageItem.Content validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofInputText
final static ChatKitThreadUserMessageItem.Content ofInputText(ChatKitThreadUserMessageItem.Content.InputText inputText)
Text block that a user contributed to the thread.
-
ofQuotedText
final static ChatKitThreadUserMessageItem.Content ofQuotedText(ChatKitThreadUserMessageItem.Content.QuotedText quotedText)
Quoted snippet that the user referenced in their message.
-
-
-
-