gemini

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package gemini provides a model.Client implementation backed by the Google Gen AI SDK. It translates loom-mcp requests into Gemini GenerateContent calls and maps responses back into the generic planner structures.

Package gemini wires Google Gemini model clients into loom-mcp planners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements model.Client using Gemini GenerateContent calls.

func New

func New(opts Options) (*Client, error)

New builds a Gemini-backed model client from the provided options.

func NewFromAPIKey

func NewFromAPIKey(apiKey, defaultModel string) (*Client, error)

NewFromAPIKey constructs a Gemini API client using the official Gen AI SDK.

func (*Client) Complete

func (c *Client) Complete(ctx context.Context, req *model.Request) (*model.Response, error)

Complete renders a response using the configured Gemini client.

func (*Client) Stream

Stream reports that Gemini streaming is not yet supported by this adapter.

type ModelsClient

type ModelsClient interface {
	GenerateContent(ctx context.Context, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (*genai.GenerateContentResponse, error)
}

ModelsClient captures the subset of the Gen AI SDK used by the adapter.

type Options

type Options struct {
	// Client is the underlying Gen AI models client.
	Client ModelsClient

	// DefaultModel is the model identifier used when Request.Model is empty.
	DefaultModel string

	// HighModel is used when Request.ModelClass is high-reasoning and
	// Request.Model is empty.
	HighModel string

	// SmallModel is used when Request.ModelClass is small and Request.Model is
	// empty.
	SmallModel string
}

Options configures optional Gemini adapter behavior.

Jump to

Keyboard shortcuts

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