gemini

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gemini implements providers.ModelProvider against the Gemini API (generateContent with native function calling). It maps RunLore's engine- agnostic exchange (OpenAI-shaped: assistant tool_calls + separate tool messages) onto Gemini's contents/parts form: assistant turns become role "model" with functionCall parts, and tool results coalesce into one role "user" turn of functionResponse parts. Each call/response carries the originating call id, so parallel calls to the same function name correlate by id (Gemini's rule for parallel calls); when the model returns no id, correlation falls back to name.

Index

Constants

View Source
const DefaultBaseURL = "https://generativelanguage.googleapis.com"

DefaultBaseURL is the public Gemini API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Gemini (generateContent) model provider.

func New

func New(baseURL, model, apiKey string) *Client

New builds a client. baseURL may be empty (defaults to DefaultBaseURL).

func (*Client) Complete

Complete sends a generateContent request with tools and maps the result back.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL