ChatKit
Domain Types
ChatKit Workflow
-
type ChatKitWorkflow struct{…}Workflow metadata and state returned for the session.
-
ID stringIdentifier of the workflow backing the session.
-
StateVariables map[string, ChatKitWorkflowStateVariableUnion]State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.
-
string -
bool -
float64
-
-
Tracing ChatKitWorkflowTracingTracing settings applied to the workflow.
-
Enabled boolIndicates whether tracing is enabled.
-
-
Version stringSpecific workflow version used for the session. Defaults to null when using the latest deployment.
-
Sessions
Cancel chat session
client.Beta.ChatKit.Sessions.Cancel(ctx, sessionID) (*ChatSession, error)
post /chatkit/sessions/{session_id}/cancel
Cancel an active ChatKit session and return its most recent metadata.
Cancelling prevents new requests from using the issued client secret.
Parameters
sessionID string
Returns
-
type ChatSession struct{…}Represents a ChatKit session and its resolved configuration.
-
ID stringIdentifier for the ChatKit session.
-
ChatKitConfiguration ChatSessionChatKitConfigurationResolved ChatKit feature configuration for the session.
-
AutomaticThreadTitling ChatSessionAutomaticThreadTitlingAutomatic thread titling preferences.
-
Enabled boolWhether automatic thread titling is enabled.
-
-
FileUpload ChatSessionFileUploadUpload settings for the session.
-
Enabled boolIndicates if uploads are enabled for the session.
-
MaxFileSize int64Maximum upload size in megabytes.
-
MaxFiles int64Maximum number of uploads allowed during the session.
-
-
History ChatSessionHistoryHistory retention configuration.
-
Enabled boolIndicates if chat history is persisted for the session.
-
RecentThreads int64Number of prior threads surfaced in history views. Defaults to null when all history is retained.
-
-
-
ClientSecret stringEphemeral client secret that authenticates session requests.
-
ExpiresAt int64Unix timestamp (in seconds) for when the session expires.
-
MaxRequestsPer1Minute int64Convenience copy of the per-minute request limit.
-
Object ChatKitSessionType discriminator that is always
chatkit.session.const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"
-
RateLimits ChatSessionRateLimitsResolved rate limit values.
-
MaxRequestsPer1Minute int64Maximum allowed requests per one-minute window.
-
-
Status ChatSessionStatusCurrent lifecycle state of the session.
-
const ChatSessionStatusActive ChatSessionStatus = "active" -
const ChatSessionStatusExpired ChatSessionStatus = "expired" -
const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"
-
-
User stringUser identifier associated with the session.
-
Workflow ChatKitWorkflowWorkflow metadata for the session.
-
ID stringIdentifier of the workflow backing the session.
-
StateVariables map[string, ChatKitWorkflowStateVariableUnion]State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.
-
string -
bool -
float64
-
-
Tracing ChatKitWorkflowTracingTracing settings applied to the workflow.
-
Enabled boolIndicates whether tracing is enabled.
-
-
Version stringSpecific workflow version used for the session. Defaults to null when using the latest deployment.
-
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
chatSession, err := client.Beta.ChatKit.Sessions.Cancel(context.TODO(), "cksess_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatSession.ID)
}
Response
{
"id": "id",
"chatkit_configuration": {
"automatic_thread_titling": {
"enabled": true
},
"file_upload": {
"enabled": true,
"max_file_size": 0,
"max_files": 0
},
"history": {
"enabled": true,
"recent_threads": 0
}
},
"client_secret": "client_secret",
"expires_at": 0,
"max_requests_per_1_minute": 0,
"object": "chatkit.session",
"rate_limits": {
"max_requests_per_1_minute": 0
},
"status": "active",
"user": "user",
"workflow": {
"id": "id",
"state_variables": {
"foo": "string"
},
"tracing": {
"enabled": true
},
"version": "version"
}
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient()
chatSession, err := client.Beta.ChatKit.Sessions.Cancel(context.TODO(), "cksess_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatSession.ID)
}
Response
{
"id": "cksess_123",
"object": "chatkit.session",
"workflow": {
"id": "workflow_alpha",
"version": "1"
},
"scope": {
"customer_id": "cust_456"
},
"max_requests_per_1_minute": 30,
"ttl_seconds": 900,
"status": "cancelled",
"cancelled_at": 1712345678
}
Create ChatKit session
client.Beta.ChatKit.Sessions.New(ctx, body) (*ChatSession, error)
post /chatkit/sessions
Create a ChatKit session.
Parameters
-
body BetaChatKitSessionNewParams-
User param.Field[string]A free-form string that identifies your end user; ensures this Session can access other objects that have the same
userscope. -
Workflow param.Field[ChatSessionWorkflowParamResp]Workflow that powers the session.
-
ChatKitConfiguration param.Field[ChatSessionChatKitConfigurationParamResp]Optional overrides for ChatKit runtime configuration features
-
ExpiresAfter param.Field[ChatSessionExpiresAfterParamResp]Optional override for session expiration timing in seconds from creation. Defaults to 10 minutes.
-
RateLimits param.Field[ChatSessionRateLimitsParamResp]Optional override for per-minute request limits. When omitted, defaults to 10.
-
Returns
-
type ChatSession struct{…}Represents a ChatKit session and its resolved configuration.
-
ID stringIdentifier for the ChatKit session.
-
ChatKitConfiguration ChatSessionChatKitConfigurationResolved ChatKit feature configuration for the session.
-
AutomaticThreadTitling ChatSessionAutomaticThreadTitlingAutomatic thread titling preferences.
-
Enabled boolWhether automatic thread titling is enabled.
-
-
FileUpload ChatSessionFileUploadUpload settings for the session.
-
Enabled boolIndicates if uploads are enabled for the session.
-
MaxFileSize int64Maximum upload size in megabytes.
-
MaxFiles int64Maximum number of uploads allowed during the session.
-
-
History ChatSessionHistoryHistory retention configuration.
-
Enabled boolIndicates if chat history is persisted for the session.
-
RecentThreads int64Number of prior threads surfaced in history views. Defaults to null when all history is retained.
-
-
-
ClientSecret stringEphemeral client secret that authenticates session requests.
-
ExpiresAt int64Unix timestamp (in seconds) for when the session expires.
-
MaxRequestsPer1Minute int64Convenience copy of the per-minute request limit.
-
Object ChatKitSessionType discriminator that is always
chatkit.session.const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"
-
RateLimits ChatSessionRateLimitsResolved rate limit values.
-
MaxRequestsPer1Minute int64Maximum allowed requests per one-minute window.
-
-
Status ChatSessionStatusCurrent lifecycle state of the session.
-
const ChatSessionStatusActive ChatSessionStatus = "active" -
const ChatSessionStatusExpired ChatSessionStatus = "expired" -
const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"
-
-
User stringUser identifier associated with the session.
-
Workflow ChatKitWorkflowWorkflow metadata for the session.
-
ID stringIdentifier of the workflow backing the session.
-
StateVariables map[string, ChatKitWorkflowStateVariableUnion]State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.
-
string -
bool -
float64
-
-
Tracing ChatKitWorkflowTracingTracing settings applied to the workflow.
-
Enabled boolIndicates whether tracing is enabled.
-
-
Version stringSpecific workflow version used for the session. Defaults to null when using the latest deployment.
-
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
chatSession, err := client.Beta.ChatKit.Sessions.New(context.TODO(), openai.BetaChatKitSessionNewParams{
User: "x",
Workflow: openai.ChatSessionWorkflowParam{
ID: "id",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatSession.ID)
}
Response
{
"id": "id",
"chatkit_configuration": {
"automatic_thread_titling": {
"enabled": true
},
"file_upload": {
"enabled": true,
"max_file_size": 0,
"max_files": 0
},
"history": {
"enabled": true,
"recent_threads": 0
}
},
"client_secret": "client_secret",
"expires_at": 0,
"max_requests_per_1_minute": 0,
"object": "chatkit.session",
"rate_limits": {
"max_requests_per_1_minute": 0
},
"status": "active",
"user": "user",
"workflow": {
"id": "id",
"state_variables": {
"foo": "string"
},
"tracing": {
"enabled": true
},
"version": "version"
}
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient()
chatSession, err := client.Beta.ChatKit.Sessions.New(context.TODO(), openai.BetaChatKitSessionNewParams{
User: "user",
Workflow: openai.ChatSessionWorkflowParam{
ID: "id",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatSession.ID)
}
Response
{
"client_secret": "chatkit_token_123",
"expires_at": 1735689600,
"workflow": {
"id": "workflow_alpha",
"version": "2024-10-01"
},
"scope": {
"project": "alpha",
"environment": "staging"
},
"max_requests_per_1_minute": 60,
"max_requests_per_session": 500,
"status": "active"
}
Threads
List ChatKit thread items
client.Beta.ChatKit.Threads.ListItems(ctx, threadID, query) (*ConversationCursorPage[ChatKitThreadItemListDataUnion], error)
get /chatkit/threads/{thread_id}/items
List items that belong to a ChatKit thread.
Parameters
-
threadID string -
query BetaChatKitThreadListItemsParams-
After param.Field[string]List items created after this thread item ID. Defaults to null for the first page.
-
Before param.Field[string]List items created before this thread item ID. Defaults to null for the newest results.
-
Limit param.Field[int64]Maximum number of thread items to return. Defaults to 20.
-
Order param.Field[BetaChatKitThreadListItemsParamsOrder]Sort order for results by creation time. Defaults to
desc.-
const BetaChatKitThreadListItemsParamsOrderAsc BetaChatKitThreadListItemsParamsOrder = "asc" -
const BetaChatKitThreadListItemsParamsOrderDesc BetaChatKitThreadListItemsParamsOrder = "desc"
-
-
Returns
-
type ChatKitThreadItemListDataUnion interface{…}User-authored messages within a thread.
-
type ChatKitThreadUserMessageItem struct{…}User-authored messages within a thread.
-
ID stringIdentifier of the thread item.
-
Attachments []ChatKitAttachmentAttachments associated with the user message. Defaults to an empty list.
-
ID stringIdentifier for the attachment.
-
MimeType stringMIME type of the attachment.
-
Name stringOriginal display name for the attachment.
-
PreviewURL stringPreview URL for rendering the attachment inline.
-
Type ChatKitAttachmentTypeAttachment discriminator.
-
const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image" -
const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"
-
-
-
Content []ChatKitThreadUserMessageItemContentUnionOrdered content elements supplied by the user.
-
type ChatKitThreadUserMessageItemContentInputText struct{…}Text block that a user contributed to the thread.
-
Text stringPlain-text content supplied by the user.
-
Type InputTextType discriminator that is always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ChatKitThreadUserMessageItemContentQuotedText struct{…}Quoted snippet that the user referenced in their message.
-
Text stringQuoted text content.
-
Type QuotedTextType discriminator that is always
quoted_text.const QuotedTextQuotedText QuotedText = "quoted_text"
-
-
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
InferenceOptions ChatKitThreadUserMessageItemInferenceOptionsInference overrides applied to the message. Defaults to null when unset.
-
Model stringModel name that generated the response. Defaults to null when using the session default.
-
ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoicePreferred tool to invoke. Defaults to null when ChatKit should auto-select.
-
ID stringIdentifier of the requested tool.
-
-
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitUserMessageconst ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"
-
-
type ChatKitThreadAssistantMessageItem struct{…}Assistant-authored message within a thread.
-
ID stringIdentifier of the thread item.
-
Content []ChatKitResponseOutputTextOrdered assistant response segments.
-
Annotations []ChatKitResponseOutputTextAnnotationUnionOrdered list of annotations attached to the response text.
-
type ChatKitResponseOutputTextAnnotationFile struct{…}Annotation that references an uploaded file.
-
Source ChatKitResponseOutputTextAnnotationFileSourceFile attachment referenced by the annotation.
-
Filename stringFilename referenced by the annotation.
-
Type FileType discriminator that is always
file.const FileFile File = "file"
-
-
Type FileType discriminator that is always
filefor this annotation.const FileFile File = "file"
-
-
type ChatKitResponseOutputTextAnnotationURL struct{…}Annotation that references a URL.
-
Source ChatKitResponseOutputTextAnnotationURLSourceURL referenced by the annotation.
-
Type URLType discriminator that is always
url.const URLURL URL = "url"
-
URL stringURL referenced by the annotation.
-
-
Type URLType discriminator that is always
urlfor this annotation.const URLURL URL = "url"
-
-
-
Text stringAssistant generated text.
-
Type OutputTextType discriminator that is always
output_text.const OutputTextOutputText OutputText = "output_text"
-
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitAssistantMessageType discriminator that is always
chatkit.assistant_message.const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"
-
-
type ChatKitWidgetItem struct{…}Thread item that renders a widget payload.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitWidgetType discriminator that is always
chatkit.widget.const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"
-
Widget stringSerialized widget payload rendered in the UI.
-
-
type ChatKitThreadItemListDataChatKitClientToolCall struct{…}Record of a client side tool invocation initiated by the assistant.
-
ID stringIdentifier of the thread item.
-
Arguments stringJSON-encoded arguments that were sent to the tool.
-
CallID stringIdentifier for the client tool call.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Name stringTool name that was invoked.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
Output stringJSON-encoded output captured from the tool. Defaults to null while execution is in progress.
-
Status stringExecution status for the tool call.
-
const ChatKitThreadItemListDataChatKitClientToolCallStatusInProgress ChatKitThreadItemListDataChatKitClientToolCallStatus = "in_progress" -
const ChatKitThreadItemListDataChatKitClientToolCallStatusCompleted ChatKitThreadItemListDataChatKitClientToolCallStatus = "completed"
-
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitClientToolCallType discriminator that is always
chatkit.client_tool_call.const ChatKitClientToolCallChatKitClientToolCall ChatKitClientToolCall = "chatkit.client_tool_call"
-
-
type ChatKitThreadItemListDataChatKitTask struct{…}Task emitted by the workflow to show progress and status updates.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Heading stringOptional heading for the task. Defaults to null when not provided.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
Summary stringOptional summary that describes the task. Defaults to null when omitted.
-
TaskType stringSubtype for the task.
-
const ChatKitThreadItemListDataChatKitTaskTaskTypeCustom ChatKitThreadItemListDataChatKitTaskTaskType = "custom" -
const ChatKitThreadItemListDataChatKitTaskTaskTypeThought ChatKitThreadItemListDataChatKitTaskTaskType = "thought"
-
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitTaskType discriminator that is always
chatkit.task.const ChatKitTaskChatKitTask ChatKitTask = "chatkit.task"
-
-
type ChatKitThreadItemListDataChatKitTaskGroup struct{…}Collection of workflow tasks grouped together in the thread.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
Tasks []ChatKitThreadItemListDataChatKitTaskGroupTaskTasks included in the group.
-
Heading stringOptional heading for the grouped task. Defaults to null when not provided.
-
Summary stringOptional summary that describes the grouped task. Defaults to null when omitted.
-
Type stringSubtype for the grouped task.
-
const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeCustom ChatKitThreadItemListDataChatKitTaskGroupTaskType = "custom" -
const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeThought ChatKitThreadItemListDataChatKitTaskGroupTaskType = "thought"
-
-
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitTaskGroupType discriminator that is always
chatkit.task_group.const ChatKitTaskGroupChatKitTaskGroup ChatKitTaskGroup = "chatkit.task_group"
-
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Beta.ChatKit.Threads.ListItems(
context.TODO(),
"cthr_123",
openai.BetaChatKitThreadListItemsParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
Response
{
"data": [
{
"id": "id",
"attachments": [
{
"id": "id",
"mime_type": "mime_type",
"name": "name",
"preview_url": "https://example.com",
"type": "image"
}
],
"content": [
{
"text": "text",
"type": "input_text"
}
],
"created_at": 0,
"inference_options": {
"model": "model",
"tool_choice": {
"id": "id"
}
},
"object": "chatkit.thread_item",
"thread_id": "thread_id",
"type": "chatkit.user_message"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient()
page, err := client.Beta.ChatKit.Threads.ListItems(
context.TODO(),
"cthr_123",
openai.BetaChatKitThreadListItemsParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
Response
{
"data": [
{
"id": "cthi_user_001",
"object": "chatkit.thread_item",
"type": "user_message",
"content": [
{
"type": "input_text",
"text": "I need help debugging an onboarding issue."
}
],
"attachments": []
},
{
"id": "cthi_assistant_002",
"object": "chatkit.thread_item",
"type": "assistant_message",
"content": [
{
"type": "output_text",
"text": "Let's start by confirming the workflow version you deployed."
}
]
}
],
"has_more": false,
"object": "list"
}
Retrieve ChatKit thread
client.Beta.ChatKit.Threads.Get(ctx, threadID) (*ChatKitThread, error)
get /chatkit/threads/{thread_id}
Retrieve a ChatKit thread by its identifier.
Parameters
threadID string
Returns
-
type ChatKitThread struct{…}Represents a ChatKit thread and its current status.
-
ID stringIdentifier of the thread.
-
CreatedAt int64Unix timestamp (in seconds) for when the thread was created.
-
Object ChatKitThreadType discriminator that is always
chatkit.thread.const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"
-
Status ChatKitThreadStatusUnionCurrent status for the thread. Defaults to
activefor newly created threads.-
type ChatKitThreadStatusActive struct{…}Indicates that a thread is active.
-
Type ActiveStatus discriminator that is always
active.const ActiveActive Active = "active"
-
-
type ChatKitThreadStatusLocked struct{…}Indicates that a thread is locked and cannot accept new input.
-
Reason stringReason that the thread was locked. Defaults to null when no reason is recorded.
-
Type LockedStatus discriminator that is always
locked.const LockedLocked Locked = "locked"
-
-
type ChatKitThreadStatusClosed struct{…}Indicates that a thread has been closed.
-
Reason stringReason that the thread was closed. Defaults to null when no reason is recorded.
-
Type ClosedStatus discriminator that is always
closed.const ClosedClosed Closed = "closed"
-
-
-
Title stringOptional human-readable title for the thread. Defaults to null when no title has been generated.
-
User stringFree-form string that identifies your end user who owns the thread.
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatkitThread.ID)
}
Response
{
"id": "cthr_def456",
"created_at": 1712345600,
"object": "chatkit.thread",
"status": {
"type": "active"
},
"title": "Demo feedback",
"user": "user_456"
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
)
func main() {
client := openai.NewClient()
chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatkitThread.ID)
}
Response
{
"id": "cthr_abc123",
"object": "chatkit.thread",
"title": "Customer escalation",
"items": {
"data": [
{
"id": "cthi_user_001",
"object": "chatkit.thread_item",
"type": "user_message",
"content": [
{
"type": "input_text",
"text": "I need help debugging an onboarding issue."
}
],
"attachments": []
},
{
"id": "cthi_assistant_002",
"object": "chatkit.thread_item",
"type": "assistant_message",
"content": [
{
"type": "output_text",
"text": "Let's start by confirming the workflow version you deployed."
}
]
}
],
"has_more": false
}
}
Delete ChatKit thread
client.Beta.ChatKit.Threads.Delete(ctx, threadID) (*BetaChatKitThreadDeleteResponse, error)
delete /chatkit/threads/{thread_id}
Delete a ChatKit thread along with its items and stored attachments.
Parameters
threadID string
Returns
-
type BetaChatKitThreadDeleteResponse struct{…}Confirmation payload returned after deleting a thread.
-
ID stringIdentifier of the deleted thread.
-
Deleted boolIndicates that the thread has been deleted.
-
Object ChatKitThreadDeletedType discriminator that is always
chatkit.thread.deleted.const ChatKitThreadDeletedChatKitThreadDeleted ChatKitThreadDeleted = "chatkit.thread.deleted"
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", thread.ID)
}
Response
{
"id": "id",
"deleted": true,
"object": "chatkit.thread.deleted"
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
)
func main() {
client := openai.NewClient()
thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", thread.ID)
}
List ChatKit threads
client.Beta.ChatKit.Threads.List(ctx, query) (*ConversationCursorPage[ChatKitThread], error)
get /chatkit/threads
List ChatKit threads with optional pagination and user filters.
Parameters
-
query BetaChatKitThreadListParams-
After param.Field[string]List items created after this thread item ID. Defaults to null for the first page.
-
Before param.Field[string]List items created before this thread item ID. Defaults to null for the newest results.
-
Limit param.Field[int64]Maximum number of thread items to return. Defaults to 20.
-
Order param.Field[BetaChatKitThreadListParamsOrder]Sort order for results by creation time. Defaults to
desc.-
const BetaChatKitThreadListParamsOrderAsc BetaChatKitThreadListParamsOrder = "asc" -
const BetaChatKitThreadListParamsOrderDesc BetaChatKitThreadListParamsOrder = "desc"
-
-
User param.Field[string]Filter threads that belong to this user identifier. Defaults to null to return all users.
-
Returns
-
type ChatKitThread struct{…}Represents a ChatKit thread and its current status.
-
ID stringIdentifier of the thread.
-
CreatedAt int64Unix timestamp (in seconds) for when the thread was created.
-
Object ChatKitThreadType discriminator that is always
chatkit.thread.const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"
-
Status ChatKitThreadStatusUnionCurrent status for the thread. Defaults to
activefor newly created threads.-
type ChatKitThreadStatusActive struct{…}Indicates that a thread is active.
-
Type ActiveStatus discriminator that is always
active.const ActiveActive Active = "active"
-
-
type ChatKitThreadStatusLocked struct{…}Indicates that a thread is locked and cannot accept new input.
-
Reason stringReason that the thread was locked. Defaults to null when no reason is recorded.
-
Type LockedStatus discriminator that is always
locked.const LockedLocked Locked = "locked"
-
-
type ChatKitThreadStatusClosed struct{…}Indicates that a thread has been closed.
-
Reason stringReason that the thread was closed. Defaults to null when no reason is recorded.
-
Type ClosedStatus discriminator that is always
closed.const ClosedClosed Closed = "closed"
-
-
-
Title stringOptional human-readable title for the thread. Defaults to null when no title has been generated.
-
User stringFree-form string that identifies your end user who owns the thread.
-
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Beta.ChatKit.Threads.List(context.TODO(), openai.BetaChatKitThreadListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
Response
{
"data": [
{
"id": "cthr_def456",
"created_at": 1712345600,
"object": "chatkit.thread",
"status": {
"type": "active"
},
"title": "Demo feedback",
"user": "user_456"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}
Example
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
)
func main() {
client := openai.NewClient()
page, err := client.Beta.ChatKit.Threads.List(context.TODO(), openai.BetaChatKitThreadListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
Response
{
"data": [
{
"id": "cthr_abc123",
"object": "chatkit.thread",
"title": "Customer escalation"
},
{
"id": "cthr_def456",
"object": "chatkit.thread",
"title": "Demo feedback"
}
],
"has_more": false,
"object": "list"
}
Domain Types
Chat Session
-
type ChatSession struct{…}Represents a ChatKit session and its resolved configuration.
-
ID stringIdentifier for the ChatKit session.
-
ChatKitConfiguration ChatSessionChatKitConfigurationResolved ChatKit feature configuration for the session.
-
AutomaticThreadTitling ChatSessionAutomaticThreadTitlingAutomatic thread titling preferences.
-
Enabled boolWhether automatic thread titling is enabled.
-
-
FileUpload ChatSessionFileUploadUpload settings for the session.
-
Enabled boolIndicates if uploads are enabled for the session.
-
MaxFileSize int64Maximum upload size in megabytes.
-
MaxFiles int64Maximum number of uploads allowed during the session.
-
-
History ChatSessionHistoryHistory retention configuration.
-
Enabled boolIndicates if chat history is persisted for the session.
-
RecentThreads int64Number of prior threads surfaced in history views. Defaults to null when all history is retained.
-
-
-
ClientSecret stringEphemeral client secret that authenticates session requests.
-
ExpiresAt int64Unix timestamp (in seconds) for when the session expires.
-
MaxRequestsPer1Minute int64Convenience copy of the per-minute request limit.
-
Object ChatKitSessionType discriminator that is always
chatkit.session.const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"
-
RateLimits ChatSessionRateLimitsResolved rate limit values.
-
MaxRequestsPer1Minute int64Maximum allowed requests per one-minute window.
-
-
Status ChatSessionStatusCurrent lifecycle state of the session.
-
const ChatSessionStatusActive ChatSessionStatus = "active" -
const ChatSessionStatusExpired ChatSessionStatus = "expired" -
const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"
-
-
User stringUser identifier associated with the session.
-
Workflow ChatKitWorkflowWorkflow metadata for the session.
-
ID stringIdentifier of the workflow backing the session.
-
StateVariables map[string, ChatKitWorkflowStateVariableUnion]State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.
-
string -
bool -
float64
-
-
Tracing ChatKitWorkflowTracingTracing settings applied to the workflow.
-
Enabled boolIndicates whether tracing is enabled.
-
-
Version stringSpecific workflow version used for the session. Defaults to null when using the latest deployment.
-
-
Chat Session Automatic Thread Titling
-
type ChatSessionAutomaticThreadTitling struct{…}Automatic thread title preferences for the session.
-
Enabled boolWhether automatic thread titling is enabled.
-
Chat Session ChatKit Configuration
-
type ChatSessionChatKitConfiguration struct{…}ChatKit configuration for the session.
-
AutomaticThreadTitling ChatSessionAutomaticThreadTitlingAutomatic thread titling preferences.
-
Enabled boolWhether automatic thread titling is enabled.
-
-
FileUpload ChatSessionFileUploadUpload settings for the session.
-
Enabled boolIndicates if uploads are enabled for the session.
-
MaxFileSize int64Maximum upload size in megabytes.
-
MaxFiles int64Maximum number of uploads allowed during the session.
-
-
History ChatSessionHistoryHistory retention configuration.
-
Enabled boolIndicates if chat history is persisted for the session.
-
RecentThreads int64Number of prior threads surfaced in history views. Defaults to null when all history is retained.
-
-
Chat Session ChatKit Configuration Param
-
type ChatSessionChatKitConfigurationParamResp struct{…}Optional per-session configuration settings for ChatKit behavior.
-
AutomaticThreadTitling ChatSessionChatKitConfigurationParamAutomaticThreadTitlingRespConfiguration for automatic thread titling. When omitted, automatic thread titling is enabled by default.
-
Enabled boolEnable automatic thread title generation. Defaults to true.
-
-
FileUpload ChatSessionChatKitConfigurationParamFileUploadRespConfiguration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB).
-
Enabled boolEnable uploads for this session. Defaults to false.
-
MaxFileSize int64Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size.
-
MaxFiles int64Maximum number of files that can be uploaded to the session. Defaults to 10.
-
-
History ChatSessionChatKitConfigurationParamHistoryRespConfiguration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null).
-
Enabled boolEnables chat users to access previous ChatKit threads. Defaults to true.
-
RecentThreads int64Number of recent ChatKit threads users have access to. Defaults to unlimited when unset.
-
-
Chat Session Expires After Param
-
type ChatSessionExpiresAfterParamResp struct{…}Controls when the session expires relative to an anchor timestamp.
-
Anchor CreatedAtBase timestamp used to calculate expiration. Currently fixed to
created_at.const CreatedAtCreatedAt CreatedAt = "created_at"
-
Seconds int64Number of seconds after the anchor when the session expires.
-
Chat Session File Upload
-
type ChatSessionFileUpload struct{…}Upload permissions and limits applied to the session.
-
Enabled boolIndicates if uploads are enabled for the session.
-
MaxFileSize int64Maximum upload size in megabytes.
-
MaxFiles int64Maximum number of uploads allowed during the session.
-
Chat Session History
-
type ChatSessionHistory struct{…}History retention preferences returned for the session.
-
Enabled boolIndicates if chat history is persisted for the session.
-
RecentThreads int64Number of prior threads surfaced in history views. Defaults to null when all history is retained.
-
Chat Session Rate Limits
-
type ChatSessionRateLimits struct{…}Active per-minute request limit for the session.
-
MaxRequestsPer1Minute int64Maximum allowed requests per one-minute window.
-
Chat Session Rate Limits Param
-
type ChatSessionRateLimitsParamResp struct{…}Controls request rate limits for the session.
-
MaxRequestsPer1Minute int64Maximum number of requests allowed per minute for the session. Defaults to 10.
-
Chat Session Status
-
type ChatSessionStatus string-
const ChatSessionStatusActive ChatSessionStatus = "active" -
const ChatSessionStatusExpired ChatSessionStatus = "expired" -
const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"
-
Chat Session Workflow Param
-
type ChatSessionWorkflowParamResp struct{…}Workflow reference and overrides applied to the chat session.
-
ID stringIdentifier for the workflow invoked by the session.
-
StateVariables map[string, ChatSessionWorkflowParamStateVariableUnionResp]State variables forwarded to the workflow. Keys may be up to 64 characters, values must be primitive types, and the map defaults to an empty object.
-
string -
bool -
float64
-
-
Tracing ChatSessionWorkflowParamTracingRespOptional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default.
-
Enabled boolWhether tracing is enabled during the session. Defaults to true.
-
-
Version stringSpecific workflow version to run. Defaults to the latest deployed version.
-
ChatKit Attachment
-
type ChatKitAttachment struct{…}Attachment metadata included on thread items.
-
ID stringIdentifier for the attachment.
-
MimeType stringMIME type of the attachment.
-
Name stringOriginal display name for the attachment.
-
PreviewURL stringPreview URL for rendering the attachment inline.
-
Type ChatKitAttachmentTypeAttachment discriminator.
-
const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image" -
const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"
-
-
ChatKit Response Output Text
-
type ChatKitResponseOutputText struct{…}Assistant response text accompanied by optional annotations.
-
Annotations []ChatKitResponseOutputTextAnnotationUnionOrdered list of annotations attached to the response text.
-
type ChatKitResponseOutputTextAnnotationFile struct{…}Annotation that references an uploaded file.
-
Source ChatKitResponseOutputTextAnnotationFileSourceFile attachment referenced by the annotation.
-
Filename stringFilename referenced by the annotation.
-
Type FileType discriminator that is always
file.const FileFile File = "file"
-
-
Type FileType discriminator that is always
filefor this annotation.const FileFile File = "file"
-
-
type ChatKitResponseOutputTextAnnotationURL struct{…}Annotation that references a URL.
-
Source ChatKitResponseOutputTextAnnotationURLSourceURL referenced by the annotation.
-
Type URLType discriminator that is always
url.const URLURL URL = "url"
-
URL stringURL referenced by the annotation.
-
-
Type URLType discriminator that is always
urlfor this annotation.const URLURL URL = "url"
-
-
-
Text stringAssistant generated text.
-
Type OutputTextType discriminator that is always
output_text.const OutputTextOutputText OutputText = "output_text"
-
ChatKit Thread
-
type ChatKitThread struct{…}Represents a ChatKit thread and its current status.
-
ID stringIdentifier of the thread.
-
CreatedAt int64Unix timestamp (in seconds) for when the thread was created.
-
Object ChatKitThreadType discriminator that is always
chatkit.thread.const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"
-
Status ChatKitThreadStatusUnionCurrent status for the thread. Defaults to
activefor newly created threads.-
type ChatKitThreadStatusActive struct{…}Indicates that a thread is active.
-
Type ActiveStatus discriminator that is always
active.const ActiveActive Active = "active"
-
-
type ChatKitThreadStatusLocked struct{…}Indicates that a thread is locked and cannot accept new input.
-
Reason stringReason that the thread was locked. Defaults to null when no reason is recorded.
-
Type LockedStatus discriminator that is always
locked.const LockedLocked Locked = "locked"
-
-
type ChatKitThreadStatusClosed struct{…}Indicates that a thread has been closed.
-
Reason stringReason that the thread was closed. Defaults to null when no reason is recorded.
-
Type ClosedStatus discriminator that is always
closed.const ClosedClosed Closed = "closed"
-
-
-
Title stringOptional human-readable title for the thread. Defaults to null when no title has been generated.
-
User stringFree-form string that identifies your end user who owns the thread.
-
ChatKit Thread Assistant Message Item
-
type ChatKitThreadAssistantMessageItem struct{…}Assistant-authored message within a thread.
-
ID stringIdentifier of the thread item.
-
Content []ChatKitResponseOutputTextOrdered assistant response segments.
-
Annotations []ChatKitResponseOutputTextAnnotationUnionOrdered list of annotations attached to the response text.
-
type ChatKitResponseOutputTextAnnotationFile struct{…}Annotation that references an uploaded file.
-
Source ChatKitResponseOutputTextAnnotationFileSourceFile attachment referenced by the annotation.
-
Filename stringFilename referenced by the annotation.
-
Type FileType discriminator that is always
file.const FileFile File = "file"
-
-
Type FileType discriminator that is always
filefor this annotation.const FileFile File = "file"
-
-
type ChatKitResponseOutputTextAnnotationURL struct{…}Annotation that references a URL.
-
Source ChatKitResponseOutputTextAnnotationURLSourceURL referenced by the annotation.
-
Type URLType discriminator that is always
url.const URLURL URL = "url"
-
URL stringURL referenced by the annotation.
-
-
Type URLType discriminator that is always
urlfor this annotation.const URLURL URL = "url"
-
-
-
Text stringAssistant generated text.
-
Type OutputTextType discriminator that is always
output_text.const OutputTextOutputText OutputText = "output_text"
-
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitAssistantMessageType discriminator that is always
chatkit.assistant_message.const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"
-
ChatKit Thread Item List
-
type ChatKitThreadItemList struct{…}A paginated list of thread items rendered for the ChatKit API.
-
Data []ChatKitThreadItemListDataUnionA list of items
-
type ChatKitThreadUserMessageItem struct{…}User-authored messages within a thread.
-
ID stringIdentifier of the thread item.
-
Attachments []ChatKitAttachmentAttachments associated with the user message. Defaults to an empty list.
-
ID stringIdentifier for the attachment.
-
MimeType stringMIME type of the attachment.
-
Name stringOriginal display name for the attachment.
-
PreviewURL stringPreview URL for rendering the attachment inline.
-
Type ChatKitAttachmentTypeAttachment discriminator.
-
const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image" -
const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"
-
-
-
Content []ChatKitThreadUserMessageItemContentUnionOrdered content elements supplied by the user.
-
type ChatKitThreadUserMessageItemContentInputText struct{…}Text block that a user contributed to the thread.
-
Text stringPlain-text content supplied by the user.
-
Type InputTextType discriminator that is always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ChatKitThreadUserMessageItemContentQuotedText struct{…}Quoted snippet that the user referenced in their message.
-
Text stringQuoted text content.
-
Type QuotedTextType discriminator that is always
quoted_text.const QuotedTextQuotedText QuotedText = "quoted_text"
-
-
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
InferenceOptions ChatKitThreadUserMessageItemInferenceOptionsInference overrides applied to the message. Defaults to null when unset.
-
Model stringModel name that generated the response. Defaults to null when using the session default.
-
ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoicePreferred tool to invoke. Defaults to null when ChatKit should auto-select.
-
ID stringIdentifier of the requested tool.
-
-
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitUserMessageconst ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"
-
-
type ChatKitThreadAssistantMessageItem struct{…}Assistant-authored message within a thread.
-
ID stringIdentifier of the thread item.
-
Content []ChatKitResponseOutputTextOrdered assistant response segments.
-
Annotations []ChatKitResponseOutputTextAnnotationUnionOrdered list of annotations attached to the response text.
-
type ChatKitResponseOutputTextAnnotationFile struct{…}Annotation that references an uploaded file.
-
Source ChatKitResponseOutputTextAnnotationFileSourceFile attachment referenced by the annotation.
-
Filename stringFilename referenced by the annotation.
-
Type FileType discriminator that is always
file.const FileFile File = "file"
-
-
Type FileType discriminator that is always
filefor this annotation.const FileFile File = "file"
-
-
type ChatKitResponseOutputTextAnnotationURL struct{…}Annotation that references a URL.
-
Source ChatKitResponseOutputTextAnnotationURLSourceURL referenced by the annotation.
-
Type URLType discriminator that is always
url.const URLURL URL = "url"
-
URL stringURL referenced by the annotation.
-
-
Type URLType discriminator that is always
urlfor this annotation.const URLURL URL = "url"
-
-
-
Text stringAssistant generated text.
-
Type OutputTextType discriminator that is always
output_text.const OutputTextOutputText OutputText = "output_text"
-
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitAssistantMessageType discriminator that is always
chatkit.assistant_message.const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"
-
-
type ChatKitWidgetItem struct{…}Thread item that renders a widget payload.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitWidgetType discriminator that is always
chatkit.widget.const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"
-
Widget stringSerialized widget payload rendered in the UI.
-
-
type ChatKitThreadItemListDataChatKitClientToolCall struct{…}Record of a client side tool invocation initiated by the assistant.
-
ID stringIdentifier of the thread item.
-
Arguments stringJSON-encoded arguments that were sent to the tool.
-
CallID stringIdentifier for the client tool call.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Name stringTool name that was invoked.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
Output stringJSON-encoded output captured from the tool. Defaults to null while execution is in progress.
-
Status stringExecution status for the tool call.
-
const ChatKitThreadItemListDataChatKitClientToolCallStatusInProgress ChatKitThreadItemListDataChatKitClientToolCallStatus = "in_progress" -
const ChatKitThreadItemListDataChatKitClientToolCallStatusCompleted ChatKitThreadItemListDataChatKitClientToolCallStatus = "completed"
-
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitClientToolCallType discriminator that is always
chatkit.client_tool_call.const ChatKitClientToolCallChatKitClientToolCall ChatKitClientToolCall = "chatkit.client_tool_call"
-
-
type ChatKitThreadItemListDataChatKitTask struct{…}Task emitted by the workflow to show progress and status updates.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Heading stringOptional heading for the task. Defaults to null when not provided.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
Summary stringOptional summary that describes the task. Defaults to null when omitted.
-
TaskType stringSubtype for the task.
-
const ChatKitThreadItemListDataChatKitTaskTaskTypeCustom ChatKitThreadItemListDataChatKitTaskTaskType = "custom" -
const ChatKitThreadItemListDataChatKitTaskTaskTypeThought ChatKitThreadItemListDataChatKitTaskTaskType = "thought"
-
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitTaskType discriminator that is always
chatkit.task.const ChatKitTaskChatKitTask ChatKitTask = "chatkit.task"
-
-
type ChatKitThreadItemListDataChatKitTaskGroup struct{…}Collection of workflow tasks grouped together in the thread.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
Tasks []ChatKitThreadItemListDataChatKitTaskGroupTaskTasks included in the group.
-
Heading stringOptional heading for the grouped task. Defaults to null when not provided.
-
Summary stringOptional summary that describes the grouped task. Defaults to null when omitted.
-
Type stringSubtype for the grouped task.
-
const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeCustom ChatKitThreadItemListDataChatKitTaskGroupTaskType = "custom" -
const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeThought ChatKitThreadItemListDataChatKitTaskGroupTaskType = "thought"
-
-
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitTaskGroupType discriminator that is always
chatkit.task_group.const ChatKitTaskGroupChatKitTaskGroup ChatKitTaskGroup = "chatkit.task_group"
-
-
-
FirstID stringThe ID of the first item in the list.
-
HasMore boolWhether there are more items available.
-
LastID stringThe ID of the last item in the list.
-
Object ListThe type of object returned, must be
list.const ListList List = "list"
-
ChatKit Thread User Message Item
-
type ChatKitThreadUserMessageItem struct{…}User-authored messages within a thread.
-
ID stringIdentifier of the thread item.
-
Attachments []ChatKitAttachmentAttachments associated with the user message. Defaults to an empty list.
-
ID stringIdentifier for the attachment.
-
MimeType stringMIME type of the attachment.
-
Name stringOriginal display name for the attachment.
-
PreviewURL stringPreview URL for rendering the attachment inline.
-
Type ChatKitAttachmentTypeAttachment discriminator.
-
const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image" -
const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"
-
-
-
Content []ChatKitThreadUserMessageItemContentUnionOrdered content elements supplied by the user.
-
type ChatKitThreadUserMessageItemContentInputText struct{…}Text block that a user contributed to the thread.
-
Text stringPlain-text content supplied by the user.
-
Type InputTextType discriminator that is always
input_text.const InputTextInputText InputText = "input_text"
-
-
type ChatKitThreadUserMessageItemContentQuotedText struct{…}Quoted snippet that the user referenced in their message.
-
Text stringQuoted text content.
-
Type QuotedTextType discriminator that is always
quoted_text.const QuotedTextQuotedText QuotedText = "quoted_text"
-
-
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
InferenceOptions ChatKitThreadUserMessageItemInferenceOptionsInference overrides applied to the message. Defaults to null when unset.
-
Model stringModel name that generated the response. Defaults to null when using the session default.
-
ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoicePreferred tool to invoke. Defaults to null when ChatKit should auto-select.
-
ID stringIdentifier of the requested tool.
-
-
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitUserMessageconst ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"
-
ChatKit Widget Item
-
type ChatKitWidgetItem struct{…}Thread item that renders a widget payload.
-
ID stringIdentifier of the thread item.
-
CreatedAt int64Unix timestamp (in seconds) for when the item was created.
-
Object ChatKitThreadItemType discriminator that is always
chatkit.thread_item.const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"
-
ThreadID stringIdentifier of the parent thread.
-
Type ChatKitWidgetType discriminator that is always
chatkit.widget.const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"
-
Widget stringSerialized widget payload rendered in the UI.
-