llmgleam/gemini
Types
pub type Candidate {
Candidate(
content: Content,
finish_reason: option.Option(String),
)
}
Constructors
-
Candidate(content: Content, finish_reason: option.Option(String))
pub type Content {
Content(parts: List(Part), role: option.Option(types.Role))
}
Constructors
-
Content(parts: List(Part), role: option.Option(types.Role))
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
-
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), )
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