mutation

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Provider      Provider
	Model         string
	BaseURL       string
	LiteLLMFormat LiteLLMFormat
}

type Generator

type Generator interface {
	GenerateMutation(ctx context.Context, req Request) (Response, error)
}

func NewGenerator

func NewGenerator(cfg Config) (Generator, error)

type LiteLLMFormat

type LiteLLMFormat string
const (
	LiteLLMFormatOpenAI    LiteLLMFormat = "openai"
	LiteLLMFormatAnthropic LiteLLMFormat = "anthropic"
)

type Provider

type Provider string
const (
	ProviderAnthropic  Provider = "anthropic"
	ProviderOpenAI     Provider = "openai"
	ProviderOpenRouter Provider = "openrouter"
	ProviderOllama     Provider = "ollama"
	ProviderLiteLLM    Provider = "litellm"
)

type Request

type Request struct {
	Model           string
	SystemPrompt    string
	UserPrompt      string
	MaxOutputTokens int
}

type ResolvedConfig

type ResolvedConfig struct {
	Provider        Provider
	Model           string
	BaseURL         string
	BaseURLExplicit bool
	APIKey          string
	LiteLLMFormat   LiteLLMFormat
}

func ResolveConfig

func ResolveConfig(cfg Config) (ResolvedConfig, error)

type Response

type Response struct {
	RawText   string
	Provider  string
	Model     string
	RequestID string
	Usage     *Usage
}

type Usage

type Usage struct {
	InputTokens  int
	OutputTokens int
	TotalTokens  int
}

Jump to

Keyboard shortcuts

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