glopenai/chatkit
Types
pub type Annotation {
FileAnnotation(source: FileAnnotationSource)
UrlAnnotation(source: UrlAnnotationSource)
}
Constructors
-
FileAnnotation(source: FileAnnotationSource) -
UrlAnnotation(source: UrlAnnotationSource)
pub type Attachment {
Attachment(
attachment_type: AttachmentType,
id: String,
name: String,
mime_type: String,
preview_url: option.Option(String),
)
}
Constructors
-
Attachment( attachment_type: AttachmentType, id: String, name: String, mime_type: String, preview_url: option.Option(String), )
pub type AttachmentType {
AttachmentImage
AttachmentFile
}
Constructors
-
AttachmentImage -
AttachmentFile
pub type AutomaticThreadTitlingParam {
AutomaticThreadTitlingParam(enabled: option.Option(Bool))
}
Constructors
-
AutomaticThreadTitlingParam(enabled: option.Option(Bool))
pub type ChatSessionAutomaticThreadTitling {
ChatSessionAutomaticThreadTitling(enabled: Bool)
}
Constructors
-
ChatSessionAutomaticThreadTitling(enabled: Bool)
pub type ChatSessionChatkitConfiguration {
ChatSessionChatkitConfiguration(
automatic_thread_titling: ChatSessionAutomaticThreadTitling,
file_upload: ChatSessionFileUpload,
history: ChatSessionHistory,
)
}
Constructors
-
ChatSessionChatkitConfiguration( automatic_thread_titling: ChatSessionAutomaticThreadTitling, file_upload: ChatSessionFileUpload, history: ChatSessionHistory, )
pub type ChatSessionFileUpload {
ChatSessionFileUpload(
enabled: Bool,
max_file_size: option.Option(Int),
max_files: option.Option(Int),
)
}
Constructors
-
ChatSessionFileUpload( enabled: Bool, max_file_size: option.Option(Int), max_files: option.Option(Int), )
pub type ChatSessionHistory {
ChatSessionHistory(
enabled: Bool,
recent_threads: option.Option(Int),
)
}
Constructors
-
ChatSessionHistory( enabled: Bool, recent_threads: option.Option(Int), )
pub type ChatSessionRateLimits {
ChatSessionRateLimits(max_requests_per_1_minute: Int)
}
Constructors
-
ChatSessionRateLimits(max_requests_per_1_minute: Int)
pub type ChatSessionResource {
ChatSessionResource(
id: String,
object: String,
expires_at: Int,
client_secret: String,
workflow: ChatkitWorkflow,
user: String,
rate_limits: ChatSessionRateLimits,
max_requests_per_1_minute: Int,
status: ChatSessionStatus,
chatkit_configuration: ChatSessionChatkitConfiguration,
)
}
Constructors
-
ChatSessionResource( id: String, object: String, expires_at: Int, client_secret: String, workflow: ChatkitWorkflow, user: String, rate_limits: ChatSessionRateLimits, max_requests_per_1_minute: Int, status: ChatSessionStatus, chatkit_configuration: ChatSessionChatkitConfiguration, )
pub type ChatSessionStatus {
SessionActive
SessionExpired
SessionCancelled
}
Constructors
-
SessionActive -
SessionExpired -
SessionCancelled
pub type ChatkitConfigurationParam {
ChatkitConfigurationParam(
automatic_thread_titling: option.Option(
AutomaticThreadTitlingParam,
),
file_upload: option.Option(FileUploadParam),
history: option.Option(HistoryParam),
)
}
Constructors
-
ChatkitConfigurationParam( automatic_thread_titling: option.Option( AutomaticThreadTitlingParam, ), file_upload: option.Option(FileUploadParam), history: option.Option(HistoryParam), )
pub type ChatkitWorkflow {
ChatkitWorkflow(
id: String,
version: option.Option(String),
state_variables: option.Option(
dict.Dict(String, dynamic.Dynamic),
),
tracing: ChatkitWorkflowTracing,
)
}
Constructors
-
ChatkitWorkflow( id: String, version: option.Option(String), state_variables: option.Option( dict.Dict(String, dynamic.Dynamic), ), tracing: ChatkitWorkflowTracing, )Arguments
- state_variables
-
Workflow state-variable overrides. Values are arbitrary JSON.
pub type ChatkitWorkflowTracing {
ChatkitWorkflowTracing(enabled: Bool)
}
Constructors
-
ChatkitWorkflowTracing(enabled: Bool)
pub type ClientToolCallStatus {
ClientToolInProgress
ClientToolCompleted
}
Constructors
-
ClientToolInProgress -
ClientToolCompleted
pub type CreateChatSessionBody {
CreateChatSessionBody(
workflow: WorkflowParam,
user: String,
expires_after: option.Option(ExpiresAfterParam),
rate_limits: option.Option(RateLimitsParam),
chatkit_configuration: option.Option(
ChatkitConfigurationParam,
),
)
}
Constructors
-
CreateChatSessionBody( workflow: WorkflowParam, user: String, expires_after: option.Option(ExpiresAfterParam), rate_limits: option.Option(RateLimitsParam), chatkit_configuration: option.Option(ChatkitConfigurationParam), )
pub type DeletedThreadResource {
DeletedThreadResource(
id: String,
object: String,
deleted: Bool,
)
}
Constructors
-
DeletedThreadResource(id: String, object: String, deleted: Bool)
pub type ExpiresAfterParam {
ExpiresAfterParam(anchor: String, seconds: Int)
}
Constructors
-
ExpiresAfterParam(anchor: String, seconds: Int)
pub type FileAnnotationSource {
FileAnnotationSource(filename: String)
}
Constructors
-
FileAnnotationSource(filename: String)
pub type FileUploadParam {
FileUploadParam(
enabled: option.Option(Bool),
max_file_size: option.Option(Int),
max_files: option.Option(Int),
)
}
Constructors
-
FileUploadParam( enabled: option.Option(Bool), max_file_size: option.Option(Int), max_files: option.Option(Int), )
pub type HistoryParam {
HistoryParam(
enabled: option.Option(Bool),
recent_threads: option.Option(Int),
)
}
Constructors
-
HistoryParam( enabled: option.Option(Bool), recent_threads: option.Option(Int), )
pub type InferenceOptions {
InferenceOptions(
tool_choice: option.Option(ToolChoice),
model: option.Option(String),
)
}
Constructors
-
InferenceOptions( tool_choice: option.Option(ToolChoice), model: option.Option(String), )
pub type ListChatKitThreadItemsOrder {
ItemsAsc
ItemsDesc
}
Constructors
-
ItemsAsc -
ItemsDesc
pub type ListChatKitThreadItemsQuery {
ListChatKitThreadItemsQuery(
limit: option.Option(Int),
order: option.Option(ListChatKitThreadItemsOrder),
after: option.Option(String),
before: option.Option(String),
)
}
Constructors
-
ListChatKitThreadItemsQuery( limit: option.Option(Int), order: option.Option(ListChatKitThreadItemsOrder), after: option.Option(String), before: option.Option(String), )
pub type ListChatKitThreadsOrder {
ThreadsAsc
ThreadsDesc
}
Constructors
-
ThreadsAsc -
ThreadsDesc
pub type ListChatKitThreadsQuery {
ListChatKitThreadsQuery(
limit: option.Option(Int),
order: option.Option(ListChatKitThreadsOrder),
after: option.Option(String),
before: option.Option(String),
user: option.Option(String),
)
}
Constructors
-
ListChatKitThreadsQuery( limit: option.Option(Int), order: option.Option(ListChatKitThreadsOrder), after: option.Option(String), before: option.Option(String), user: option.Option(String), )
pub type RateLimitsParam {
RateLimitsParam(max_requests_per_1_minute: option.Option(Int))
}
Constructors
-
RateLimitsParam(max_requests_per_1_minute: option.Option(Int))
pub type ResponseOutputText {
ResponseOutputText(
output_text_type: String,
text: String,
annotations: List(Annotation),
)
}
Constructors
-
ResponseOutputText( output_text_type: String, text: String, annotations: List(Annotation), )
pub type TaskGroupTask {
TaskGroupTask(
task_type: TaskType,
heading: option.Option(String),
summary: option.Option(String),
)
}
Constructors
-
TaskGroupTask( task_type: TaskType, heading: option.Option(String), summary: option.Option(String), )
pub type ThreadItem {
UserMessageItem(
id: String,
object: String,
created_at: Int,
thread_id: String,
content: List(UserMessageContent),
attachments: List(Attachment),
inference_options: option.Option(InferenceOptions),
)
AssistantMessageItem(
id: String,
object: String,
created_at: Int,
thread_id: String,
content: List(ResponseOutputText),
)
WidgetMessageItem(
id: String,
object: String,
created_at: Int,
thread_id: String,
widget: String,
)
ClientToolCallItem(
id: String,
object: String,
created_at: Int,
thread_id: String,
status: ClientToolCallStatus,
call_id: String,
name: String,
arguments: String,
output: option.Option(String),
)
TaskItem(
id: String,
object: String,
created_at: Int,
thread_id: String,
task_type: TaskType,
heading: option.Option(String),
summary: option.Option(String),
)
TaskGroupItem(
id: String,
object: String,
created_at: Int,
thread_id: String,
tasks: List(TaskGroupTask),
)
}
Constructors
-
UserMessageItem( id: String, object: String, created_at: Int, thread_id: String, content: List(UserMessageContent), attachments: List(Attachment), inference_options: option.Option(InferenceOptions), ) -
AssistantMessageItem( id: String, object: String, created_at: Int, thread_id: String, content: List(ResponseOutputText), ) -
WidgetMessageItem( id: String, object: String, created_at: Int, thread_id: String, widget: String, ) -
ClientToolCallItem( id: String, object: String, created_at: Int, thread_id: String, status: ClientToolCallStatus, call_id: String, name: String, arguments: String, output: option.Option(String), ) -
TaskItem( id: String, object: String, created_at: Int, thread_id: String, task_type: TaskType, heading: option.Option(String), summary: option.Option(String), ) -
TaskGroupItem( id: String, object: String, created_at: Int, thread_id: String, tasks: List(TaskGroupTask), )
pub type ThreadItemListResource {
ThreadItemListResource(
object: String,
data: List(ThreadItem),
first_id: option.Option(String),
last_id: option.Option(String),
has_more: Bool,
)
}
Constructors
-
ThreadItemListResource( object: String, data: List(ThreadItem), first_id: option.Option(String), last_id: option.Option(String), has_more: Bool, )
pub type ThreadListResource {
ThreadListResource(
object: String,
data: List(ThreadResource),
first_id: option.Option(String),
last_id: option.Option(String),
has_more: Bool,
)
}
Constructors
-
ThreadListResource( object: String, data: List(ThreadResource), first_id: option.Option(String), last_id: option.Option(String), has_more: Bool, )
pub type ThreadResource {
ThreadResource(
id: String,
object: String,
created_at: Int,
title: option.Option(String),
status: ThreadStatus,
user: String,
items: option.Option(ThreadItemListResource),
)
}
Constructors
-
ThreadResource( id: String, object: String, created_at: Int, title: option.Option(String), status: ThreadStatus, user: String, items: option.Option(ThreadItemListResource), )Arguments
- status
-
Status discriminator. Wire format flattens these fields onto the thread object (e.g.
"type": "active"or"type": "locked", "reason": "...").
Status discriminator on a ThreadResource. Note: in the wire format these
fields are flattened directly onto the thread object, with type
distinguishing the variant.
pub type ThreadStatus {
ThreadActive
ThreadLocked(reason: option.Option(String))
ThreadClosed(reason: option.Option(String))
}
Constructors
-
ThreadActive -
ThreadLocked(reason: option.Option(String)) -
ThreadClosed(reason: option.Option(String))
pub type ToolChoice {
ToolChoice(id: String)
}
Constructors
-
ToolChoice(id: String)
pub type UrlAnnotationSource {
UrlAnnotationSource(url: String)
}
Constructors
-
UrlAnnotationSource(url: String)
pub type UserMessageContent {
InputTextContent(text: String)
QuotedTextContent(text: String)
}
Constructors
-
InputTextContent(text: String) -
QuotedTextContent(text: String)
pub type WorkflowParam {
WorkflowParam(
id: String,
version: option.Option(String),
state_variables: option.Option(
dict.Dict(String, dynamic.Dynamic),
),
tracing: option.Option(WorkflowTracingParam),
)
}
Constructors
-
WorkflowParam( id: String, version: option.Option(String), state_variables: option.Option( dict.Dict(String, dynamic.Dynamic), ), tracing: option.Option(WorkflowTracingParam), )
pub type WorkflowTracingParam {
WorkflowTracingParam(enabled: option.Option(Bool))
}
Constructors
-
WorkflowTracingParam(enabled: option.Option(Bool))
Values
pub fn annotation_decoder() -> decode.Decoder(Annotation)
pub fn automatic_thread_titling_param_to_json(
param: AutomaticThreadTitlingParam,
) -> json.Json
pub fn chat_session_rate_limits_decoder() -> decode.Decoder(
ChatSessionRateLimits,
)
pub fn chat_session_resource_decoder() -> decode.Decoder(
ChatSessionResource,
)
pub fn chat_session_status_decoder() -> decode.Decoder(
ChatSessionStatus,
)
pub fn chat_session_status_to_json(
status: ChatSessionStatus,
) -> json.Json
pub fn chatkit_configuration_param_to_json(
config: ChatkitConfigurationParam,
) -> json.Json
pub fn chatkit_workflow_decoder() -> decode.Decoder(
ChatkitWorkflow,
)
pub fn chatkit_workflow_to_json(
workflow: ChatkitWorkflow,
) -> json.Json
pub fn chatkit_workflow_tracing_decoder() -> decode.Decoder(
ChatkitWorkflowTracing,
)
pub fn chatkit_workflow_tracing_to_json(
tracing: ChatkitWorkflowTracing,
) -> json.Json
pub fn create_chat_session_body_to_json(
body: CreateChatSessionBody,
) -> json.Json
pub fn empty_list_thread_items_query() -> ListChatKitThreadItemsQuery
pub fn empty_list_threads_query() -> ListChatKitThreadsQuery
pub fn expires_after_param_to_json(
expires: ExpiresAfterParam,
) -> json.Json
pub fn file_upload_param_to_json(
param: FileUploadParam,
) -> json.Json
pub fn history_param_to_json(param: HistoryParam) -> json.Json
pub fn new_create_chat_session_body(
workflow: WorkflowParam,
user: String,
) -> CreateChatSessionBody
pub fn new_expires_after_param(seconds: Int) -> ExpiresAfterParam
Default anchor "created_at".
pub fn new_workflow_param(id: String) -> WorkflowParam
pub fn new_workflow_tracing_param() -> WorkflowTracingParam
pub fn rate_limits_param_to_json(
rate_limits: RateLimitsParam,
) -> json.Json
pub fn session_cancel_request(
config: config.Config,
session_id: String,
) -> request.Request(String)
pub fn session_cancel_response(
response: response.Response(String),
) -> Result(ChatSessionResource, error.GlopenaiError)
pub fn session_create_request(
config: config.Config,
body: CreateChatSessionBody,
) -> request.Request(String)
pub fn session_create_response(
response: response.Response(String),
) -> Result(ChatSessionResource, error.GlopenaiError)
pub fn thread_delete_request(
config: config.Config,
thread_id: String,
) -> request.Request(String)
pub fn thread_delete_response(
response: response.Response(String),
) -> Result(DeletedThreadResource, error.GlopenaiError)
pub fn thread_item_decoder() -> decode.Decoder(ThreadItem)
pub fn thread_items_list_request(
config: config.Config,
thread_id: String,
) -> request.Request(String)
pub fn thread_items_list_request_with_query(
config: config.Config,
thread_id: String,
query: ListChatKitThreadItemsQuery,
) -> request.Request(String)
pub fn thread_items_list_response(
response: response.Response(String),
) -> Result(ThreadItemListResource, error.GlopenaiError)
pub fn thread_list_request(
config: config.Config,
) -> request.Request(String)
pub fn thread_list_request_with_query(
config: config.Config,
query: ListChatKitThreadsQuery,
) -> request.Request(String)
pub fn thread_list_response(
response: response.Response(String),
) -> Result(ThreadListResource, error.GlopenaiError)
pub fn thread_resource_decoder() -> decode.Decoder(ThreadResource)
pub fn thread_retrieve_request(
config: config.Config,
thread_id: String,
) -> request.Request(String)
pub fn thread_retrieve_response(
response: response.Response(String),
) -> Result(ThreadResource, error.GlopenaiError)
pub fn thread_status_decoder() -> decode.Decoder(ThreadStatus)
pub fn with_chatkit_configuration(
body: CreateChatSessionBody,
configuration: ChatkitConfigurationParam,
) -> CreateChatSessionBody
pub fn with_expires_after(
body: CreateChatSessionBody,
expires_after: ExpiresAfterParam,
) -> CreateChatSessionBody
pub fn with_rate_limits(
body: CreateChatSessionBody,
rate_limits: RateLimitsParam,
) -> CreateChatSessionBody
pub fn workflow_param_to_json(
workflow: WorkflowParam,
) -> json.Json
pub fn workflow_param_with_state_variables(
workflow: WorkflowParam,
state_variables: dict.Dict(String, dynamic.Dynamic),
) -> WorkflowParam
pub fn workflow_param_with_tracing(
workflow: WorkflowParam,
tracing: WorkflowTracingParam,
) -> WorkflowParam
pub fn workflow_param_with_version(
workflow: WorkflowParam,
version: String,
) -> WorkflowParam
pub fn workflow_tracing_param_to_json(
tracing: WorkflowTracingParam,
) -> json.Json