model

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Provider Provider
}

func (Client) Generate

func (c Client) Generate(ctx context.Context, request Request) (Response, error)

type Message

type Message struct {
	Role    string
	Content string
}

type OpenAICompatibleProvider

type OpenAICompatibleProvider struct {
	BaseURL    string
	APIKey     string
	HTTPClient *http.Client
}

func (OpenAICompatibleProvider) Generate

func (p OpenAICompatibleProvider) Generate(ctx context.Context, request Request) (Response, error)

type Provider

type Provider interface {
	Generate(ctx context.Context, request Request) (Response, error)
}

func NewOpenAICompatibleProvider

func NewOpenAICompatibleProvider(cfg project.ModelConfig) (Provider, error)

type ProviderFunc

type ProviderFunc func(ctx context.Context, request Request) (Response, error)

func (ProviderFunc) Generate

func (f ProviderFunc) Generate(ctx context.Context, request Request) (Response, error)

type Request

type Request struct {
	Model    string
	Messages []Message
}

type Response

type Response struct {
	Content  string
	Metadata map[string]string
}

Jump to

Keyboard shortcuts

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