llmgleam/gemini

Types

pub type Candidate {
  Candidate(
    content: Content,
    finish_reason: option.Option(String),
  )
}

Constructors

pub type Content {
  Content(parts: List(Part), role: option.Option(types.Role))
}

Constructors

pub type GeminiClientInternal {
  GeminiClientInternal(api_key: String)
}

Constructors

  • GeminiClientInternal(api_key: String)
pub type GenerateContentRequest {
  GenerateContentRequest(contents: List(Content))
}

Constructors

  • GenerateContentRequest(contents: List(Content))
pub type GenerateContentResponse {
  GenerateContentResponse(candidates: List(Candidate))
}

Constructors

  • GenerateContentResponse(candidates: List(Candidate))
pub type Part {
  TextPart(text: String)
}

Constructors

  • TextPart(text: String)

Values

pub fn generate_content(
  client: GeminiClientInternal,
  model: String,
  messages: List(types.ChatMessage),
) -> Result(types.Completion, types.CompletionError)
Search Document