provider

package
v0.331.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claude

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

func NewClaude

func NewClaude(client *anthropic.Client, model string) *Claude

func (*Claude) Complete

func (c *Claude) Complete(ctx context.Context, system string, messages []Message) (*Response, error)

func (*Claude) Name

func (c *Claude) Name() string

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Message is a provider-agnostic chat message.

type Ollama

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

func NewOllama

func NewOllama(baseURL, model string) *Ollama

func (*Ollama) Complete

func (o *Ollama) Complete(ctx context.Context, system string, messages []Message) (*Response, error)

func (*Ollama) Name

func (o *Ollama) Name() string

type OpenAICompat

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

func NewOpenAICompat

func NewOpenAICompat(baseURL, apiKey, model, name string) *OpenAICompat

func NewOpenRouter

func NewOpenRouter(apiKey, model string) *OpenAICompat

func (*OpenAICompat) Complete

func (o *OpenAICompat) Complete(ctx context.Context, system string, messages []Message) (*Response, error)

func (*OpenAICompat) Name

func (o *OpenAICompat) Name() string

type Provider

type Provider interface {
	Complete(ctx context.Context, system string, messages []Message) (*Response, error)
	Name() string
}

Provider abstracts LLM completion.

type Response

type Response struct {
	Content string
}

Response from an LLM provider.

Jump to

Keyboard shortcuts

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