gllm/types/chat_completion
This module defines the ChatCompletion type and parsing functionality for API responses.
Types
pub type ChatCompletion {
ChatCompletion(
id: String,
provider: String,
model: String,
object: String,
created: Int,
choices: List(choice.Choice),
usage: usage.Usage,
)
}
Constructors
-
ChatCompletion( id: String, provider: String, model: String, object: String, created: Int, choices: List(choice.Choice), usage: usage.Usage, )
Values
pub fn chat_completion_decoder() -> decode.Decoder(ChatCompletion)
pub fn parse_chat_completion(
json_string: String,
) -> Result(ChatCompletion, json.DecodeError)
Parses a JSON string into a ChatCompletion object.