pub struct ChatCompletion {
id : String
choices : Array[ChatCompletionChoice]
created : Int
model : String
usage : CompletionUsage?
}pub struct ChatCompletionAssistantMessageParam {
content : String?
name : String?
tool_calls : Array[ChatCompletionMessageToolCall]
}pub struct ChatCompletionChoice {
finish_reason : ChatCompletionChoiceFinishReason
index : Int
message : ChatCompletionMessage
}pub enum ChatCompletionChoiceFinishReason {
Stop
Length
ToolCalls
ContentFilter
FunctionCall
}pub struct ChatCompletionMessage {
content : String?
tool_calls : Array[ChatCompletionMessageToolCall]
}pub enum ChatCompletionMessageParam {
System(ChatCompletionSystemMessageParam)
User(ChatCompletionUserMessageParam)
Assistant(ChatCompletionAssistantMessageParam)
Tool(ChatCompletionToolMessageParam)
}pub struct ChatCompletionSystemMessageParam {
content : String
name : String?
}pub struct ChatCompletionToolMessageParam {
content : String
tool_call_id : String
}pub struct ChatCompletionUserMessageParam {
content : String
name : String?
}type Clientfn Client::create_chat_completion(self : Client, messages~ : Array[ChatCompletionMessageParam], model~ : String, tools? : Array[ChatCompletionToolParam]) -> ChatCompletion raise Errorpub struct CompletionUsage {
completion_tokens : Int
prompt_tokens : Int
total_tokens : Int
}fn function_tool(name~ : String, description~ : String, parameters~ : Map[String, Json], strict? : Bool) -> ChatCompletionToolParam