Create ChatKit session
beta.chatkit.sessions.create(**kwargs) -> ChatSession { id, chatkit_configuration, client_secret, 7 more }
POST/chatkit/sessions
Create a ChatKit session
Parameters
user: String
A free-form string that identifies your end user; ensures this Session can access other objects that have the same user scope.
minLength1
Returns
Create ChatKit session
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
chat_session = openai.beta.chatkit.sessions.create(user: "x", workflow: {id: "id"})
puts(chat_session){
"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"
}
}Returns Examples
{
"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"
}
}