gleamstral/chat/response

Types

pub type ChatCompletionChoice {
  ChatCompletionChoice(
    index: Int,
    message: message.Message,
    finish_reason: FinishReason,
  )
}

Constructors

  • ChatCompletionChoice(
      index: Int,
      message: message.Message,
      finish_reason: FinishReason,
    )
pub type FinishReason {
  Stop
  Length
  ModelLength
  Err
  ToolCalls
}

Constructors

  • Stop
  • Length
  • ModelLength
  • Err
  • ToolCalls
pub type Response {
  Response(
    id: String,
    object: String,
    created: Int,
    model: String,
    choices: List(ChatCompletionChoice),
    usage: Usage,
  )
}

Constructors

  • Response(
      id: String,
      object: String,
      created: Int,
      model: String,
      choices: List(ChatCompletionChoice),
      usage: Usage,
    )
pub type Usage {
  Usage(
    prompt_tokens: Int,
    completion_tokens: Int,
    total_tokens: Int,
  )
}

Constructors

  • Usage(
      prompt_tokens: Int,
      completion_tokens: Int,
      total_tokens: Int,
    )

Functions

pub fn response_decoder() -> Decoder(Response)
Search Document