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),
    tools: List(types.Tool),
    tool_exchanges: List(
      #(types.Completion, List(types.ToolOutput)),
    ),
    pending_completion: option.Option(types.Completion),
    tool_outputs: List(types.ToolOutput),
  )
}

Constructors

pub type GenerateContentResponse {
  GenerateContentResponse(candidates: List(Candidate))
}

Constructors

  • GenerateContentResponse(candidates: List(Candidate))
pub type Part {
  TextPart(text: String)
  FunctionCallPart(call: types.ToolCall)
  IgnoredPart
}

Constructors

  • TextPart(text: String)
  • FunctionCallPart(call: types.ToolCall)
  • IgnoredPart

Values

pub fn generate_content(
  client: GeminiClientInternal,
  model: String,
  messages: List(types.ChatMessage),
  system_instruction: option.Option(String),
  tools: List(types.Tool),
  tool_exchanges: List(
    #(types.Completion, List(types.ToolOutput)),
  ),
  pending_completion: option.Option(types.Completion),
  tool_outputs: List(types.ToolOutput),
) -> Result(types.Completion, types.CompletionError)
pub fn role_to_str(role: types.Role) -> String
✨ Search Document