Class ChatKitThreadItemList.Data
-
- All Implemented Interfaces:
public final class ChatKitThreadItemList.DataUser-authored messages within a thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceChatKitThreadItemList.Data.VisitorAn interface that defines how to map each variant of Data to a value of type T.
public final classChatKitThreadItemList.Data.ChatKitClientToolCallRecord of a client side tool invocation initiated by the assistant.
public final classChatKitThreadItemList.Data.ChatKitTaskTask emitted by the workflow to show progress and status updates.
public final classChatKitThreadItemList.Data.ChatKitTaskGroupCollection of workflow tasks grouped together in the thread.
-
Method Summary
Modifier and Type Method Description final Optional<ChatKitThreadUserMessageItem>chatkitUserMessage()User-authored messages within a thread. final Optional<ChatKitThreadAssistantMessageItem>chatkitAssistantMessage()Assistant-authored message within a thread. final Optional<ChatKitWidgetItem>chatkitWidget()Thread item that renders a widget payload. final Optional<ChatKitThreadItemList.Data.ChatKitClientToolCall>chatkitClientToolCall()Record of a client side tool invocation initiated by the assistant. final Optional<ChatKitThreadItemList.Data.ChatKitTask>chatkitTask()Task emitted by the workflow to show progress and status updates. final Optional<ChatKitThreadItemList.Data.ChatKitTaskGroup>chatkitTaskGroup()Collection of workflow tasks grouped together in the thread. final BooleanisChatKitUserMessage()final BooleanisChatKitAssistantMessage()final BooleanisChatKitWidget()final BooleanisChatKitClientToolCall()final BooleanisChatKitTask()final BooleanisChatKitTaskGroup()final ChatKitThreadUserMessageItemasChatKitUserMessage()User-authored messages within a thread. final ChatKitThreadAssistantMessageItemasChatKitAssistantMessage()Assistant-authored message within a thread. final ChatKitWidgetItemasChatKitWidget()Thread item that renders a widget payload. final ChatKitThreadItemList.Data.ChatKitClientToolCallasChatKitClientToolCall()Record of a client side tool invocation initiated by the assistant. final ChatKitThreadItemList.Data.ChatKitTaskasChatKitTask()Task emitted by the workflow to show progress and status updates. final ChatKitThreadItemList.Data.ChatKitTaskGroupasChatKitTaskGroup()Collection of workflow tasks grouped together in the thread. final Optional<JsonValue>_json()final <T extends Any> Taccept(ChatKitThreadItemList.Data.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ChatKitThreadItemList.Datavalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ChatKitThreadItemList.DataofChatKitUserMessage(ChatKitThreadUserMessageItem chatkitUserMessage)User-authored messages within a thread. final static ChatKitThreadItemList.DataofChatKitAssistantMessage(ChatKitThreadAssistantMessageItem chatkitAssistantMessage)Assistant-authored message within a thread. final static ChatKitThreadItemList.DataofChatKitWidget(ChatKitWidgetItem chatkitWidget)Thread item that renders a widget payload. final static ChatKitThreadItemList.DataofChatKitClientToolCall(ChatKitThreadItemList.Data.ChatKitClientToolCall chatkitClientToolCall)Record of a client side tool invocation initiated by the assistant. final static ChatKitThreadItemList.DataofChatKitTask(ChatKitThreadItemList.Data.ChatKitTask chatkitTask)Task emitted by the workflow to show progress and status updates. final static ChatKitThreadItemList.DataofChatKitTaskGroup(ChatKitThreadItemList.Data.ChatKitTaskGroup chatkitTaskGroup)Collection of workflow tasks grouped together in the thread. -
-
Method Detail
-
chatkitUserMessage
final Optional<ChatKitThreadUserMessageItem> chatkitUserMessage()
User-authored messages within a thread.
-
chatkitAssistantMessage
final Optional<ChatKitThreadAssistantMessageItem> chatkitAssistantMessage()
Assistant-authored message within a thread.
-
chatkitWidget
final Optional<ChatKitWidgetItem> chatkitWidget()
Thread item that renders a widget payload.
-
chatkitClientToolCall
final Optional<ChatKitThreadItemList.Data.ChatKitClientToolCall> chatkitClientToolCall()
Record of a client side tool invocation initiated by the assistant.
-
chatkitTask
final Optional<ChatKitThreadItemList.Data.ChatKitTask> chatkitTask()
Task emitted by the workflow to show progress and status updates.
-
chatkitTaskGroup
final Optional<ChatKitThreadItemList.Data.ChatKitTaskGroup> chatkitTaskGroup()
Collection of workflow tasks grouped together in the thread.
-
isChatKitUserMessage
final Boolean isChatKitUserMessage()
-
isChatKitAssistantMessage
final Boolean isChatKitAssistantMessage()
-
isChatKitWidget
final Boolean isChatKitWidget()
-
isChatKitClientToolCall
final Boolean isChatKitClientToolCall()
-
isChatKitTask
final Boolean isChatKitTask()
-
isChatKitTaskGroup
final Boolean isChatKitTaskGroup()
-
asChatKitUserMessage
final ChatKitThreadUserMessageItem asChatKitUserMessage()
User-authored messages within a thread.
-
asChatKitAssistantMessage
final ChatKitThreadAssistantMessageItem asChatKitAssistantMessage()
Assistant-authored message within a thread.
-
asChatKitWidget
final ChatKitWidgetItem asChatKitWidget()
Thread item that renders a widget payload.
-
asChatKitClientToolCall
final ChatKitThreadItemList.Data.ChatKitClientToolCall asChatKitClientToolCall()
Record of a client side tool invocation initiated by the assistant.
-
asChatKitTask
final ChatKitThreadItemList.Data.ChatKitTask asChatKitTask()
Task emitted by the workflow to show progress and status updates.
-
asChatKitTaskGroup
final ChatKitThreadItemList.Data.ChatKitTaskGroup asChatKitTaskGroup()
Collection of workflow tasks grouped together in the thread.
-
accept
final <T extends Any> T accept(ChatKitThreadItemList.Data.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 = data.accept(new Data.Visitor<Optional<String>>() { @Override public Optional<String> visitChatKitUserMessage(ChatKitThreadUserMessageItem chatkitUserMessage) { return Optional.of(chatkitUserMessage.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ChatKitThreadItemList.Data 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.
-
ofChatKitUserMessage
final static ChatKitThreadItemList.Data ofChatKitUserMessage(ChatKitThreadUserMessageItem chatkitUserMessage)
User-authored messages within a thread.
-
ofChatKitAssistantMessage
final static ChatKitThreadItemList.Data ofChatKitAssistantMessage(ChatKitThreadAssistantMessageItem chatkitAssistantMessage)
Assistant-authored message within a thread.
-
ofChatKitWidget
final static ChatKitThreadItemList.Data ofChatKitWidget(ChatKitWidgetItem chatkitWidget)
Thread item that renders a widget payload.
-
ofChatKitClientToolCall
final static ChatKitThreadItemList.Data ofChatKitClientToolCall(ChatKitThreadItemList.Data.ChatKitClientToolCall chatkitClientToolCall)
Record of a client side tool invocation initiated by the assistant.
-
ofChatKitTask
final static ChatKitThreadItemList.Data ofChatKitTask(ChatKitThreadItemList.Data.ChatKitTask chatkitTask)
Task emitted by the workflow to show progress and status updates.
-
ofChatKitTaskGroup
final static ChatKitThreadItemList.Data ofChatKitTaskGroup(ChatKitThreadItemList.Data.ChatKitTaskGroup chatkitTaskGroup)
Collection of workflow tasks grouped together in the thread.
-
-
-
-