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
Retrieve ChatKit thread
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)
}
{
"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
}
}
Returns Examples
{
"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
}
}