ai

package
v0.0.0-prerelease Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Providers = []string{
	"claude",
	"copilot",
	"gemini",
	"ollama",
	"openai",
	"openrouter",
}

Functions

This section is empty.

Types

type AI

type AI interface {
	Chat() (string, error)
	Models() (map[string]string, error)
	// FIXME: dump convienence method to set models from cache
	SetModels(map[string]string) (map[string]string, error)
	SetModel(string) error
	Verify() error
	Close() error
}

func NewAI

func NewAI(ctx context.Context, cfg *Config) (AI, error)

type CachingAI

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

func (*CachingAI) Chat

func (c *CachingAI) Chat() (string, error)

func (*CachingAI) Close

func (c *CachingAI) Close() error

func (*CachingAI) Models

func (c *CachingAI) Models() (map[string]string, error)

func (*CachingAI) SetModel

func (c *CachingAI) SetModel(model string) error

func (*CachingAI) SetModels

func (c *CachingAI) SetModels(models map[string]string) (map[string]string, error)

func (*CachingAI) Verify

func (c *CachingAI) Verify() error

type Config

type Config struct {
	UUID           string
	Provider       string
	Prompt         string
	Model          string
	Temperature    float64
	TopP           float64
	TemperatureSet bool
	TopPSet        bool
	Stream         bool
	DisableCache   bool
	Verbose        bool
	MaxRetries     int
	RetryBackoff   time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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