google

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package google implements llm.Model using the official Google Gen AI Go SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements llm.Model backed by the Google Generative AI API.

func New

func New(ctx context.Context, apiKey, modelName string) (*Provider, error)

New creates a Provider for the given model using the Gemini Developer API.

func (*Provider) GenerateContent

func (p *Provider) GenerateContent(ctx context.Context, messages []llm.Message, tools []llm.ToolDef, maxTokens int) (*llm.Response, error)

GenerateContent sends messages to the Gemini API and returns a normalised llm.Response.

func (*Provider) GenerateStructuredContent

func (p *Provider) GenerateStructuredContent(ctx context.Context, messages []llm.Message, schema map[string]any, config llm.StructuredConfig) (*llm.Response, error)

GenerateStructuredContent sends a request to the Gemini API with a JSON Schema to enforce structured output.

Jump to

Keyboard shortcuts

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