lingo

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 23 Imported by: 0

README

Lingo

Go Reference

A unified Go gateway for multiple LLM providers. Lingo provides a consistent interface to interact with various Large Language Model APIs including OpenAI, Anthropic, Google Gemini, AWS Bedrock, Perplexity, and Ollama.

Features

  • Unified Interface: Single API to interact with multiple LLM providers
  • Type-Safe Models: Strongly typed model configurations with fluent builder pattern
  • Built-in Rate Limiting: Automatic retry with exponential backoff for rate-limited requests
  • Provider Health Checks: Monitor the health of your LLM providers
  • Extensible Logging: Pluggable logging interface with zerolog adapter included
  • Official SDKs: Uses official SDKs where available for maximum compatibility

Supported Providers

Provider Models
OpenAI GPT-4o, GPT-4o-mini, GPT-4 Turbo, o1, o1-mini, o3-mini
Anthropic Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus
Google Gemini Gemini 2.5 Pro/Flash, Gemini 2.0 Flash, Gemini 1.5 Pro/Flash
AWS Bedrock Claude, Llama, Titan, and other Bedrock models
Perplexity Sonar, Sonar Pro, Sonar Reasoning
Ollama Any locally running Ollama model

Installation

go get github.com/gerdou/lingo

Quick Start

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/gerdou/lingo"
)

func main() {
    // Create a gateway with multiple providers
    gateway, err := lingo.New([]lingo.ProviderConfig{
        &lingo.OpenAIConfig{APIKey: "your-openai-key"},
        &lingo.AnthropicConfig{APIKey: "your-anthropic-key"},
        &lingo.GoogleConfig{APIKey: "your-google-key"},
    })
    if err != nil {
        log.Fatal(err)
    }
    defer gateway.Close()

    // Use OpenAI
    response, err := gateway.Generate(
        context.Background(),
        lingo.NewGPT4o().WithMaxTokens(1000).WithTemperature(0.7),
        "Explain quantum computing in simple terms",
    )
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(response.Text)

    // Use Anthropic with the same gateway
    response, err = gateway.Generate(
        context.Background(),
        lingo.NewClaude35Sonnet().WithMaxTokens(1000),
        "Write a haiku about programming",
    )
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(response.Text)
}

Provider Configuration

OpenAI
config := &lingo.OpenAIConfig{
    APIKey:      "your-api-key",
    Timeout:     60 * time.Second,
    RateLimiter: lingo.DefaultRateLimitConfig(),
}

// Available models
model := lingo.NewGPT4o()
model := lingo.NewGPT4oMini()
model := lingo.NewO1()
model := lingo.NewO1Mini()
model := lingo.NewO3Mini()
Anthropic
config := &lingo.AnthropicConfig{
    APIKey:  "your-api-key",
    Timeout: 60 * time.Second,
}

// Available models
model := lingo.NewClaude35Sonnet()
model := lingo.NewClaude35Haiku()
model := lingo.NewClaude3Opus()
Google Gemini
config := &lingo.GoogleConfig{
    APIKey:  "your-api-key",
    Timeout: 60 * time.Second,
}

// Available models
model := lingo.NewGemini25Pro()
model := lingo.NewGemini25Flash()
model := lingo.NewGemini20Flash()
model := lingo.NewGemini15Pro()
AWS Bedrock
config := &lingo.BedrockConfig{
    Region: "us-east-1",
    // Uses default AWS credentials chain
}

// Or with explicit credentials
config := &lingo.BedrockConfig{
    Region:          "us-east-1",
    AccessKeyID:     "your-access-key",
    SecretAccessKey: "your-secret-key",
}
Perplexity
config := &lingo.PerplexityConfig{
    APIKey: "your-api-key",
}

// Available models
model := lingo.NewSonar()
model := lingo.NewSonarPro()
model := lingo.NewSonarReasoning()
Ollama
config := &lingo.OllamaConfig{
    BaseURL: "http://localhost:11434", // default
}

// Use any model running in Ollama
model := lingo.NewOllamaModel("llama2")
model := lingo.NewOllamaModel("mistral")

Model Configuration

All models support a fluent builder pattern for configuration:

model := lingo.NewGPT4o().
    WithMaxTokens(2000).
    WithTemperature(0.8).
    WithTopP(0.9).
    WithSystemPrompt("You are a helpful assistant")

Logging

Lingo supports pluggable logging. Use the built-in zerolog adapter:

import "github.com/rs/zerolog"

logger := zerolog.New(os.Stdout).With().Timestamp().Logger()

gateway, err := lingo.New(
    configs,
    lingo.WithZerolog(logger),
)

Or implement your own logger:

type MyLogger struct{}

func (l *MyLogger) Debug() lingo.LogEvent { /* ... */ }
func (l *MyLogger) Info() lingo.LogEvent  { /* ... */ }
func (l *MyLogger) Error() lingo.LogEvent { /* ... */ }

gateway, err := lingo.New(configs, lingo.WithLogger(&MyLogger{}))

Rate Limiting

Built-in rate limit handling with exponential backoff:

config := &lingo.OpenAIConfig{
    APIKey: "your-api-key",
    RateLimiter: &lingo.RateLimitConfig{
        MaxRetries:        5,
        InitialBackoff:    1 * time.Second,
        MaxBackoff:        60 * time.Second,
        BackoffMultiplier: 2.0,
    },
}

Health Checks

Monitor provider availability:

// Check specific provider
err := gateway.Health(ctx, lingo.ProviderOpenAI)

// List all registered providers
providers := gateway.ListRegisteredProviders()

// Check if provider is registered
if gateway.IsRegistered(lingo.ProviderAnthropic) {
    // Use Anthropic
}

Response Structure

type GenerationResponse struct {
    Text         string            // Generated text
    Provider     ProviderType      // Provider used
    Model        string            // Model used
    Usage        TokenUsage        // Token counts
    FinishReason string            // Why generation stopped
    Metadata     map[string]string // Provider-specific data
}

type TokenUsage struct {
    PromptTokens     int
    CompletionTokens int
    TotalTokens      int
}

License

MIT License - see LICENSE for details.

Documentation

Overview

Package llmux provides a unified gateway for multiple LLM providers. It supports OpenAI, Anthropic, Google AI, and Perplexity models with a consistent interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPerplexityClient

func GetPerplexityClient(g *LLMGateway) (*perplexityClient, error)

GetPerplexityClient returns the underlying Perplexity client for Search API access

func RegisterProvider

func RegisterProvider(providerType ProviderType, factory ProviderFactory)

RegisterProvider registers a provider factory. Called by provider implementations in their init().

Types

type AnthropicConfig

type AnthropicConfig struct {
	// APIKey is the Anthropic API key (required)
	APIKey string
	// Timeout is the request timeout (default: 60s)
	Timeout time.Duration
	// RateLimiter is the optional rate limit configuration
	RateLimiter *RateLimitConfig
}

AnthropicConfig contains configuration for the Anthropic provider

type BedrockClaude35Haiku

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

BedrockClaude35Haiku represents Claude 3.5 Haiku on Bedrock

func NewBedrockClaude35Haiku

func NewBedrockClaude35Haiku() *BedrockClaude35Haiku

NewBedrockClaude35Haiku creates a new Claude 3.5 Haiku model for Bedrock

func (*BedrockClaude35Haiku) ModelName

func (m *BedrockClaude35Haiku) ModelName() string

func (*BedrockClaude35Haiku) Provider

func (m *BedrockClaude35Haiku) Provider() ProviderType

func (*BedrockClaude35Haiku) SystemPrompt

func (m *BedrockClaude35Haiku) SystemPrompt() string

func (*BedrockClaude35Haiku) WithMaxTokens

func (m *BedrockClaude35Haiku) WithMaxTokens(n int) *BedrockClaude35Haiku

func (*BedrockClaude35Haiku) WithSystemPrompt

func (m *BedrockClaude35Haiku) WithSystemPrompt(s string) *BedrockClaude35Haiku

func (*BedrockClaude35Haiku) WithTemperature

func (m *BedrockClaude35Haiku) WithTemperature(t float64) *BedrockClaude35Haiku

func (*BedrockClaude35Haiku) WithTopK

func (*BedrockClaude35Haiku) WithTopP

type BedrockClaude35Sonnet

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

BedrockClaude35Sonnet represents Claude 3.5 Sonnet on Bedrock

func NewBedrockClaude35Sonnet

func NewBedrockClaude35Sonnet() *BedrockClaude35Sonnet

NewBedrockClaude35Sonnet creates a new Claude 3.5 Sonnet model for Bedrock

func (*BedrockClaude35Sonnet) ModelName

func (m *BedrockClaude35Sonnet) ModelName() string

func (*BedrockClaude35Sonnet) Provider

func (m *BedrockClaude35Sonnet) Provider() ProviderType

func (*BedrockClaude35Sonnet) SystemPrompt

func (m *BedrockClaude35Sonnet) SystemPrompt() string

func (*BedrockClaude35Sonnet) WithMaxTokens

func (m *BedrockClaude35Sonnet) WithMaxTokens(n int) *BedrockClaude35Sonnet

func (*BedrockClaude35Sonnet) WithSystemPrompt

func (m *BedrockClaude35Sonnet) WithSystemPrompt(s string) *BedrockClaude35Sonnet

func (*BedrockClaude35Sonnet) WithTemperature

func (m *BedrockClaude35Sonnet) WithTemperature(t float64) *BedrockClaude35Sonnet

func (*BedrockClaude35Sonnet) WithTopK

func (*BedrockClaude35Sonnet) WithTopP

type BedrockClaude3Haiku

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

BedrockClaude3Haiku represents Claude 3 Haiku on Bedrock

func NewBedrockClaude3Haiku

func NewBedrockClaude3Haiku() *BedrockClaude3Haiku

NewBedrockClaude3Haiku creates a new Claude 3 Haiku model for Bedrock

func (*BedrockClaude3Haiku) ModelName

func (m *BedrockClaude3Haiku) ModelName() string

func (*BedrockClaude3Haiku) Provider

func (m *BedrockClaude3Haiku) Provider() ProviderType

func (*BedrockClaude3Haiku) SystemPrompt

func (m *BedrockClaude3Haiku) SystemPrompt() string

func (*BedrockClaude3Haiku) WithMaxTokens

func (m *BedrockClaude3Haiku) WithMaxTokens(n int) *BedrockClaude3Haiku

func (*BedrockClaude3Haiku) WithSystemPrompt

func (m *BedrockClaude3Haiku) WithSystemPrompt(s string) *BedrockClaude3Haiku

func (*BedrockClaude3Haiku) WithTemperature

func (m *BedrockClaude3Haiku) WithTemperature(t float64) *BedrockClaude3Haiku

func (*BedrockClaude3Haiku) WithTopK

func (*BedrockClaude3Haiku) WithTopP

type BedrockClaude3Opus

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

BedrockClaude3Opus represents Claude 3 Opus on Bedrock

func NewBedrockClaude3Opus

func NewBedrockClaude3Opus() *BedrockClaude3Opus

NewBedrockClaude3Opus creates a new Claude 3 Opus model for Bedrock

func (*BedrockClaude3Opus) ModelName

func (m *BedrockClaude3Opus) ModelName() string

func (*BedrockClaude3Opus) Provider

func (m *BedrockClaude3Opus) Provider() ProviderType

func (*BedrockClaude3Opus) SystemPrompt

func (m *BedrockClaude3Opus) SystemPrompt() string

func (*BedrockClaude3Opus) WithMaxTokens

func (m *BedrockClaude3Opus) WithMaxTokens(n int) *BedrockClaude3Opus

func (*BedrockClaude3Opus) WithSystemPrompt

func (m *BedrockClaude3Opus) WithSystemPrompt(s string) *BedrockClaude3Opus

func (*BedrockClaude3Opus) WithTemperature

func (m *BedrockClaude3Opus) WithTemperature(t float64) *BedrockClaude3Opus

func (*BedrockClaude3Opus) WithTopK

func (m *BedrockClaude3Opus) WithTopK(k int) *BedrockClaude3Opus

func (*BedrockClaude3Opus) WithTopP

type BedrockClaude3Sonnet

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

BedrockClaude3Sonnet represents Claude 3 Sonnet on Bedrock

func NewBedrockClaude3Sonnet

func NewBedrockClaude3Sonnet() *BedrockClaude3Sonnet

NewBedrockClaude3Sonnet creates a new Claude 3 Sonnet model for Bedrock

func (*BedrockClaude3Sonnet) ModelName

func (m *BedrockClaude3Sonnet) ModelName() string

func (*BedrockClaude3Sonnet) Provider

func (m *BedrockClaude3Sonnet) Provider() ProviderType

func (*BedrockClaude3Sonnet) SystemPrompt

func (m *BedrockClaude3Sonnet) SystemPrompt() string

func (*BedrockClaude3Sonnet) WithMaxTokens

func (m *BedrockClaude3Sonnet) WithMaxTokens(n int) *BedrockClaude3Sonnet

func (*BedrockClaude3Sonnet) WithSystemPrompt

func (m *BedrockClaude3Sonnet) WithSystemPrompt(s string) *BedrockClaude3Sonnet

func (*BedrockClaude3Sonnet) WithTemperature

func (m *BedrockClaude3Sonnet) WithTemperature(t float64) *BedrockClaude3Sonnet

func (*BedrockClaude3Sonnet) WithTopK

func (*BedrockClaude3Sonnet) WithTopP

type BedrockConfig

type BedrockConfig struct {
	// Region is the AWS region (required, e.g., "us-east-1")
	Region string
	// Profile is the AWS profile name from ~/.aws/credentials or ~/.aws/config (optional)
	Profile string
	// AccessKeyID is the AWS access key ID (optional if using IAM roles, environment, or profile)
	AccessKeyID string
	// SecretAccessKey is the AWS secret access key (optional if using IAM roles, environment, or profile)
	SecretAccessKey string
	// SessionToken is the AWS session token for temporary credentials (optional)
	SessionToken string
	// Timeout is the request timeout (default: 60s)
	Timeout time.Duration
	// RateLimiter is the optional rate limit configuration
	RateLimiter *RateLimitConfig
}

BedrockConfig contains configuration for the AWS Bedrock provider

type BedrockLlama31Instruct405B

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

BedrockLlama31Instruct405B represents Meta Llama 3.1 405B Instruct on Bedrock

func NewBedrockLlama31Instruct405B

func NewBedrockLlama31Instruct405B() *BedrockLlama31Instruct405B

NewBedrockLlama31Instruct405B creates a new Llama 3.1 405B Instruct model for Bedrock

func (*BedrockLlama31Instruct405B) ModelName

func (m *BedrockLlama31Instruct405B) ModelName() string

func (*BedrockLlama31Instruct405B) Provider

func (*BedrockLlama31Instruct405B) SystemPrompt

func (m *BedrockLlama31Instruct405B) SystemPrompt() string

func (*BedrockLlama31Instruct405B) WithMaxTokens

func (*BedrockLlama31Instruct405B) WithSystemPrompt

func (*BedrockLlama31Instruct405B) WithTemperature

func (*BedrockLlama31Instruct405B) WithTopP

type BedrockLlama31Instruct70B

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

BedrockLlama31Instruct70B represents Meta Llama 3.1 70B Instruct on Bedrock

func NewBedrockLlama31Instruct70B

func NewBedrockLlama31Instruct70B() *BedrockLlama31Instruct70B

NewBedrockLlama31Instruct70B creates a new Llama 3.1 70B Instruct model for Bedrock

func (*BedrockLlama31Instruct70B) ModelName

func (m *BedrockLlama31Instruct70B) ModelName() string

func (*BedrockLlama31Instruct70B) Provider

func (*BedrockLlama31Instruct70B) SystemPrompt

func (m *BedrockLlama31Instruct70B) SystemPrompt() string

func (*BedrockLlama31Instruct70B) WithMaxTokens

func (*BedrockLlama31Instruct70B) WithSystemPrompt

func (*BedrockLlama31Instruct70B) WithTemperature

func (*BedrockLlama31Instruct70B) WithTopP

type BedrockLlama31Instruct8B

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

BedrockLlama31Instruct8B represents Meta Llama 3.1 8B Instruct on Bedrock

func NewBedrockLlama31Instruct8B

func NewBedrockLlama31Instruct8B() *BedrockLlama31Instruct8B

NewBedrockLlama31Instruct8B creates a new Llama 3.1 8B Instruct model for Bedrock

func (*BedrockLlama31Instruct8B) ModelName

func (m *BedrockLlama31Instruct8B) ModelName() string

func (*BedrockLlama31Instruct8B) Provider

func (m *BedrockLlama31Instruct8B) Provider() ProviderType

func (*BedrockLlama31Instruct8B) SystemPrompt

func (m *BedrockLlama31Instruct8B) SystemPrompt() string

func (*BedrockLlama31Instruct8B) WithMaxTokens

func (*BedrockLlama31Instruct8B) WithSystemPrompt

func (*BedrockLlama31Instruct8B) WithTemperature

func (*BedrockLlama31Instruct8B) WithTopP

type BedrockLlama32Instruct1B

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

BedrockLlama32Instruct1B represents Meta Llama 3.2 1B Instruct on Bedrock

func NewBedrockLlama32Instruct1B

func NewBedrockLlama32Instruct1B() *BedrockLlama32Instruct1B

NewBedrockLlama32Instruct1B creates a new Llama 3.2 1B Instruct model for Bedrock

func (*BedrockLlama32Instruct1B) ModelName

func (m *BedrockLlama32Instruct1B) ModelName() string

func (*BedrockLlama32Instruct1B) Provider

func (m *BedrockLlama32Instruct1B) Provider() ProviderType

func (*BedrockLlama32Instruct1B) SystemPrompt

func (m *BedrockLlama32Instruct1B) SystemPrompt() string

func (*BedrockLlama32Instruct1B) WithMaxTokens

func (*BedrockLlama32Instruct1B) WithSystemPrompt

func (*BedrockLlama32Instruct1B) WithTemperature

func (*BedrockLlama32Instruct1B) WithTopP

type BedrockLlama32Instruct3B

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

BedrockLlama32Instruct3B represents Meta Llama 3.2 3B Instruct on Bedrock

func NewBedrockLlama32Instruct3B

func NewBedrockLlama32Instruct3B() *BedrockLlama32Instruct3B

NewBedrockLlama32Instruct3B creates a new Llama 3.2 3B Instruct model for Bedrock

func (*BedrockLlama32Instruct3B) ModelName

func (m *BedrockLlama32Instruct3B) ModelName() string

func (*BedrockLlama32Instruct3B) Provider

func (m *BedrockLlama32Instruct3B) Provider() ProviderType

func (*BedrockLlama32Instruct3B) SystemPrompt

func (m *BedrockLlama32Instruct3B) SystemPrompt() string

func (*BedrockLlama32Instruct3B) WithMaxTokens

func (*BedrockLlama32Instruct3B) WithSystemPrompt

func (*BedrockLlama32Instruct3B) WithTemperature

func (*BedrockLlama32Instruct3B) WithTopP

type BedrockMistral7B

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

BedrockMistral7B represents Mistral 7B Instruct on Bedrock

func NewBedrockMistral7B

func NewBedrockMistral7B() *BedrockMistral7B

NewBedrockMistral7B creates a new Mistral 7B Instruct model for Bedrock

func (*BedrockMistral7B) ModelName

func (m *BedrockMistral7B) ModelName() string

func (*BedrockMistral7B) Provider

func (m *BedrockMistral7B) Provider() ProviderType

func (*BedrockMistral7B) SystemPrompt

func (m *BedrockMistral7B) SystemPrompt() string

func (*BedrockMistral7B) WithMaxTokens

func (m *BedrockMistral7B) WithMaxTokens(n int) *BedrockMistral7B

func (*BedrockMistral7B) WithSystemPrompt

func (m *BedrockMistral7B) WithSystemPrompt(s string) *BedrockMistral7B

func (*BedrockMistral7B) WithTemperature

func (m *BedrockMistral7B) WithTemperature(t float64) *BedrockMistral7B

func (*BedrockMistral7B) WithTopK

func (m *BedrockMistral7B) WithTopK(k int) *BedrockMistral7B

func (*BedrockMistral7B) WithTopP

func (m *BedrockMistral7B) WithTopP(p float64) *BedrockMistral7B

type BedrockMistralLarge

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

BedrockMistralLarge represents Mistral Large on Bedrock

func NewBedrockMistralLarge

func NewBedrockMistralLarge() *BedrockMistralLarge

NewBedrockMistralLarge creates a new Mistral Large model for Bedrock

func (*BedrockMistralLarge) ModelName

func (m *BedrockMistralLarge) ModelName() string

func (*BedrockMistralLarge) Provider

func (m *BedrockMistralLarge) Provider() ProviderType

func (*BedrockMistralLarge) SystemPrompt

func (m *BedrockMistralLarge) SystemPrompt() string

func (*BedrockMistralLarge) WithMaxTokens

func (m *BedrockMistralLarge) WithMaxTokens(n int) *BedrockMistralLarge

func (*BedrockMistralLarge) WithSystemPrompt

func (m *BedrockMistralLarge) WithSystemPrompt(s string) *BedrockMistralLarge

func (*BedrockMistralLarge) WithTemperature

func (m *BedrockMistralLarge) WithTemperature(t float64) *BedrockMistralLarge

func (*BedrockMistralLarge) WithTopK

func (*BedrockMistralLarge) WithTopP

type BedrockMixtral8x7B

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

BedrockMixtral8x7B represents Mixtral 8x7B Instruct on Bedrock

func NewBedrockMixtral8x7B

func NewBedrockMixtral8x7B() *BedrockMixtral8x7B

NewBedrockMixtral8x7B creates a new Mixtral 8x7B Instruct model for Bedrock

func (*BedrockMixtral8x7B) ModelName

func (m *BedrockMixtral8x7B) ModelName() string

func (*BedrockMixtral8x7B) Provider

func (m *BedrockMixtral8x7B) Provider() ProviderType

func (*BedrockMixtral8x7B) SystemPrompt

func (m *BedrockMixtral8x7B) SystemPrompt() string

func (*BedrockMixtral8x7B) WithMaxTokens

func (m *BedrockMixtral8x7B) WithMaxTokens(n int) *BedrockMixtral8x7B

func (*BedrockMixtral8x7B) WithSystemPrompt

func (m *BedrockMixtral8x7B) WithSystemPrompt(s string) *BedrockMixtral8x7B

func (*BedrockMixtral8x7B) WithTemperature

func (m *BedrockMixtral8x7B) WithTemperature(t float64) *BedrockMixtral8x7B

func (*BedrockMixtral8x7B) WithTopK

func (m *BedrockMixtral8x7B) WithTopK(k int) *BedrockMixtral8x7B

func (*BedrockMixtral8x7B) WithTopP

type BedrockModel

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

BedrockModel represents a generic Bedrock model Use this for any model available in your Bedrock environment

func NewBedrockModel

func NewBedrockModel(modelID, modelFamily string) *BedrockModel

NewBedrockModel creates a new generic Bedrock model with the specified model ID modelFamily should be one of: "claude", "titan", "llama", "mistral"

func (*BedrockModel) ModelName

func (m *BedrockModel) ModelName() string

func (*BedrockModel) Provider

func (m *BedrockModel) Provider() ProviderType

func (*BedrockModel) SystemPrompt

func (m *BedrockModel) SystemPrompt() string

func (*BedrockModel) WithMaxTokens

func (m *BedrockModel) WithMaxTokens(n int) *BedrockModel

func (*BedrockModel) WithModelFamily

func (m *BedrockModel) WithModelFamily(f string) *BedrockModel

func (*BedrockModel) WithSystemPrompt

func (m *BedrockModel) WithSystemPrompt(s string) *BedrockModel

func (*BedrockModel) WithTemperature

func (m *BedrockModel) WithTemperature(t float64) *BedrockModel

func (*BedrockModel) WithTopK

func (m *BedrockModel) WithTopK(k int) *BedrockModel

func (*BedrockModel) WithTopP

func (m *BedrockModel) WithTopP(p float64) *BedrockModel

type BedrockTitanTextExpress

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

BedrockTitanTextExpress represents Amazon Titan Text Express

func NewBedrockTitanTextExpress

func NewBedrockTitanTextExpress() *BedrockTitanTextExpress

NewBedrockTitanTextExpress creates a new Titan Text Express model for Bedrock

func (*BedrockTitanTextExpress) ModelName

func (m *BedrockTitanTextExpress) ModelName() string

func (*BedrockTitanTextExpress) Provider

func (m *BedrockTitanTextExpress) Provider() ProviderType

func (*BedrockTitanTextExpress) SystemPrompt

func (m *BedrockTitanTextExpress) SystemPrompt() string

func (*BedrockTitanTextExpress) WithMaxTokens

func (*BedrockTitanTextExpress) WithSystemPrompt

func (m *BedrockTitanTextExpress) WithSystemPrompt(s string) *BedrockTitanTextExpress

func (*BedrockTitanTextExpress) WithTemperature

func (*BedrockTitanTextExpress) WithTopP

type BedrockTitanTextLite

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

BedrockTitanTextLite represents Amazon Titan Text Lite

func NewBedrockTitanTextLite

func NewBedrockTitanTextLite() *BedrockTitanTextLite

NewBedrockTitanTextLite creates a new Titan Text Lite model for Bedrock

func (*BedrockTitanTextLite) ModelName

func (m *BedrockTitanTextLite) ModelName() string

func (*BedrockTitanTextLite) Provider

func (m *BedrockTitanTextLite) Provider() ProviderType

func (*BedrockTitanTextLite) SystemPrompt

func (m *BedrockTitanTextLite) SystemPrompt() string

func (*BedrockTitanTextLite) WithMaxTokens

func (m *BedrockTitanTextLite) WithMaxTokens(n int) *BedrockTitanTextLite

func (*BedrockTitanTextLite) WithSystemPrompt

func (m *BedrockTitanTextLite) WithSystemPrompt(s string) *BedrockTitanTextLite

func (*BedrockTitanTextLite) WithTemperature

func (m *BedrockTitanTextLite) WithTemperature(t float64) *BedrockTitanTextLite

func (*BedrockTitanTextLite) WithTopP

type BedrockTitanTextPremier

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

BedrockTitanTextPremier represents Amazon Titan Text Premier

func NewBedrockTitanTextPremier

func NewBedrockTitanTextPremier() *BedrockTitanTextPremier

NewBedrockTitanTextPremier creates a new Titan Text Premier model for Bedrock

func (*BedrockTitanTextPremier) ModelName

func (m *BedrockTitanTextPremier) ModelName() string

func (*BedrockTitanTextPremier) Provider

func (m *BedrockTitanTextPremier) Provider() ProviderType

func (*BedrockTitanTextPremier) SystemPrompt

func (m *BedrockTitanTextPremier) SystemPrompt() string

func (*BedrockTitanTextPremier) WithMaxTokens

func (*BedrockTitanTextPremier) WithSystemPrompt

func (m *BedrockTitanTextPremier) WithSystemPrompt(s string) *BedrockTitanTextPremier

func (*BedrockTitanTextPremier) WithTemperature

func (*BedrockTitanTextPremier) WithTopP

type Claude35Haiku

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

Claude35Haiku represents the Claude 3.5 Haiku model Versions: claude-3-5-haiku-20241022, claude-3-5-haiku-latest

func NewClaude35Haiku

func NewClaude35Haiku() *Claude35Haiku

NewClaude35Haiku creates a new Claude 3.5 Haiku model with default options

func (*Claude35Haiku) ModelName

func (m *Claude35Haiku) ModelName() string

func (*Claude35Haiku) Provider

func (m *Claude35Haiku) Provider() ProviderType

func (*Claude35Haiku) SystemPrompt

func (m *Claude35Haiku) SystemPrompt() string

func (*Claude35Haiku) WithMaxTokens

func (m *Claude35Haiku) WithMaxTokens(n int) *Claude35Haiku

func (*Claude35Haiku) WithSystemPrompt

func (m *Claude35Haiku) WithSystemPrompt(s string) *Claude35Haiku

func (*Claude35Haiku) WithTemperature

func (m *Claude35Haiku) WithTemperature(t float64) *Claude35Haiku

func (*Claude35Haiku) WithTopK

func (m *Claude35Haiku) WithTopK(k int) *Claude35Haiku

func (*Claude35Haiku) WithTopP

func (m *Claude35Haiku) WithTopP(p float64) *Claude35Haiku

func (*Claude35Haiku) WithVersion

func (m *Claude35Haiku) WithVersion(v string) *Claude35Haiku

type Claude35Sonnet

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

Claude35Sonnet represents the Claude 3.5 Sonnet model Versions: claude-3-5-sonnet-20241022, claude-3-5-sonnet-latest

func NewClaude35Sonnet

func NewClaude35Sonnet() *Claude35Sonnet

NewClaude35Sonnet creates a new Claude 3.5 Sonnet model with default options

func (*Claude35Sonnet) ModelName

func (m *Claude35Sonnet) ModelName() string

func (*Claude35Sonnet) Provider

func (m *Claude35Sonnet) Provider() ProviderType

func (*Claude35Sonnet) SystemPrompt

func (m *Claude35Sonnet) SystemPrompt() string

func (*Claude35Sonnet) WithMaxTokens

func (m *Claude35Sonnet) WithMaxTokens(n int) *Claude35Sonnet

func (*Claude35Sonnet) WithSystemPrompt

func (m *Claude35Sonnet) WithSystemPrompt(s string) *Claude35Sonnet

func (*Claude35Sonnet) WithTemperature

func (m *Claude35Sonnet) WithTemperature(t float64) *Claude35Sonnet

func (*Claude35Sonnet) WithTopK

func (m *Claude35Sonnet) WithTopK(k int) *Claude35Sonnet

func (*Claude35Sonnet) WithTopP

func (m *Claude35Sonnet) WithTopP(p float64) *Claude35Sonnet

func (*Claude35Sonnet) WithVersion

func (m *Claude35Sonnet) WithVersion(v string) *Claude35Sonnet

type Claude37Sonnet

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

Claude37Sonnet represents the Claude 3.7 Sonnet model (supports extended thinking) Versions: claude-3-7-sonnet-20250219, claude-3-7-sonnet-latest

func NewClaude37Sonnet

func NewClaude37Sonnet() *Claude37Sonnet

NewClaude37Sonnet creates a new Claude 3.7 Sonnet model with default options

func (*Claude37Sonnet) ModelName

func (m *Claude37Sonnet) ModelName() string

func (*Claude37Sonnet) Provider

func (m *Claude37Sonnet) Provider() ProviderType

func (*Claude37Sonnet) SystemPrompt

func (m *Claude37Sonnet) SystemPrompt() string

func (*Claude37Sonnet) WithMaxTokens

func (m *Claude37Sonnet) WithMaxTokens(n int) *Claude37Sonnet

func (*Claude37Sonnet) WithSystemPrompt

func (m *Claude37Sonnet) WithSystemPrompt(s string) *Claude37Sonnet

func (*Claude37Sonnet) WithTemperature

func (m *Claude37Sonnet) WithTemperature(t float64) *Claude37Sonnet

func (*Claude37Sonnet) WithThinkingBudget

func (m *Claude37Sonnet) WithThinkingBudget(n int) *Claude37Sonnet

func (*Claude37Sonnet) WithTopK

func (m *Claude37Sonnet) WithTopK(k int) *Claude37Sonnet

func (*Claude37Sonnet) WithTopP

func (m *Claude37Sonnet) WithTopP(p float64) *Claude37Sonnet

func (*Claude37Sonnet) WithVersion

func (m *Claude37Sonnet) WithVersion(v string) *Claude37Sonnet

type Claude3Haiku

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

Claude3Haiku represents the Claude 3 Haiku model

func NewClaude3Haiku

func NewClaude3Haiku() *Claude3Haiku

NewClaude3Haiku creates a new Claude 3 Haiku model with default options

func (*Claude3Haiku) ModelName

func (m *Claude3Haiku) ModelName() string

func (*Claude3Haiku) Provider

func (m *Claude3Haiku) Provider() ProviderType

func (*Claude3Haiku) SystemPrompt

func (m *Claude3Haiku) SystemPrompt() string

func (*Claude3Haiku) WithMaxTokens

func (m *Claude3Haiku) WithMaxTokens(n int) *Claude3Haiku

func (*Claude3Haiku) WithSystemPrompt

func (m *Claude3Haiku) WithSystemPrompt(s string) *Claude3Haiku

func (*Claude3Haiku) WithTemperature

func (m *Claude3Haiku) WithTemperature(t float64) *Claude3Haiku

func (*Claude3Haiku) WithTopK

func (m *Claude3Haiku) WithTopK(k int) *Claude3Haiku

func (*Claude3Haiku) WithTopP

func (m *Claude3Haiku) WithTopP(p float64) *Claude3Haiku

type Claude3Opus

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

Claude3Opus represents the Claude 3 Opus model Versions: claude-3-opus-20240229, claude-3-opus-latest

func NewClaude3Opus

func NewClaude3Opus() *Claude3Opus

NewClaude3Opus creates a new Claude 3 Opus model with default options

func (*Claude3Opus) ModelName

func (m *Claude3Opus) ModelName() string

func (*Claude3Opus) Provider

func (m *Claude3Opus) Provider() ProviderType

func (*Claude3Opus) SystemPrompt

func (m *Claude3Opus) SystemPrompt() string

func (*Claude3Opus) WithMaxTokens

func (m *Claude3Opus) WithMaxTokens(n int) *Claude3Opus

func (*Claude3Opus) WithSystemPrompt

func (m *Claude3Opus) WithSystemPrompt(s string) *Claude3Opus

func (*Claude3Opus) WithTemperature

func (m *Claude3Opus) WithTemperature(t float64) *Claude3Opus

func (*Claude3Opus) WithTopK

func (m *Claude3Opus) WithTopK(k int) *Claude3Opus

func (*Claude3Opus) WithTopP

func (m *Claude3Opus) WithTopP(p float64) *Claude3Opus

func (*Claude3Opus) WithVersion

func (m *Claude3Opus) WithVersion(v string) *Claude3Opus

type Claude3Sonnet

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

Claude3Sonnet represents the Claude 3 Sonnet model

func NewClaude3Sonnet

func NewClaude3Sonnet() *Claude3Sonnet

NewClaude3Sonnet creates a new Claude 3 Sonnet model with default options

func (*Claude3Sonnet) ModelName

func (m *Claude3Sonnet) ModelName() string

func (*Claude3Sonnet) Provider

func (m *Claude3Sonnet) Provider() ProviderType

func (*Claude3Sonnet) SystemPrompt

func (m *Claude3Sonnet) SystemPrompt() string

func (*Claude3Sonnet) WithMaxTokens

func (m *Claude3Sonnet) WithMaxTokens(n int) *Claude3Sonnet

func (*Claude3Sonnet) WithSystemPrompt

func (m *Claude3Sonnet) WithSystemPrompt(s string) *Claude3Sonnet

func (*Claude3Sonnet) WithTemperature

func (m *Claude3Sonnet) WithTemperature(t float64) *Claude3Sonnet

func (*Claude3Sonnet) WithTopK

func (m *Claude3Sonnet) WithTopK(k int) *Claude3Sonnet

func (*Claude3Sonnet) WithTopP

func (m *Claude3Sonnet) WithTopP(p float64) *Claude3Sonnet

type ClaudeHaiku45

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

ClaudeHaiku45 represents the Claude Haiku 4.5 model (supports extended thinking)

func NewClaudeHaiku45

func NewClaudeHaiku45() *ClaudeHaiku45

NewClaudeHaiku45 creates a new Claude Haiku 4.5 model with default options

func (*ClaudeHaiku45) ModelName

func (m *ClaudeHaiku45) ModelName() string

func (*ClaudeHaiku45) Provider

func (m *ClaudeHaiku45) Provider() ProviderType

func (*ClaudeHaiku45) SystemPrompt

func (m *ClaudeHaiku45) SystemPrompt() string

func (*ClaudeHaiku45) WithMaxTokens

func (m *ClaudeHaiku45) WithMaxTokens(n int) *ClaudeHaiku45

func (*ClaudeHaiku45) WithSystemPrompt

func (m *ClaudeHaiku45) WithSystemPrompt(s string) *ClaudeHaiku45

func (*ClaudeHaiku45) WithTemperature

func (m *ClaudeHaiku45) WithTemperature(t float64) *ClaudeHaiku45

func (*ClaudeHaiku45) WithThinkingBudget

func (m *ClaudeHaiku45) WithThinkingBudget(n int) *ClaudeHaiku45

func (*ClaudeHaiku45) WithTopK

func (m *ClaudeHaiku45) WithTopK(k int) *ClaudeHaiku45

func (*ClaudeHaiku45) WithTopP

func (m *ClaudeHaiku45) WithTopP(p float64) *ClaudeHaiku45

type ClaudeOpus4

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

ClaudeOpus4 represents the Claude Opus 4 model (supports extended thinking)

func NewClaudeOpus4

func NewClaudeOpus4() *ClaudeOpus4

NewClaudeOpus4 creates a new Claude Opus 4 model with default options

func (*ClaudeOpus4) ModelName

func (m *ClaudeOpus4) ModelName() string

func (*ClaudeOpus4) Provider

func (m *ClaudeOpus4) Provider() ProviderType

func (*ClaudeOpus4) SystemPrompt

func (m *ClaudeOpus4) SystemPrompt() string

func (*ClaudeOpus4) WithMaxTokens

func (m *ClaudeOpus4) WithMaxTokens(n int) *ClaudeOpus4

func (*ClaudeOpus4) WithSystemPrompt

func (m *ClaudeOpus4) WithSystemPrompt(s string) *ClaudeOpus4

func (*ClaudeOpus4) WithTemperature

func (m *ClaudeOpus4) WithTemperature(t float64) *ClaudeOpus4

func (*ClaudeOpus4) WithThinkingBudget

func (m *ClaudeOpus4) WithThinkingBudget(n int) *ClaudeOpus4

func (*ClaudeOpus4) WithTopK

func (m *ClaudeOpus4) WithTopK(k int) *ClaudeOpus4

func (*ClaudeOpus4) WithTopP

func (m *ClaudeOpus4) WithTopP(p float64) *ClaudeOpus4

type ClaudeOpus45

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

ClaudeOpus45 represents the Claude Opus 4.5 model (supports extended thinking)

func NewClaudeOpus45

func NewClaudeOpus45() *ClaudeOpus45

NewClaudeOpus45 creates a new Claude Opus 4.5 model with default options

func (*ClaudeOpus45) ModelName

func (m *ClaudeOpus45) ModelName() string

func (*ClaudeOpus45) Provider

func (m *ClaudeOpus45) Provider() ProviderType

func (*ClaudeOpus45) SystemPrompt

func (m *ClaudeOpus45) SystemPrompt() string

func (*ClaudeOpus45) WithMaxTokens

func (m *ClaudeOpus45) WithMaxTokens(n int) *ClaudeOpus45

func (*ClaudeOpus45) WithSystemPrompt

func (m *ClaudeOpus45) WithSystemPrompt(s string) *ClaudeOpus45

func (*ClaudeOpus45) WithTemperature

func (m *ClaudeOpus45) WithTemperature(t float64) *ClaudeOpus45

func (*ClaudeOpus45) WithThinkingBudget

func (m *ClaudeOpus45) WithThinkingBudget(n int) *ClaudeOpus45

func (*ClaudeOpus45) WithTopK

func (m *ClaudeOpus45) WithTopK(k int) *ClaudeOpus45

func (*ClaudeOpus45) WithTopP

func (m *ClaudeOpus45) WithTopP(p float64) *ClaudeOpus45

type ClaudeSonnet4

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

ClaudeSonnet4 represents the Claude Sonnet 4 model (supports extended thinking)

func NewClaudeSonnet4

func NewClaudeSonnet4() *ClaudeSonnet4

NewClaudeSonnet4 creates a new Claude Sonnet 4 model with default options

func (*ClaudeSonnet4) ModelName

func (m *ClaudeSonnet4) ModelName() string

func (*ClaudeSonnet4) Provider

func (m *ClaudeSonnet4) Provider() ProviderType

func (*ClaudeSonnet4) SystemPrompt

func (m *ClaudeSonnet4) SystemPrompt() string

func (*ClaudeSonnet4) WithMaxTokens

func (m *ClaudeSonnet4) WithMaxTokens(n int) *ClaudeSonnet4

func (*ClaudeSonnet4) WithSystemPrompt

func (m *ClaudeSonnet4) WithSystemPrompt(s string) *ClaudeSonnet4

func (*ClaudeSonnet4) WithTemperature

func (m *ClaudeSonnet4) WithTemperature(t float64) *ClaudeSonnet4

func (*ClaudeSonnet4) WithThinkingBudget

func (m *ClaudeSonnet4) WithThinkingBudget(n int) *ClaudeSonnet4

func (*ClaudeSonnet4) WithTopK

func (m *ClaudeSonnet4) WithTopK(k int) *ClaudeSonnet4

func (*ClaudeSonnet4) WithTopP

func (m *ClaudeSonnet4) WithTopP(p float64) *ClaudeSonnet4

type ClaudeSonnet45

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

ClaudeSonnet45 represents the Claude Sonnet 4.5 model (supports extended thinking)

func NewClaudeSonnet45

func NewClaudeSonnet45() *ClaudeSonnet45

NewClaudeSonnet45 creates a new Claude Sonnet 4.5 model with default options

func (*ClaudeSonnet45) ModelName

func (m *ClaudeSonnet45) ModelName() string

func (*ClaudeSonnet45) Provider

func (m *ClaudeSonnet45) Provider() ProviderType

func (*ClaudeSonnet45) SystemPrompt

func (m *ClaudeSonnet45) SystemPrompt() string

func (*ClaudeSonnet45) WithMaxTokens

func (m *ClaudeSonnet45) WithMaxTokens(n int) *ClaudeSonnet45

func (*ClaudeSonnet45) WithSystemPrompt

func (m *ClaudeSonnet45) WithSystemPrompt(s string) *ClaudeSonnet45

func (*ClaudeSonnet45) WithTemperature

func (m *ClaudeSonnet45) WithTemperature(t float64) *ClaudeSonnet45

func (*ClaudeSonnet45) WithThinkingBudget

func (m *ClaudeSonnet45) WithThinkingBudget(n int) *ClaudeSonnet45

func (*ClaudeSonnet45) WithTopK

func (m *ClaudeSonnet45) WithTopK(k int) *ClaudeSonnet45

func (*ClaudeSonnet45) WithTopP

func (m *ClaudeSonnet45) WithTopP(p float64) *ClaudeSonnet45

type CodeLlama

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

CodeLlama represents the Code Llama model

func NewCodeLlama

func NewCodeLlama() *CodeLlama

NewCodeLlama creates a new Code Llama model with default options

func (*CodeLlama) ModelName

func (m *CodeLlama) ModelName() string

func (*CodeLlama) Provider

func (m *CodeLlama) Provider() ProviderType

func (*CodeLlama) SystemPrompt

func (m *CodeLlama) SystemPrompt() string

func (*CodeLlama) WithMaxTokens

func (m *CodeLlama) WithMaxTokens(n int) *CodeLlama

func (*CodeLlama) WithNumCtx

func (m *CodeLlama) WithNumCtx(n int) *CodeLlama

func (*CodeLlama) WithRepeatPenalty

func (m *CodeLlama) WithRepeatPenalty(p float64) *CodeLlama

func (*CodeLlama) WithSeed

func (m *CodeLlama) WithSeed(s int) *CodeLlama

func (*CodeLlama) WithSystemPrompt

func (m *CodeLlama) WithSystemPrompt(s string) *CodeLlama

func (*CodeLlama) WithTemperature

func (m *CodeLlama) WithTemperature(t float64) *CodeLlama

func (*CodeLlama) WithTopK

func (m *CodeLlama) WithTopK(k int) *CodeLlama

func (*CodeLlama) WithTopP

func (m *CodeLlama) WithTopP(p float64) *CodeLlama

type DeepSeekCoder

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

DeepSeekCoder represents the DeepSeek Coder model

func NewDeepSeekCoder

func NewDeepSeekCoder() *DeepSeekCoder

NewDeepSeekCoder creates a new DeepSeek Coder model with default options

func (*DeepSeekCoder) ModelName

func (m *DeepSeekCoder) ModelName() string

func (*DeepSeekCoder) Provider

func (m *DeepSeekCoder) Provider() ProviderType

func (*DeepSeekCoder) SystemPrompt

func (m *DeepSeekCoder) SystemPrompt() string

func (*DeepSeekCoder) WithMaxTokens

func (m *DeepSeekCoder) WithMaxTokens(n int) *DeepSeekCoder

func (*DeepSeekCoder) WithNumCtx

func (m *DeepSeekCoder) WithNumCtx(n int) *DeepSeekCoder

func (*DeepSeekCoder) WithRepeatPenalty

func (m *DeepSeekCoder) WithRepeatPenalty(p float64) *DeepSeekCoder

func (*DeepSeekCoder) WithSeed

func (m *DeepSeekCoder) WithSeed(s int) *DeepSeekCoder

func (*DeepSeekCoder) WithSystemPrompt

func (m *DeepSeekCoder) WithSystemPrompt(s string) *DeepSeekCoder

func (*DeepSeekCoder) WithTemperature

func (m *DeepSeekCoder) WithTemperature(t float64) *DeepSeekCoder

func (*DeepSeekCoder) WithTopK

func (m *DeepSeekCoder) WithTopK(k int) *DeepSeekCoder

func (*DeepSeekCoder) WithTopP

func (m *DeepSeekCoder) WithTopP(p float64) *DeepSeekCoder

type GPT35Turbo

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

GPT35Turbo represents the GPT-3.5-turbo model Versions: gpt-3.5-turbo, gpt-3.5-turbo-0125

func NewGPT35Turbo

func NewGPT35Turbo() *GPT35Turbo

NewGPT35Turbo creates a new GPT-3.5-turbo model with default options

func (*GPT35Turbo) ModelName

func (m *GPT35Turbo) ModelName() string

func (*GPT35Turbo) Provider

func (m *GPT35Turbo) Provider() ProviderType

func (*GPT35Turbo) SystemPrompt

func (m *GPT35Turbo) SystemPrompt() string

func (*GPT35Turbo) WithMaxTokens

func (m *GPT35Turbo) WithMaxTokens(n int) *GPT35Turbo

func (*GPT35Turbo) WithSystemPrompt

func (m *GPT35Turbo) WithSystemPrompt(s string) *GPT35Turbo

func (*GPT35Turbo) WithTemperature

func (m *GPT35Turbo) WithTemperature(t float64) *GPT35Turbo

func (*GPT35Turbo) WithTopP

func (m *GPT35Turbo) WithTopP(p float64) *GPT35Turbo

func (*GPT35Turbo) WithVersion

func (m *GPT35Turbo) WithVersion(v string) *GPT35Turbo

type GPT4

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

GPT4 represents the GPT-4 model Versions: gpt-4, gpt-4-0613

func NewGPT4

func NewGPT4() *GPT4

NewGPT4 creates a new GPT-4 model with default options

func (*GPT4) ModelName

func (m *GPT4) ModelName() string

func (*GPT4) Provider

func (m *GPT4) Provider() ProviderType

func (*GPT4) SystemPrompt

func (m *GPT4) SystemPrompt() string

func (*GPT4) WithMaxTokens

func (m *GPT4) WithMaxTokens(n int) *GPT4

func (*GPT4) WithSystemPrompt

func (m *GPT4) WithSystemPrompt(s string) *GPT4

func (*GPT4) WithTemperature

func (m *GPT4) WithTemperature(t float64) *GPT4

func (*GPT4) WithTopP

func (m *GPT4) WithTopP(p float64) *GPT4

func (*GPT4) WithVersion

func (m *GPT4) WithVersion(v string) *GPT4

type GPT41

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

GPT41 represents the GPT-4.1 model Versions: gpt-4.1, gpt-4.1-2025-04-14

func NewGPT41

func NewGPT41() *GPT41

NewGPT41 creates a new GPT-4.1 model with default options

func (*GPT41) ModelName

func (m *GPT41) ModelName() string

func (*GPT41) Provider

func (m *GPT41) Provider() ProviderType

func (*GPT41) SystemPrompt

func (m *GPT41) SystemPrompt() string

func (*GPT41) WithMaxTokens

func (m *GPT41) WithMaxTokens(n int) *GPT41

func (*GPT41) WithSystemPrompt

func (m *GPT41) WithSystemPrompt(s string) *GPT41

func (*GPT41) WithTemperature

func (m *GPT41) WithTemperature(t float64) *GPT41

func (*GPT41) WithTopP

func (m *GPT41) WithTopP(p float64) *GPT41

func (*GPT41) WithVersion

func (m *GPT41) WithVersion(v string) *GPT41

type GPT41Mini

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

GPT41Mini represents the GPT-4.1-mini model

func NewGPT41Mini

func NewGPT41Mini() *GPT41Mini

NewGPT41Mini creates a new GPT-4.1-mini model with default options

func (*GPT41Mini) ModelName

func (m *GPT41Mini) ModelName() string

func (*GPT41Mini) Provider

func (m *GPT41Mini) Provider() ProviderType

func (*GPT41Mini) SystemPrompt

func (m *GPT41Mini) SystemPrompt() string

func (*GPT41Mini) WithMaxTokens

func (m *GPT41Mini) WithMaxTokens(n int) *GPT41Mini

func (*GPT41Mini) WithSystemPrompt

func (m *GPT41Mini) WithSystemPrompt(s string) *GPT41Mini

func (*GPT41Mini) WithTemperature

func (m *GPT41Mini) WithTemperature(t float64) *GPT41Mini

func (*GPT41Mini) WithTopP

func (m *GPT41Mini) WithTopP(p float64) *GPT41Mini

type GPT41Nano

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

GPT41Nano represents the GPT-4.1-nano model

func NewGPT41Nano

func NewGPT41Nano() *GPT41Nano

NewGPT41Nano creates a new GPT-4.1-nano model with default options

func (*GPT41Nano) ModelName

func (m *GPT41Nano) ModelName() string

func (*GPT41Nano) Provider

func (m *GPT41Nano) Provider() ProviderType

func (*GPT41Nano) SystemPrompt

func (m *GPT41Nano) SystemPrompt() string

func (*GPT41Nano) WithMaxTokens

func (m *GPT41Nano) WithMaxTokens(n int) *GPT41Nano

func (*GPT41Nano) WithSystemPrompt

func (m *GPT41Nano) WithSystemPrompt(s string) *GPT41Nano

func (*GPT41Nano) WithTemperature

func (m *GPT41Nano) WithTemperature(t float64) *GPT41Nano

func (*GPT41Nano) WithTopP

func (m *GPT41Nano) WithTopP(p float64) *GPT41Nano

type GPT4Turbo

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

GPT4Turbo represents the GPT-4-turbo model Versions: gpt-4-turbo, gpt-4-turbo-2024-04-09, gpt-4-turbo-preview

func NewGPT4Turbo

func NewGPT4Turbo() *GPT4Turbo

NewGPT4Turbo creates a new GPT-4-turbo model with default options

func (*GPT4Turbo) ModelName

func (m *GPT4Turbo) ModelName() string

func (*GPT4Turbo) Provider

func (m *GPT4Turbo) Provider() ProviderType

func (*GPT4Turbo) SystemPrompt

func (m *GPT4Turbo) SystemPrompt() string

func (*GPT4Turbo) WithMaxTokens

func (m *GPT4Turbo) WithMaxTokens(n int) *GPT4Turbo

func (*GPT4Turbo) WithSystemPrompt

func (m *GPT4Turbo) WithSystemPrompt(s string) *GPT4Turbo

func (*GPT4Turbo) WithTemperature

func (m *GPT4Turbo) WithTemperature(t float64) *GPT4Turbo

func (*GPT4Turbo) WithTopP

func (m *GPT4Turbo) WithTopP(p float64) *GPT4Turbo

func (*GPT4Turbo) WithVersion

func (m *GPT4Turbo) WithVersion(v string) *GPT4Turbo

type GPT4o

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

GPT4o represents the GPT-4o model Versions: gpt-4o, gpt-4o-2024-11-20, gpt-4o-2024-08-06, gpt-4o-2024-05-13

func NewGPT4o

func NewGPT4o() *GPT4o

NewGPT4o creates a new GPT-4o model with default options

func (*GPT4o) ModelName

func (m *GPT4o) ModelName() string

func (*GPT4o) Provider

func (m *GPT4o) Provider() ProviderType

func (*GPT4o) SystemPrompt

func (m *GPT4o) SystemPrompt() string

func (*GPT4o) WithMaxTokens

func (m *GPT4o) WithMaxTokens(n int) *GPT4o

func (*GPT4o) WithSystemPrompt

func (m *GPT4o) WithSystemPrompt(s string) *GPT4o

func (*GPT4o) WithTemperature

func (m *GPT4o) WithTemperature(t float64) *GPT4o

func (*GPT4o) WithTopP

func (m *GPT4o) WithTopP(p float64) *GPT4o

func (*GPT4o) WithVersion

func (m *GPT4o) WithVersion(v string) *GPT4o

type GPT4oMini

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

GPT4oMini represents the GPT-4o-mini model Versions: gpt-4o-mini, gpt-4o-mini-2024-07-18

func NewGPT4oMini

func NewGPT4oMini() *GPT4oMini

NewGPT4oMini creates a new GPT-4o-mini model with default options

func (*GPT4oMini) ModelName

func (m *GPT4oMini) ModelName() string

func (*GPT4oMini) Provider

func (m *GPT4oMini) Provider() ProviderType

func (*GPT4oMini) SystemPrompt

func (m *GPT4oMini) SystemPrompt() string

func (*GPT4oMini) WithMaxTokens

func (m *GPT4oMini) WithMaxTokens(n int) *GPT4oMini

func (*GPT4oMini) WithSystemPrompt

func (m *GPT4oMini) WithSystemPrompt(s string) *GPT4oMini

func (*GPT4oMini) WithTemperature

func (m *GPT4oMini) WithTemperature(t float64) *GPT4oMini

func (*GPT4oMini) WithTopP

func (m *GPT4oMini) WithTopP(p float64) *GPT4oMini

func (*GPT4oMini) WithVersion

func (m *GPT4oMini) WithVersion(v string) *GPT4oMini

type GPT5

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

GPT5 represents the GPT-5 reasoning model

func NewGPT5

func NewGPT5() *GPT5

NewGPT5 creates a new GPT-5 model with default options

func (*GPT5) ModelName

func (m *GPT5) ModelName() string

func (*GPT5) Provider

func (m *GPT5) Provider() ProviderType

func (*GPT5) SystemPrompt

func (m *GPT5) SystemPrompt() string

func (*GPT5) WithMaxCompletionTokens

func (m *GPT5) WithMaxCompletionTokens(n int) *GPT5

func (*GPT5) WithReasoningEffort

func (m *GPT5) WithReasoningEffort(e string) *GPT5

func (*GPT5) WithSystemPrompt

func (m *GPT5) WithSystemPrompt(s string) *GPT5

type GPT51

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

GPT51 represents the GPT-5.1 reasoning model

func NewGPT51

func NewGPT51() *GPT51

NewGPT51 creates a new GPT-5.1 model with default options

func (*GPT51) ModelName

func (m *GPT51) ModelName() string

func (*GPT51) Provider

func (m *GPT51) Provider() ProviderType

func (*GPT51) SystemPrompt

func (m *GPT51) SystemPrompt() string

func (*GPT51) WithMaxCompletionTokens

func (m *GPT51) WithMaxCompletionTokens(n int) *GPT51

func (*GPT51) WithReasoningEffort

func (m *GPT51) WithReasoningEffort(e string) *GPT51

func (*GPT51) WithSystemPrompt

func (m *GPT51) WithSystemPrompt(s string) *GPT51

type GPT51Codex

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

GPT51Codex represents the GPT-5.1-codex reasoning model

func NewGPT51Codex

func NewGPT51Codex() *GPT51Codex

NewGPT51Codex creates a new GPT-5.1-codex model with default options

func (*GPT51Codex) ModelName

func (m *GPT51Codex) ModelName() string

func (*GPT51Codex) Provider

func (m *GPT51Codex) Provider() ProviderType

func (*GPT51Codex) SystemPrompt

func (m *GPT51Codex) SystemPrompt() string

func (*GPT51Codex) WithMaxCompletionTokens

func (m *GPT51Codex) WithMaxCompletionTokens(n int) *GPT51Codex

func (*GPT51Codex) WithReasoningEffort

func (m *GPT51Codex) WithReasoningEffort(e string) *GPT51Codex

func (*GPT51Codex) WithSystemPrompt

func (m *GPT51Codex) WithSystemPrompt(s string) *GPT51Codex

type GPT51CodexMini

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

GPT51CodexMini represents the GPT-5.1-codex-mini reasoning model

func NewGPT51CodexMini

func NewGPT51CodexMini() *GPT51CodexMini

NewGPT51CodexMini creates a new GPT-5.1-codex-mini model with default options

func (*GPT51CodexMini) ModelName

func (m *GPT51CodexMini) ModelName() string

func (*GPT51CodexMini) Provider

func (m *GPT51CodexMini) Provider() ProviderType

func (*GPT51CodexMini) SystemPrompt

func (m *GPT51CodexMini) SystemPrompt() string

func (*GPT51CodexMini) WithMaxCompletionTokens

func (m *GPT51CodexMini) WithMaxCompletionTokens(n int) *GPT51CodexMini

func (*GPT51CodexMini) WithReasoningEffort

func (m *GPT51CodexMini) WithReasoningEffort(e string) *GPT51CodexMini

func (*GPT51CodexMini) WithSystemPrompt

func (m *GPT51CodexMini) WithSystemPrompt(s string) *GPT51CodexMini

type GPT51Mini

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

GPT51Mini represents the GPT-5.1-mini reasoning model

func NewGPT51Mini

func NewGPT51Mini() *GPT51Mini

NewGPT51Mini creates a new GPT-5.1-mini model with default options

func (*GPT51Mini) ModelName

func (m *GPT51Mini) ModelName() string

func (*GPT51Mini) Provider

func (m *GPT51Mini) Provider() ProviderType

func (*GPT51Mini) SystemPrompt

func (m *GPT51Mini) SystemPrompt() string

func (*GPT51Mini) WithMaxCompletionTokens

func (m *GPT51Mini) WithMaxCompletionTokens(n int) *GPT51Mini

func (*GPT51Mini) WithReasoningEffort

func (m *GPT51Mini) WithReasoningEffort(e string) *GPT51Mini

func (*GPT51Mini) WithSystemPrompt

func (m *GPT51Mini) WithSystemPrompt(s string) *GPT51Mini

type GPT51Nano

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

GPT51Nano represents the GPT-5.1-nano reasoning model

func NewGPT51Nano

func NewGPT51Nano() *GPT51Nano

NewGPT51Nano creates a new GPT-5.1-nano model with default options

func (*GPT51Nano) ModelName

func (m *GPT51Nano) ModelName() string

func (*GPT51Nano) Provider

func (m *GPT51Nano) Provider() ProviderType

func (*GPT51Nano) SystemPrompt

func (m *GPT51Nano) SystemPrompt() string

func (*GPT51Nano) WithMaxCompletionTokens

func (m *GPT51Nano) WithMaxCompletionTokens(n int) *GPT51Nano

func (*GPT51Nano) WithReasoningEffort

func (m *GPT51Nano) WithReasoningEffort(e string) *GPT51Nano

func (*GPT51Nano) WithSystemPrompt

func (m *GPT51Nano) WithSystemPrompt(s string) *GPT51Nano

type GPT5Mini

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

GPT5Mini represents the GPT-5-mini reasoning model

func NewGPT5Mini

func NewGPT5Mini() *GPT5Mini

NewGPT5Mini creates a new GPT-5-mini model with default options

func (*GPT5Mini) ModelName

func (m *GPT5Mini) ModelName() string

func (*GPT5Mini) Provider

func (m *GPT5Mini) Provider() ProviderType

func (*GPT5Mini) SystemPrompt

func (m *GPT5Mini) SystemPrompt() string

func (*GPT5Mini) WithMaxCompletionTokens

func (m *GPT5Mini) WithMaxCompletionTokens(n int) *GPT5Mini

func (*GPT5Mini) WithReasoningEffort

func (m *GPT5Mini) WithReasoningEffort(e string) *GPT5Mini

func (*GPT5Mini) WithSystemPrompt

func (m *GPT5Mini) WithSystemPrompt(s string) *GPT5Mini

type GPT5Nano

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

GPT5Nano represents the GPT-5-nano reasoning model

func NewGPT5Nano

func NewGPT5Nano() *GPT5Nano

NewGPT5Nano creates a new GPT-5-nano model with default options

func (*GPT5Nano) ModelName

func (m *GPT5Nano) ModelName() string

func (*GPT5Nano) Provider

func (m *GPT5Nano) Provider() ProviderType

func (*GPT5Nano) SystemPrompt

func (m *GPT5Nano) SystemPrompt() string

func (*GPT5Nano) WithMaxCompletionTokens

func (m *GPT5Nano) WithMaxCompletionTokens(n int) *GPT5Nano

func (*GPT5Nano) WithReasoningEffort

func (m *GPT5Nano) WithReasoningEffort(e string) *GPT5Nano

func (*GPT5Nano) WithSystemPrompt

func (m *GPT5Nano) WithSystemPrompt(s string) *GPT5Nano

type GPT5Pro

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

GPT5Pro represents the GPT-5-pro reasoning model

func NewGPT5Pro

func NewGPT5Pro() *GPT5Pro

NewGPT5Pro creates a new GPT-5-pro model with default options

func (*GPT5Pro) ModelName

func (m *GPT5Pro) ModelName() string

func (*GPT5Pro) Provider

func (m *GPT5Pro) Provider() ProviderType

func (*GPT5Pro) SystemPrompt

func (m *GPT5Pro) SystemPrompt() string

func (*GPT5Pro) WithMaxCompletionTokens

func (m *GPT5Pro) WithMaxCompletionTokens(n int) *GPT5Pro

func (*GPT5Pro) WithReasoningEffort

func (m *GPT5Pro) WithReasoningEffort(e string) *GPT5Pro

func (*GPT5Pro) WithSystemPrompt

func (m *GPT5Pro) WithSystemPrompt(s string) *GPT5Pro

type GPT5Turbo

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

GPT5Turbo represents the GPT-5-turbo reasoning model

func NewGPT5Turbo

func NewGPT5Turbo() *GPT5Turbo

NewGPT5Turbo creates a new GPT-5-turbo model with default options

func (*GPT5Turbo) ModelName

func (m *GPT5Turbo) ModelName() string

func (*GPT5Turbo) Provider

func (m *GPT5Turbo) Provider() ProviderType

func (*GPT5Turbo) SystemPrompt

func (m *GPT5Turbo) SystemPrompt() string

func (*GPT5Turbo) WithMaxCompletionTokens

func (m *GPT5Turbo) WithMaxCompletionTokens(n int) *GPT5Turbo

func (*GPT5Turbo) WithReasoningEffort

func (m *GPT5Turbo) WithReasoningEffort(e string) *GPT5Turbo

func (*GPT5Turbo) WithSystemPrompt

func (m *GPT5Turbo) WithSystemPrompt(s string) *GPT5Turbo

type Gateway

type Gateway interface {
	// Generate generates text using the specified model
	// The model carries its own generation options
	Generate(ctx context.Context, model Model, prompt string) (*GenerationResponse, error)

	// IsRegistered checks if a provider is registered
	IsRegistered(provider ProviderType) bool

	// ListRegisteredProviders returns a list of registered providers
	ListRegisteredProviders() []ProviderType

	// Health checks the health of a specific provider
	Health(ctx context.Context, provider ProviderType) error

	// Close closes the gateway and all providers
	Close() error
}

Gateway defines the interface for LLM operations

type Gemini15Flash

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

Gemini15Flash represents the Gemini 1.5 Flash model Versions: gemini-1.5-flash, gemini-1.5-flash-latest

func NewGemini15Flash

func NewGemini15Flash() *Gemini15Flash

NewGemini15Flash creates a new Gemini 1.5 Flash model with default options

func (*Gemini15Flash) ModelName

func (m *Gemini15Flash) ModelName() string

func (*Gemini15Flash) Provider

func (m *Gemini15Flash) Provider() ProviderType

func (*Gemini15Flash) SystemPrompt

func (m *Gemini15Flash) SystemPrompt() string

func (*Gemini15Flash) WithMaxTokens

func (m *Gemini15Flash) WithMaxTokens(n int) *Gemini15Flash

func (*Gemini15Flash) WithSystemPrompt

func (m *Gemini15Flash) WithSystemPrompt(s string) *Gemini15Flash

func (*Gemini15Flash) WithTemperature

func (m *Gemini15Flash) WithTemperature(t float64) *Gemini15Flash

func (*Gemini15Flash) WithTopK

func (m *Gemini15Flash) WithTopK(k int) *Gemini15Flash

func (*Gemini15Flash) WithTopP

func (m *Gemini15Flash) WithTopP(p float64) *Gemini15Flash

func (*Gemini15Flash) WithVersion

func (m *Gemini15Flash) WithVersion(v string) *Gemini15Flash

type Gemini15Flash8b

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

Gemini15Flash8b represents the Gemini 1.5 Flash 8B model

func NewGemini15Flash8b

func NewGemini15Flash8b() *Gemini15Flash8b

NewGemini15Flash8b creates a new Gemini 1.5 Flash 8B model with default options

func (*Gemini15Flash8b) ModelName

func (m *Gemini15Flash8b) ModelName() string

func (*Gemini15Flash8b) Provider

func (m *Gemini15Flash8b) Provider() ProviderType

func (*Gemini15Flash8b) SystemPrompt

func (m *Gemini15Flash8b) SystemPrompt() string

func (*Gemini15Flash8b) WithMaxTokens

func (m *Gemini15Flash8b) WithMaxTokens(n int) *Gemini15Flash8b

func (*Gemini15Flash8b) WithSystemPrompt

func (m *Gemini15Flash8b) WithSystemPrompt(s string) *Gemini15Flash8b

func (*Gemini15Flash8b) WithTemperature

func (m *Gemini15Flash8b) WithTemperature(t float64) *Gemini15Flash8b

func (*Gemini15Flash8b) WithTopK

func (m *Gemini15Flash8b) WithTopK(k int) *Gemini15Flash8b

func (*Gemini15Flash8b) WithTopP

func (m *Gemini15Flash8b) WithTopP(p float64) *Gemini15Flash8b

type Gemini15Pro

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

Gemini15Pro represents the Gemini 1.5 Pro model Versions: gemini-1.5-pro, gemini-1.5-pro-latest

func NewGemini15Pro

func NewGemini15Pro() *Gemini15Pro

NewGemini15Pro creates a new Gemini 1.5 Pro model with default options

func (*Gemini15Pro) ModelName

func (m *Gemini15Pro) ModelName() string

func (*Gemini15Pro) Provider

func (m *Gemini15Pro) Provider() ProviderType

func (*Gemini15Pro) SystemPrompt

func (m *Gemini15Pro) SystemPrompt() string

func (*Gemini15Pro) WithMaxTokens

func (m *Gemini15Pro) WithMaxTokens(n int) *Gemini15Pro

func (*Gemini15Pro) WithSystemPrompt

func (m *Gemini15Pro) WithSystemPrompt(s string) *Gemini15Pro

func (*Gemini15Pro) WithTemperature

func (m *Gemini15Pro) WithTemperature(t float64) *Gemini15Pro

func (*Gemini15Pro) WithTopK

func (m *Gemini15Pro) WithTopK(k int) *Gemini15Pro

func (*Gemini15Pro) WithTopP

func (m *Gemini15Pro) WithTopP(p float64) *Gemini15Pro

func (*Gemini15Pro) WithVersion

func (m *Gemini15Pro) WithVersion(v string) *Gemini15Pro

type Gemini20Flash

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

Gemini20Flash represents the Gemini 2.0 Flash model

func NewGemini20Flash

func NewGemini20Flash() *Gemini20Flash

NewGemini20Flash creates a new Gemini 2.0 Flash model with default options

func (*Gemini20Flash) ModelName

func (m *Gemini20Flash) ModelName() string

func (*Gemini20Flash) Provider

func (m *Gemini20Flash) Provider() ProviderType

func (*Gemini20Flash) SystemPrompt

func (m *Gemini20Flash) SystemPrompt() string

func (*Gemini20Flash) WithMaxTokens

func (m *Gemini20Flash) WithMaxTokens(n int) *Gemini20Flash

func (*Gemini20Flash) WithSystemPrompt

func (m *Gemini20Flash) WithSystemPrompt(s string) *Gemini20Flash

func (*Gemini20Flash) WithTemperature

func (m *Gemini20Flash) WithTemperature(t float64) *Gemini20Flash

func (*Gemini20Flash) WithTopK

func (m *Gemini20Flash) WithTopK(k int) *Gemini20Flash

func (*Gemini20Flash) WithTopP

func (m *Gemini20Flash) WithTopP(p float64) *Gemini20Flash

type Gemini20FlashExp

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

Gemini20FlashExp represents the Gemini 2.0 Flash Experimental model

func NewGemini20FlashExp

func NewGemini20FlashExp() *Gemini20FlashExp

NewGemini20FlashExp creates a new Gemini 2.0 Flash Exp model with default options

func (*Gemini20FlashExp) ModelName

func (m *Gemini20FlashExp) ModelName() string

func (*Gemini20FlashExp) Provider

func (m *Gemini20FlashExp) Provider() ProviderType

func (*Gemini20FlashExp) SystemPrompt

func (m *Gemini20FlashExp) SystemPrompt() string

func (*Gemini20FlashExp) WithMaxTokens

func (m *Gemini20FlashExp) WithMaxTokens(n int) *Gemini20FlashExp

func (*Gemini20FlashExp) WithSystemPrompt

func (m *Gemini20FlashExp) WithSystemPrompt(s string) *Gemini20FlashExp

func (*Gemini20FlashExp) WithTemperature

func (m *Gemini20FlashExp) WithTemperature(t float64) *Gemini20FlashExp

func (*Gemini20FlashExp) WithTopK

func (m *Gemini20FlashExp) WithTopK(k int) *Gemini20FlashExp

func (*Gemini20FlashExp) WithTopP

func (m *Gemini20FlashExp) WithTopP(p float64) *Gemini20FlashExp

type Gemini20FlashLite

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

Gemini20FlashLite represents the Gemini 2.0 Flash Lite model

func NewGemini20FlashLite

func NewGemini20FlashLite() *Gemini20FlashLite

NewGemini20FlashLite creates a new Gemini 2.0 Flash Lite model with default options

func (*Gemini20FlashLite) ModelName

func (m *Gemini20FlashLite) ModelName() string

func (*Gemini20FlashLite) Provider

func (m *Gemini20FlashLite) Provider() ProviderType

func (*Gemini20FlashLite) SystemPrompt

func (m *Gemini20FlashLite) SystemPrompt() string

func (*Gemini20FlashLite) WithMaxTokens

func (m *Gemini20FlashLite) WithMaxTokens(n int) *Gemini20FlashLite

func (*Gemini20FlashLite) WithSystemPrompt

func (m *Gemini20FlashLite) WithSystemPrompt(s string) *Gemini20FlashLite

func (*Gemini20FlashLite) WithTemperature

func (m *Gemini20FlashLite) WithTemperature(t float64) *Gemini20FlashLite

func (*Gemini20FlashLite) WithTopK

func (m *Gemini20FlashLite) WithTopK(k int) *Gemini20FlashLite

func (*Gemini20FlashLite) WithTopP

type Gemini20FlashThinking

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

Gemini20FlashThinking represents the Gemini 2.0 Flash Thinking Experimental model

func NewGemini20FlashThinking

func NewGemini20FlashThinking() *Gemini20FlashThinking

NewGemini20FlashThinking creates a new Gemini 2.0 Flash Thinking model with default options

func (*Gemini20FlashThinking) ModelName

func (m *Gemini20FlashThinking) ModelName() string

func (*Gemini20FlashThinking) Provider

func (m *Gemini20FlashThinking) Provider() ProviderType

func (*Gemini20FlashThinking) SystemPrompt

func (m *Gemini20FlashThinking) SystemPrompt() string

func (*Gemini20FlashThinking) WithMaxTokens

func (m *Gemini20FlashThinking) WithMaxTokens(n int) *Gemini20FlashThinking

func (*Gemini20FlashThinking) WithSystemPrompt

func (m *Gemini20FlashThinking) WithSystemPrompt(s string) *Gemini20FlashThinking

func (*Gemini20FlashThinking) WithTemperature

func (m *Gemini20FlashThinking) WithTemperature(t float64) *Gemini20FlashThinking

func (*Gemini20FlashThinking) WithTopK

func (*Gemini20FlashThinking) WithTopP

type Gemini20ProExp

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

Gemini20ProExp represents the Gemini 2.0 Pro Experimental model

func NewGemini20ProExp

func NewGemini20ProExp() *Gemini20ProExp

NewGemini20ProExp creates a new Gemini 2.0 Pro Exp model with default options

func (*Gemini20ProExp) ModelName

func (m *Gemini20ProExp) ModelName() string

func (*Gemini20ProExp) Provider

func (m *Gemini20ProExp) Provider() ProviderType

func (*Gemini20ProExp) SystemPrompt

func (m *Gemini20ProExp) SystemPrompt() string

func (*Gemini20ProExp) WithMaxTokens

func (m *Gemini20ProExp) WithMaxTokens(n int) *Gemini20ProExp

func (*Gemini20ProExp) WithSystemPrompt

func (m *Gemini20ProExp) WithSystemPrompt(s string) *Gemini20ProExp

func (*Gemini20ProExp) WithTemperature

func (m *Gemini20ProExp) WithTemperature(t float64) *Gemini20ProExp

func (*Gemini20ProExp) WithTopK

func (m *Gemini20ProExp) WithTopK(k int) *Gemini20ProExp

func (*Gemini20ProExp) WithTopP

func (m *Gemini20ProExp) WithTopP(p float64) *Gemini20ProExp

type Gemini25Flash

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

Gemini25Flash represents the Gemini 2.5 Flash model Versions: gemini-2.5-flash, gemini-2.5-flash-preview-05-20

func NewGemini25Flash

func NewGemini25Flash() *Gemini25Flash

NewGemini25Flash creates a new Gemini 2.5 Flash model with default options

func (*Gemini25Flash) ModelName

func (m *Gemini25Flash) ModelName() string

func (*Gemini25Flash) Provider

func (m *Gemini25Flash) Provider() ProviderType

func (*Gemini25Flash) SystemPrompt

func (m *Gemini25Flash) SystemPrompt() string

func (*Gemini25Flash) WithMaxTokens

func (m *Gemini25Flash) WithMaxTokens(n int) *Gemini25Flash

func (*Gemini25Flash) WithSystemPrompt

func (m *Gemini25Flash) WithSystemPrompt(s string) *Gemini25Flash

func (*Gemini25Flash) WithTemperature

func (m *Gemini25Flash) WithTemperature(t float64) *Gemini25Flash

func (*Gemini25Flash) WithTopK

func (m *Gemini25Flash) WithTopK(k int) *Gemini25Flash

func (*Gemini25Flash) WithTopP

func (m *Gemini25Flash) WithTopP(p float64) *Gemini25Flash

func (*Gemini25Flash) WithVersion

func (m *Gemini25Flash) WithVersion(v string) *Gemini25Flash

type Gemini25Pro

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

Gemini25Pro represents the Gemini 2.5 Pro model Versions: gemini-2.5-pro, gemini-2.5-pro-preview-05-06

func NewGemini25Pro

func NewGemini25Pro() *Gemini25Pro

NewGemini25Pro creates a new Gemini 2.5 Pro model with default options

func (*Gemini25Pro) ModelName

func (m *Gemini25Pro) ModelName() string

func (*Gemini25Pro) Provider

func (m *Gemini25Pro) Provider() ProviderType

func (*Gemini25Pro) SystemPrompt

func (m *Gemini25Pro) SystemPrompt() string

func (*Gemini25Pro) WithMaxTokens

func (m *Gemini25Pro) WithMaxTokens(n int) *Gemini25Pro

func (*Gemini25Pro) WithSystemPrompt

func (m *Gemini25Pro) WithSystemPrompt(s string) *Gemini25Pro

func (*Gemini25Pro) WithTemperature

func (m *Gemini25Pro) WithTemperature(t float64) *Gemini25Pro

func (*Gemini25Pro) WithTopK

func (m *Gemini25Pro) WithTopK(k int) *Gemini25Pro

func (*Gemini25Pro) WithTopP

func (m *Gemini25Pro) WithTopP(p float64) *Gemini25Pro

func (*Gemini25Pro) WithVersion

func (m *Gemini25Pro) WithVersion(v string) *Gemini25Pro

type Gemini3Flash

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

Gemini3Flash represents the Gemini 3 Flash model Versions: gemini-3-flash, gemini-3-flash-latest

func NewGemini3Flash

func NewGemini3Flash() *Gemini3Flash

NewGemini3Flash creates a new Gemini 3 Flash model with default options

func (*Gemini3Flash) ModelName

func (m *Gemini3Flash) ModelName() string

func (*Gemini3Flash) Provider

func (m *Gemini3Flash) Provider() ProviderType

func (*Gemini3Flash) SystemPrompt

func (m *Gemini3Flash) SystemPrompt() string

func (*Gemini3Flash) WithMaxTokens

func (m *Gemini3Flash) WithMaxTokens(n int) *Gemini3Flash

func (*Gemini3Flash) WithSystemPrompt

func (m *Gemini3Flash) WithSystemPrompt(s string) *Gemini3Flash

func (*Gemini3Flash) WithTemperature

func (m *Gemini3Flash) WithTemperature(t float64) *Gemini3Flash

func (*Gemini3Flash) WithTopK

func (m *Gemini3Flash) WithTopK(k int) *Gemini3Flash

func (*Gemini3Flash) WithTopP

func (m *Gemini3Flash) WithTopP(p float64) *Gemini3Flash

func (*Gemini3Flash) WithVersion

func (m *Gemini3Flash) WithVersion(v string) *Gemini3Flash

type Gemini3Pro

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

Gemini3Pro represents the Gemini 3 Pro model Versions: gemini-3-pro, gemini-3-pro-latest

func NewGemini3Pro

func NewGemini3Pro() *Gemini3Pro

NewGemini3Pro creates a new Gemini 3 Pro model with default options

func (*Gemini3Pro) ModelName

func (m *Gemini3Pro) ModelName() string

func (*Gemini3Pro) Provider

func (m *Gemini3Pro) Provider() ProviderType

func (*Gemini3Pro) SystemPrompt

func (m *Gemini3Pro) SystemPrompt() string

func (*Gemini3Pro) WithMaxTokens

func (m *Gemini3Pro) WithMaxTokens(n int) *Gemini3Pro

func (*Gemini3Pro) WithSystemPrompt

func (m *Gemini3Pro) WithSystemPrompt(s string) *Gemini3Pro

func (*Gemini3Pro) WithTemperature

func (m *Gemini3Pro) WithTemperature(t float64) *Gemini3Pro

func (*Gemini3Pro) WithTopK

func (m *Gemini3Pro) WithTopK(k int) *Gemini3Pro

func (*Gemini3Pro) WithTopP

func (m *Gemini3Pro) WithTopP(p float64) *Gemini3Pro

func (*Gemini3Pro) WithVersion

func (m *Gemini3Pro) WithVersion(v string) *Gemini3Pro

type Gemini3Ultra

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

Gemini3Ultra represents the Gemini 3 Ultra model

func NewGemini3Ultra

func NewGemini3Ultra() *Gemini3Ultra

NewGemini3Ultra creates a new Gemini 3 Ultra model with default options

func (*Gemini3Ultra) ModelName

func (m *Gemini3Ultra) ModelName() string

func (*Gemini3Ultra) Provider

func (m *Gemini3Ultra) Provider() ProviderType

func (*Gemini3Ultra) SystemPrompt

func (m *Gemini3Ultra) SystemPrompt() string

func (*Gemini3Ultra) WithMaxTokens

func (m *Gemini3Ultra) WithMaxTokens(n int) *Gemini3Ultra

func (*Gemini3Ultra) WithSystemPrompt

func (m *Gemini3Ultra) WithSystemPrompt(s string) *Gemini3Ultra

func (*Gemini3Ultra) WithTemperature

func (m *Gemini3Ultra) WithTemperature(t float64) *Gemini3Ultra

func (*Gemini3Ultra) WithTopK

func (m *Gemini3Ultra) WithTopK(k int) *Gemini3Ultra

func (*Gemini3Ultra) WithTopP

func (m *Gemini3Ultra) WithTopP(p float64) *Gemini3Ultra

type Gemma2

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

Gemma2 represents the Gemma 2 model

func NewGemma2

func NewGemma2() *Gemma2

NewGemma2 creates a new Gemma 2 model with default options

func (*Gemma2) ModelName

func (m *Gemma2) ModelName() string

func (*Gemma2) Provider

func (m *Gemma2) Provider() ProviderType

func (*Gemma2) SystemPrompt

func (m *Gemma2) SystemPrompt() string

func (*Gemma2) WithMaxTokens

func (m *Gemma2) WithMaxTokens(n int) *Gemma2

func (*Gemma2) WithNumCtx

func (m *Gemma2) WithNumCtx(n int) *Gemma2

func (*Gemma2) WithRepeatPenalty

func (m *Gemma2) WithRepeatPenalty(p float64) *Gemma2

func (*Gemma2) WithSeed

func (m *Gemma2) WithSeed(s int) *Gemma2

func (*Gemma2) WithSystemPrompt

func (m *Gemma2) WithSystemPrompt(s string) *Gemma2

func (*Gemma2) WithTemperature

func (m *Gemma2) WithTemperature(t float64) *Gemma2

func (*Gemma2) WithTopK

func (m *Gemma2) WithTopK(k int) *Gemma2

func (*Gemma2) WithTopP

func (m *Gemma2) WithTopP(p float64) *Gemma2

type GenerationResponse

type GenerationResponse struct {
	// Text is the generated text content
	Text string `json:"text"`
	// Provider is the provider that was used
	Provider ProviderType `json:"provider"`
	// Model is the model that was used
	Model string `json:"model"`
	// Usage contains token usage information
	Usage TokenUsage `json:"usage"`
	// FinishReason indicates why generation stopped
	FinishReason string `json:"finish_reason"`
	// Metadata contains additional provider-specific information
	Metadata map[string]string `json:"metadata,omitempty"`
}

GenerationResponse contains the response from text generation

type GoogleConfig

type GoogleConfig struct {
	// APIKey is the Google AI API key (required)
	APIKey string
	// Timeout is the request timeout (default: 60s)
	Timeout time.Duration
	// RateLimiter is the optional rate limit configuration
	RateLimiter *RateLimitConfig
}

GoogleConfig contains configuration for the Google AI provider

type HTTPStatusError

type HTTPStatusError struct {
	StatusCode int
	Message    string
}

HTTPStatusError wraps an HTTP status code error

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

func (*HTTPStatusError) IsRateLimited

func (e *HTTPStatusError) IsRateLimited() bool

IsRateLimited returns true if the status code indicates rate limiting

type ImageResult

type ImageResult struct {
	// URL is the image URL
	URL string
	// SourceURL is the page where the image was found
	SourceURL string
	// Alt is the image alt text
	Alt string
	// Width is the image width
	Width int
	// Height is the image height
	Height int
}

ImageResult represents an image search result

type LLMGateway

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

LLMGateway implements the Gateway interface and manages multiple LLM providers

func New

func New(configs []ProviderConfig, opts ...Option) (*LLMGateway, error)

New creates a new LLM gateway with the provided provider configurations. Each ProviderConfig in the slice will be used to initialize its corresponding provider. Returns an error if any provider fails to initialize.

func (*LLMGateway) Close

func (g *LLMGateway) Close() error

Close closes all registered providers

func (*LLMGateway) Generate

func (g *LLMGateway) Generate(ctx context.Context, model Model, prompt string) (*GenerationResponse, error)

Generate generates text using the specified model. The model carries its own generation options and knows which provider to use.

func (*LLMGateway) Health

func (g *LLMGateway) Health(ctx context.Context, provider ProviderType) error

Health checks the health of a specific provider

func (*LLMGateway) IsRegistered

func (g *LLMGateway) IsRegistered(provider ProviderType) bool

IsRegistered checks if a provider is registered

func (*LLMGateway) ListRegisteredProviders

func (g *LLMGateway) ListRegisteredProviders() []ProviderType

ListRegisteredProviders returns a list of registered providers

type Llama3

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

Llama3 represents the Llama 3 model

func NewLlama3

func NewLlama3() *Llama3

NewLlama3 creates a new Llama 3 model with default options

func (*Llama3) ModelName

func (m *Llama3) ModelName() string

func (*Llama3) Provider

func (m *Llama3) Provider() ProviderType

func (*Llama3) SystemPrompt

func (m *Llama3) SystemPrompt() string

func (*Llama3) WithMaxTokens

func (m *Llama3) WithMaxTokens(n int) *Llama3

func (*Llama3) WithNumCtx

func (m *Llama3) WithNumCtx(n int) *Llama3

func (*Llama3) WithRepeatPenalty

func (m *Llama3) WithRepeatPenalty(p float64) *Llama3

func (*Llama3) WithSeed

func (m *Llama3) WithSeed(s int) *Llama3

func (*Llama3) WithSystemPrompt

func (m *Llama3) WithSystemPrompt(s string) *Llama3

func (*Llama3) WithTemperature

func (m *Llama3) WithTemperature(t float64) *Llama3

func (*Llama3) WithTopK

func (m *Llama3) WithTopK(k int) *Llama3

func (*Llama3) WithTopP

func (m *Llama3) WithTopP(p float64) *Llama3

type Llama31

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

Llama31 represents the Llama 3.1 model

func NewLlama31

func NewLlama31() *Llama31

NewLlama31 creates a new Llama 3.1 model with default options

func (*Llama31) ModelName

func (m *Llama31) ModelName() string

func (*Llama31) Provider

func (m *Llama31) Provider() ProviderType

func (*Llama31) SystemPrompt

func (m *Llama31) SystemPrompt() string

func (*Llama31) WithMaxTokens

func (m *Llama31) WithMaxTokens(n int) *Llama31

func (*Llama31) WithNumCtx

func (m *Llama31) WithNumCtx(n int) *Llama31

func (*Llama31) WithRepeatPenalty

func (m *Llama31) WithRepeatPenalty(p float64) *Llama31

func (*Llama31) WithSeed

func (m *Llama31) WithSeed(s int) *Llama31

func (*Llama31) WithSystemPrompt

func (m *Llama31) WithSystemPrompt(s string) *Llama31

func (*Llama31) WithTemperature

func (m *Llama31) WithTemperature(t float64) *Llama31

func (*Llama31) WithTopK

func (m *Llama31) WithTopK(k int) *Llama31

func (*Llama31) WithTopP

func (m *Llama31) WithTopP(p float64) *Llama31

type Llama32

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

Llama32 represents the Llama 3.2 model

func NewLlama32

func NewLlama32() *Llama32

NewLlama32 creates a new Llama 3.2 model with default options

func (*Llama32) ModelName

func (m *Llama32) ModelName() string

func (*Llama32) Provider

func (m *Llama32) Provider() ProviderType

func (*Llama32) SystemPrompt

func (m *Llama32) SystemPrompt() string

func (*Llama32) WithMaxTokens

func (m *Llama32) WithMaxTokens(n int) *Llama32

func (*Llama32) WithNumCtx

func (m *Llama32) WithNumCtx(n int) *Llama32

func (*Llama32) WithRepeatPenalty

func (m *Llama32) WithRepeatPenalty(p float64) *Llama32

func (*Llama32) WithSeed

func (m *Llama32) WithSeed(s int) *Llama32

func (*Llama32) WithSystemPrompt

func (m *Llama32) WithSystemPrompt(s string) *Llama32

func (*Llama32) WithTemperature

func (m *Llama32) WithTemperature(t float64) *Llama32

func (*Llama32) WithTopK

func (m *Llama32) WithTopK(k int) *Llama32

func (*Llama32) WithTopP

func (m *Llama32) WithTopP(p float64) *Llama32

type LogEvent

type LogEvent interface {
	Msg(msg string)
	Str(key, val string) LogEvent
	Int(key string, val int) LogEvent
	Int64(key string, val int64) LogEvent
	Bool(key string, val bool) LogEvent
	Err(err error) LogEvent
}

LogEvent interface for structured logging

type Logger

type Logger interface {
	Debug() LogEvent
	Info() LogEvent
	Error() LogEvent
}

Logger interface for logging - compatible with zerolog and other loggers

type Mistral

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

Mistral represents the Mistral model

func NewMistral

func NewMistral() *Mistral

NewMistral creates a new Mistral model with default options

func (*Mistral) ModelName

func (m *Mistral) ModelName() string

func (*Mistral) Provider

func (m *Mistral) Provider() ProviderType

func (*Mistral) SystemPrompt

func (m *Mistral) SystemPrompt() string

func (*Mistral) WithMaxTokens

func (m *Mistral) WithMaxTokens(n int) *Mistral

func (*Mistral) WithNumCtx

func (m *Mistral) WithNumCtx(n int) *Mistral

func (*Mistral) WithRepeatPenalty

func (m *Mistral) WithRepeatPenalty(p float64) *Mistral

func (*Mistral) WithSeed

func (m *Mistral) WithSeed(s int) *Mistral

func (*Mistral) WithSystemPrompt

func (m *Mistral) WithSystemPrompt(s string) *Mistral

func (*Mistral) WithTemperature

func (m *Mistral) WithTemperature(t float64) *Mistral

func (*Mistral) WithTopK

func (m *Mistral) WithTopK(k int) *Mistral

func (*Mistral) WithTopP

func (m *Mistral) WithTopP(p float64) *Mistral

type Mixtral

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

Mixtral represents the Mixtral model

func NewMixtral

func NewMixtral() *Mixtral

NewMixtral creates a new Mixtral model with default options

func (*Mixtral) ModelName

func (m *Mixtral) ModelName() string

func (*Mixtral) Provider

func (m *Mixtral) Provider() ProviderType

func (*Mixtral) SystemPrompt

func (m *Mixtral) SystemPrompt() string

func (*Mixtral) WithMaxTokens

func (m *Mixtral) WithMaxTokens(n int) *Mixtral

func (*Mixtral) WithNumCtx

func (m *Mixtral) WithNumCtx(n int) *Mixtral

func (*Mixtral) WithRepeatPenalty

func (m *Mixtral) WithRepeatPenalty(p float64) *Mixtral

func (*Mixtral) WithSeed

func (m *Mixtral) WithSeed(s int) *Mixtral

func (*Mixtral) WithSystemPrompt

func (m *Mixtral) WithSystemPrompt(s string) *Mixtral

func (*Mixtral) WithTemperature

func (m *Mixtral) WithTemperature(t float64) *Mixtral

func (*Mixtral) WithTopK

func (m *Mixtral) WithTopK(k int) *Mixtral

func (*Mixtral) WithTopP

func (m *Mixtral) WithTopP(p float64) *Mixtral

type Model

type Model interface {
	// ModelName returns the API model identifier (e.g., "gpt-4o", "claude-3-5-sonnet-20241022")
	ModelName() string
	// Provider returns the provider type for this model
	Provider() ProviderType
	// SystemPrompt returns the system prompt, if set
	SystemPrompt() string
}

Model is the interface that all model types must implement. Each model carries its own generation options with appropriate defaults.

type NopLogger

type NopLogger struct{}

NopLogger is a no-op logger that discards all logs

func (*NopLogger) Debug

func (n *NopLogger) Debug() LogEvent

func (*NopLogger) Error

func (n *NopLogger) Error() LogEvent

func (*NopLogger) Info

func (n *NopLogger) Info() LogEvent

type O1

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

O1 represents the O1 reasoning model Versions: o1, o1-2024-12-17

func NewO1

func NewO1() *O1

NewO1 creates a new O1 model with default options

func (*O1) ModelName

func (m *O1) ModelName() string

func (*O1) Provider

func (m *O1) Provider() ProviderType

func (*O1) SystemPrompt

func (m *O1) SystemPrompt() string

func (*O1) WithMaxCompletionTokens

func (m *O1) WithMaxCompletionTokens(n int) *O1

func (*O1) WithReasoningEffort

func (m *O1) WithReasoningEffort(e string) *O1

func (*O1) WithSystemPrompt

func (m *O1) WithSystemPrompt(s string) *O1

func (*O1) WithVersion

func (m *O1) WithVersion(v string) *O1

type O1Mini

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

O1Mini represents the O1-mini reasoning model Versions: o1-mini, o1-mini-2024-09-12

func NewO1Mini

func NewO1Mini() *O1Mini

NewO1Mini creates a new O1-mini model with default options

func (*O1Mini) ModelName

func (m *O1Mini) ModelName() string

func (*O1Mini) Provider

func (m *O1Mini) Provider() ProviderType

func (*O1Mini) SystemPrompt

func (m *O1Mini) SystemPrompt() string

func (*O1Mini) WithMaxCompletionTokens

func (m *O1Mini) WithMaxCompletionTokens(n int) *O1Mini

func (*O1Mini) WithReasoningEffort

func (m *O1Mini) WithReasoningEffort(e string) *O1Mini

func (*O1Mini) WithSystemPrompt

func (m *O1Mini) WithSystemPrompt(s string) *O1Mini

func (*O1Mini) WithVersion

func (m *O1Mini) WithVersion(v string) *O1Mini

type O1Preview

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

O1Preview represents the O1-preview reasoning model Versions: o1-preview, o1-preview-2024-09-12

func NewO1Preview

func NewO1Preview() *O1Preview

NewO1Preview creates a new O1-preview model with default options

func (*O1Preview) ModelName

func (m *O1Preview) ModelName() string

func (*O1Preview) Provider

func (m *O1Preview) Provider() ProviderType

func (*O1Preview) SystemPrompt

func (m *O1Preview) SystemPrompt() string

func (*O1Preview) WithMaxCompletionTokens

func (m *O1Preview) WithMaxCompletionTokens(n int) *O1Preview

func (*O1Preview) WithReasoningEffort

func (m *O1Preview) WithReasoningEffort(e string) *O1Preview

func (*O1Preview) WithSystemPrompt

func (m *O1Preview) WithSystemPrompt(s string) *O1Preview

func (*O1Preview) WithVersion

func (m *O1Preview) WithVersion(v string) *O1Preview

type O1Pro

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

O1Pro represents the O1-pro reasoning model Versions: o1-pro, o1-pro-2025-03-19

func NewO1Pro

func NewO1Pro() *O1Pro

NewO1Pro creates a new O1-pro model with default options

func (*O1Pro) ModelName

func (m *O1Pro) ModelName() string

func (*O1Pro) Provider

func (m *O1Pro) Provider() ProviderType

func (*O1Pro) SystemPrompt

func (m *O1Pro) SystemPrompt() string

func (*O1Pro) WithMaxCompletionTokens

func (m *O1Pro) WithMaxCompletionTokens(n int) *O1Pro

func (*O1Pro) WithReasoningEffort

func (m *O1Pro) WithReasoningEffort(e string) *O1Pro

func (*O1Pro) WithSystemPrompt

func (m *O1Pro) WithSystemPrompt(s string) *O1Pro

func (*O1Pro) WithVersion

func (m *O1Pro) WithVersion(v string) *O1Pro

type O3

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

O3 represents the O3 reasoning model Versions: o3, o3-2025-04-16

func NewO3

func NewO3() *O3

NewO3 creates a new O3 model with default options

func (*O3) ModelName

func (m *O3) ModelName() string

func (*O3) Provider

func (m *O3) Provider() ProviderType

func (*O3) SystemPrompt

func (m *O3) SystemPrompt() string

func (*O3) WithMaxCompletionTokens

func (m *O3) WithMaxCompletionTokens(n int) *O3

func (*O3) WithReasoningEffort

func (m *O3) WithReasoningEffort(e string) *O3

func (*O3) WithSystemPrompt

func (m *O3) WithSystemPrompt(s string) *O3

func (*O3) WithVersion

func (m *O3) WithVersion(v string) *O3

type O3Mini

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

O3Mini represents the O3-mini reasoning model Versions: o3-mini, o3-mini-2025-01-31

func NewO3Mini

func NewO3Mini() *O3Mini

NewO3Mini creates a new O3-mini model with default options

func (*O3Mini) ModelName

func (m *O3Mini) ModelName() string

func (*O3Mini) Provider

func (m *O3Mini) Provider() ProviderType

func (*O3Mini) SystemPrompt

func (m *O3Mini) SystemPrompt() string

func (*O3Mini) WithMaxCompletionTokens

func (m *O3Mini) WithMaxCompletionTokens(n int) *O3Mini

func (*O3Mini) WithReasoningEffort

func (m *O3Mini) WithReasoningEffort(e string) *O3Mini

func (*O3Mini) WithSystemPrompt

func (m *O3Mini) WithSystemPrompt(s string) *O3Mini

func (*O3Mini) WithVersion

func (m *O3Mini) WithVersion(v string) *O3Mini

type O3Pro

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

O3Pro represents the O3-pro reasoning model

func NewO3Pro

func NewO3Pro() *O3Pro

NewO3Pro creates a new O3-pro model with default options

func (*O3Pro) ModelName

func (m *O3Pro) ModelName() string

func (*O3Pro) Provider

func (m *O3Pro) Provider() ProviderType

func (*O3Pro) SystemPrompt

func (m *O3Pro) SystemPrompt() string

func (*O3Pro) WithMaxCompletionTokens

func (m *O3Pro) WithMaxCompletionTokens(n int) *O3Pro

func (*O3Pro) WithReasoningEffort

func (m *O3Pro) WithReasoningEffort(e string) *O3Pro

func (*O3Pro) WithSystemPrompt

func (m *O3Pro) WithSystemPrompt(s string) *O3Pro

type O4Mini

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

O4Mini represents the O4-mini reasoning model Versions: o4-mini, o4-mini-2025-04-16

func NewO4Mini

func NewO4Mini() *O4Mini

NewO4Mini creates a new O4-mini model with default options

func (*O4Mini) ModelName

func (m *O4Mini) ModelName() string

func (*O4Mini) Provider

func (m *O4Mini) Provider() ProviderType

func (*O4Mini) SystemPrompt

func (m *O4Mini) SystemPrompt() string

func (*O4Mini) WithMaxCompletionTokens

func (m *O4Mini) WithMaxCompletionTokens(n int) *O4Mini

func (*O4Mini) WithReasoningEffort

func (m *O4Mini) WithReasoningEffort(e string) *O4Mini

func (*O4Mini) WithSystemPrompt

func (m *O4Mini) WithSystemPrompt(s string) *O4Mini

func (*O4Mini) WithVersion

func (m *O4Mini) WithVersion(v string) *O4Mini

type OllamaConfig

type OllamaConfig struct {
	// BaseURL is the Ollama server URL (default: http://localhost:11434)
	BaseURL string
	// Timeout is the request timeout (default: 60s)
	Timeout time.Duration
	// RateLimiter is the optional rate limit configuration
	RateLimiter *RateLimitConfig
}

OllamaConfig contains configuration for the Ollama provider

type OllamaModel

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

OllamaModel represents a generic Ollama model Use this for any model available in your Ollama installation

func NewOllamaModel

func NewOllamaModel(modelName string) *OllamaModel

NewOllamaModel creates a new Ollama model with the specified model name

func (*OllamaModel) ModelName

func (m *OllamaModel) ModelName() string

func (*OllamaModel) Provider

func (m *OllamaModel) Provider() ProviderType

func (*OllamaModel) SystemPrompt

func (m *OllamaModel) SystemPrompt() string

func (*OllamaModel) WithMaxTokens

func (m *OllamaModel) WithMaxTokens(n int) *OllamaModel

func (*OllamaModel) WithNumCtx

func (m *OllamaModel) WithNumCtx(n int) *OllamaModel

func (*OllamaModel) WithRepeatPenalty

func (m *OllamaModel) WithRepeatPenalty(p float64) *OllamaModel

func (*OllamaModel) WithSeed

func (m *OllamaModel) WithSeed(s int) *OllamaModel

func (*OllamaModel) WithSystemPrompt

func (m *OllamaModel) WithSystemPrompt(s string) *OllamaModel

func (*OllamaModel) WithTemperature

func (m *OllamaModel) WithTemperature(t float64) *OllamaModel

func (*OllamaModel) WithTopK

func (m *OllamaModel) WithTopK(k int) *OllamaModel

func (*OllamaModel) WithTopP

func (m *OllamaModel) WithTopP(p float64) *OllamaModel

type OpenAIConfig

type OpenAIConfig struct {
	// APIKey is the OpenAI API key (required)
	APIKey string
	// Timeout is the request timeout (default: 60s)
	Timeout time.Duration
	// RateLimiter is the optional rate limit configuration
	RateLimiter *RateLimitConfig
	// BaseURL is an optional custom base URL (for Azure OpenAI or proxies)
	BaseURL string
}

OpenAIConfig contains configuration for the OpenAI provider

type Option

type Option func(*LLMGateway)

Option is a functional option for configuring the gateway

func WithLogger

func WithLogger(logger Logger) Option

WithLogger sets the logger for the gateway

func WithZerolog

func WithZerolog(logger zerolog.Logger) Option

WithZerolog sets a zerolog logger for the gateway

type PerplexityConfig

type PerplexityConfig struct {
	// APIKey is the Perplexity API key (required)
	APIKey string
	// Timeout is the request timeout (default: 60s)
	Timeout time.Duration
	// RateLimiter is the optional rate limit configuration
	RateLimiter *RateLimitConfig
}

PerplexityConfig contains configuration for the Perplexity provider

type Phi3

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

Phi3 represents the Phi-3 model

func NewPhi3

func NewPhi3() *Phi3

NewPhi3 creates a new Phi-3 model with default options

func (*Phi3) ModelName

func (m *Phi3) ModelName() string

func (*Phi3) Provider

func (m *Phi3) Provider() ProviderType

func (*Phi3) SystemPrompt

func (m *Phi3) SystemPrompt() string

func (*Phi3) WithMaxTokens

func (m *Phi3) WithMaxTokens(n int) *Phi3

func (*Phi3) WithNumCtx

func (m *Phi3) WithNumCtx(n int) *Phi3

func (*Phi3) WithRepeatPenalty

func (m *Phi3) WithRepeatPenalty(p float64) *Phi3

func (*Phi3) WithSeed

func (m *Phi3) WithSeed(s int) *Phi3

func (*Phi3) WithSystemPrompt

func (m *Phi3) WithSystemPrompt(s string) *Phi3

func (*Phi3) WithTemperature

func (m *Phi3) WithTemperature(t float64) *Phi3

func (*Phi3) WithTopK

func (m *Phi3) WithTopK(k int) *Phi3

func (*Phi3) WithTopP

func (m *Phi3) WithTopP(p float64) *Phi3

type Provider

type Provider interface {
	Generate(ctx context.Context, model Model, prompt string) (*GenerationResponse, error)
	Health(ctx context.Context) error
	Close() error
}

Provider represents a single LLM provider implementation

type ProviderConfig

type ProviderConfig interface {
	// contains filtered or unexported methods
}

ProviderConfig is the interface that all provider configurations must implement

type ProviderFactory

type ProviderFactory func(config ProviderConfig, logger Logger) (Provider, error)

ProviderFactory creates a new provider instance from a provider config

type ProviderType

type ProviderType string

ProviderType identifies the LLM provider

const (
	ProviderOpenAI     ProviderType = "openai"
	ProviderAnthropic  ProviderType = "anthropic"
	ProviderGoogle     ProviderType = "google"
	ProviderPerplexity ProviderType = "perplexity"
	ProviderOllama     ProviderType = "ollama"
	ProviderBedrock    ProviderType = "bedrock"
)

type Qwen2

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

Qwen2 represents the Qwen 2 model

func NewQwen2

func NewQwen2() *Qwen2

NewQwen2 creates a new Qwen 2 model with default options

func (*Qwen2) ModelName

func (m *Qwen2) ModelName() string

func (*Qwen2) Provider

func (m *Qwen2) Provider() ProviderType

func (*Qwen2) SystemPrompt

func (m *Qwen2) SystemPrompt() string

func (*Qwen2) WithMaxTokens

func (m *Qwen2) WithMaxTokens(n int) *Qwen2

func (*Qwen2) WithNumCtx

func (m *Qwen2) WithNumCtx(n int) *Qwen2

func (*Qwen2) WithRepeatPenalty

func (m *Qwen2) WithRepeatPenalty(p float64) *Qwen2

func (*Qwen2) WithSeed

func (m *Qwen2) WithSeed(s int) *Qwen2

func (*Qwen2) WithSystemPrompt

func (m *Qwen2) WithSystemPrompt(s string) *Qwen2

func (*Qwen2) WithTemperature

func (m *Qwen2) WithTemperature(t float64) *Qwen2

func (*Qwen2) WithTopK

func (m *Qwen2) WithTopK(k int) *Qwen2

func (*Qwen2) WithTopP

func (m *Qwen2) WithTopP(p float64) *Qwen2

type RateLimitConfig

type RateLimitConfig struct {
	// MaxRetries is the maximum number of retry attempts (default: 3)
	MaxRetries int
	// InitialBackoff is the initial backoff duration (default: 1s)
	InitialBackoff time.Duration
	// MaxBackoff is the maximum backoff duration (default: 60s)
	MaxBackoff time.Duration
	// BackoffMultiplier is the multiplier for exponential backoff (default: 2.0)
	BackoffMultiplier float64
}

RateLimitConfig contains configuration for rate limit handling

func DefaultRateLimitConfig

func DefaultRateLimitConfig() *RateLimitConfig

DefaultRateLimitConfig returns the default rate limit configuration

type RetryFunc

type RetryFunc func() error

RetryFunc is a function that can be retried

type SearchOptions

type SearchOptions struct {
	// RecencyFilter filters results by time: "hour", "day", "week", "month", "year"
	RecencyFilter string
	// DomainFilter limits search to specific domains
	DomainFilter []string
	// CountryCode filters results by country (e.g., "us", "gb")
	CountryCode string
	// LanguageCode filters results by language (e.g., "en", "fr")
	LanguageCode string
	// ReturnImages includes image results
	ReturnImages bool
	// SafeSearch enables safe search mode
	SafeSearch bool
}

SearchOptions contains options for Perplexity Search API

type SearchResponse

type SearchResponse struct {
	// Results contains the search results
	Results []SearchResult
	// Images contains image results if requested
	Images []ImageResult
}

SearchResponse contains the response from Perplexity Search API

type SearchResult

type SearchResult struct {
	// Title is the page title
	Title string
	// URL is the result URL
	URL string
	// Snippet is the text snippet from the page
	Snippet string
	// DatePublished is when the content was published
	DatePublished string
	// Author is the content author if available
	Author string
}

SearchResult represents a single search result

type Sonar

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

Sonar represents the Sonar model (lightweight, cost-effective)

func NewSonar

func NewSonar() *Sonar

NewSonar creates a new Sonar model with default options

func (*Sonar) ModelName

func (m *Sonar) ModelName() string

func (*Sonar) Provider

func (m *Sonar) Provider() ProviderType

func (*Sonar) SystemPrompt

func (m *Sonar) SystemPrompt() string

func (*Sonar) WithMaxTokens

func (m *Sonar) WithMaxTokens(n int) *Sonar

func (*Sonar) WithReturnImages

func (m *Sonar) WithReturnImages(b bool) *Sonar

func (*Sonar) WithReturnRelatedQuestions

func (m *Sonar) WithReturnRelatedQuestions(b bool) *Sonar

func (*Sonar) WithSearchDomainFilter

func (m *Sonar) WithSearchDomainFilter(domains []string) *Sonar

func (*Sonar) WithSearchRecencyFilter

func (m *Sonar) WithSearchRecencyFilter(f string) *Sonar

func (*Sonar) WithSystemPrompt

func (m *Sonar) WithSystemPrompt(s string) *Sonar

func (*Sonar) WithTemperature

func (m *Sonar) WithTemperature(t float64) *Sonar

func (*Sonar) WithTopK

func (m *Sonar) WithTopK(k int) *Sonar

func (*Sonar) WithTopP

func (m *Sonar) WithTopP(p float64) *Sonar

type SonarDeepResearch

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

SonarDeepResearch represents the Sonar Deep Research model (in-depth research)

func NewSonarDeepResearch

func NewSonarDeepResearch() *SonarDeepResearch

NewSonarDeepResearch creates a new Sonar Deep Research model with default options

func (*SonarDeepResearch) ModelName

func (m *SonarDeepResearch) ModelName() string

func (*SonarDeepResearch) Provider

func (m *SonarDeepResearch) Provider() ProviderType

func (*SonarDeepResearch) SystemPrompt

func (m *SonarDeepResearch) SystemPrompt() string

func (*SonarDeepResearch) WithMaxTokens

func (m *SonarDeepResearch) WithMaxTokens(n int) *SonarDeepResearch

func (*SonarDeepResearch) WithReturnImages

func (m *SonarDeepResearch) WithReturnImages(b bool) *SonarDeepResearch

func (*SonarDeepResearch) WithReturnRelatedQuestions

func (m *SonarDeepResearch) WithReturnRelatedQuestions(b bool) *SonarDeepResearch

func (*SonarDeepResearch) WithSearchDomainFilter

func (m *SonarDeepResearch) WithSearchDomainFilter(domains []string) *SonarDeepResearch

func (*SonarDeepResearch) WithSearchRecencyFilter

func (m *SonarDeepResearch) WithSearchRecencyFilter(f string) *SonarDeepResearch

func (*SonarDeepResearch) WithSystemPrompt

func (m *SonarDeepResearch) WithSystemPrompt(s string) *SonarDeepResearch

func (*SonarDeepResearch) WithTemperature

func (m *SonarDeepResearch) WithTemperature(t float64) *SonarDeepResearch

func (*SonarDeepResearch) WithTopK

func (m *SonarDeepResearch) WithTopK(k int) *SonarDeepResearch

func (*SonarDeepResearch) WithTopP

type SonarPro

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

SonarPro represents the Sonar Pro model (advanced, complex queries)

func NewSonarPro

func NewSonarPro() *SonarPro

NewSonarPro creates a new Sonar Pro model with default options

func (*SonarPro) ModelName

func (m *SonarPro) ModelName() string

func (*SonarPro) Provider

func (m *SonarPro) Provider() ProviderType

func (*SonarPro) SystemPrompt

func (m *SonarPro) SystemPrompt() string

func (*SonarPro) WithMaxTokens

func (m *SonarPro) WithMaxTokens(n int) *SonarPro

func (*SonarPro) WithReturnImages

func (m *SonarPro) WithReturnImages(b bool) *SonarPro

func (*SonarPro) WithReturnRelatedQuestions

func (m *SonarPro) WithReturnRelatedQuestions(b bool) *SonarPro

func (*SonarPro) WithSearchDomainFilter

func (m *SonarPro) WithSearchDomainFilter(domains []string) *SonarPro

func (*SonarPro) WithSearchRecencyFilter

func (m *SonarPro) WithSearchRecencyFilter(f string) *SonarPro

func (*SonarPro) WithSystemPrompt

func (m *SonarPro) WithSystemPrompt(s string) *SonarPro

func (*SonarPro) WithTemperature

func (m *SonarPro) WithTemperature(t float64) *SonarPro

func (*SonarPro) WithTopK

func (m *SonarPro) WithTopK(k int) *SonarPro

func (*SonarPro) WithTopP

func (m *SonarPro) WithTopP(p float64) *SonarPro

type SonarReasoning

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

SonarReasoning represents the Sonar Reasoning model (enhanced reasoning)

func NewSonarReasoning

func NewSonarReasoning() *SonarReasoning

NewSonarReasoning creates a new Sonar Reasoning model with default options

func (*SonarReasoning) ModelName

func (m *SonarReasoning) ModelName() string

func (*SonarReasoning) Provider

func (m *SonarReasoning) Provider() ProviderType

func (*SonarReasoning) SystemPrompt

func (m *SonarReasoning) SystemPrompt() string

func (*SonarReasoning) WithMaxTokens

func (m *SonarReasoning) WithMaxTokens(n int) *SonarReasoning

func (*SonarReasoning) WithReturnImages

func (m *SonarReasoning) WithReturnImages(b bool) *SonarReasoning

func (*SonarReasoning) WithReturnRelatedQuestions

func (m *SonarReasoning) WithReturnRelatedQuestions(b bool) *SonarReasoning

func (*SonarReasoning) WithSearchDomainFilter

func (m *SonarReasoning) WithSearchDomainFilter(domains []string) *SonarReasoning

func (*SonarReasoning) WithSearchRecencyFilter

func (m *SonarReasoning) WithSearchRecencyFilter(f string) *SonarReasoning

func (*SonarReasoning) WithSystemPrompt

func (m *SonarReasoning) WithSystemPrompt(s string) *SonarReasoning

func (*SonarReasoning) WithTemperature

func (m *SonarReasoning) WithTemperature(t float64) *SonarReasoning

func (*SonarReasoning) WithTopK

func (m *SonarReasoning) WithTopK(k int) *SonarReasoning

func (*SonarReasoning) WithTopP

func (m *SonarReasoning) WithTopP(p float64) *SonarReasoning

type SonarReasoningPro

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

SonarReasoningPro represents the Sonar Reasoning Pro model (advanced reasoning)

func NewSonarReasoningPro

func NewSonarReasoningPro() *SonarReasoningPro

NewSonarReasoningPro creates a new Sonar Reasoning Pro model with default options

func (*SonarReasoningPro) ModelName

func (m *SonarReasoningPro) ModelName() string

func (*SonarReasoningPro) Provider

func (m *SonarReasoningPro) Provider() ProviderType

func (*SonarReasoningPro) SystemPrompt

func (m *SonarReasoningPro) SystemPrompt() string

func (*SonarReasoningPro) WithMaxTokens

func (m *SonarReasoningPro) WithMaxTokens(n int) *SonarReasoningPro

func (*SonarReasoningPro) WithReturnImages

func (m *SonarReasoningPro) WithReturnImages(b bool) *SonarReasoningPro

func (*SonarReasoningPro) WithReturnRelatedQuestions

func (m *SonarReasoningPro) WithReturnRelatedQuestions(b bool) *SonarReasoningPro

func (*SonarReasoningPro) WithSearchDomainFilter

func (m *SonarReasoningPro) WithSearchDomainFilter(domains []string) *SonarReasoningPro

func (*SonarReasoningPro) WithSearchRecencyFilter

func (m *SonarReasoningPro) WithSearchRecencyFilter(f string) *SonarReasoningPro

func (*SonarReasoningPro) WithSystemPrompt

func (m *SonarReasoningPro) WithSystemPrompt(s string) *SonarReasoningPro

func (*SonarReasoningPro) WithTemperature

func (m *SonarReasoningPro) WithTemperature(t float64) *SonarReasoningPro

func (*SonarReasoningPro) WithTopK

func (m *SonarReasoningPro) WithTopK(k int) *SonarReasoningPro

func (*SonarReasoningPro) WithTopP

type TokenUsage

type TokenUsage struct {
	// PromptTokens is the number of tokens in the prompt
	PromptTokens int `json:"prompt_tokens"`
	// CompletionTokens is the number of tokens in the completion
	CompletionTokens int `json:"completion_tokens"`
	// TotalTokens is the total number of tokens used
	TotalTokens int `json:"total_tokens"`
}

TokenUsage contains token usage information

type ZerologAdapter

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

ZerologAdapter adapts zerolog.Logger to our Logger interface

func NewZerologAdapter

func NewZerologAdapter(logger zerolog.Logger) *ZerologAdapter

NewZerologAdapter creates a new adapter for zerolog

func (*ZerologAdapter) Debug

func (z *ZerologAdapter) Debug() LogEvent

func (*ZerologAdapter) Error

func (z *ZerologAdapter) Error() LogEvent

func (*ZerologAdapter) Info

func (z *ZerologAdapter) Info() LogEvent

Directories

Path Synopsis
internal
perplexity
Package perplexity provides a Go client for the Perplexity API.
Package perplexity provides a Go client for the Perplexity API.

Jump to

Keyboard shortcuts

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