provider

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSSEStream

func ParseSSEStream(r io.Reader, onEvent func(eventType string, data []byte) error) error

func ValidateJSON added in v1.3.0

func ValidateJSON(content string) error

Types

type Anthropic

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

func NewAnthropic

func NewAnthropic(apiKey, baseURL string) *Anthropic

func (*Anthropic) Name

func (a *Anthropic) Name() string

func (*Anthropic) Probe

func (a *Anthropic) Probe(pc ProviderContext) (Result, error)

type Azure

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

func NewAzure

func NewAzure(apiKey, baseURL, apiVersion string) *Azure

func (*Azure) Name

func (a *Azure) Name() string

func (*Azure) Probe

func (a *Azure) Probe(pc ProviderContext) (Result, error)

type Bedrock

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

func NewBedrock

func NewBedrock(accessKey, secretKey, region, baseURL string) *Bedrock

func (*Bedrock) Name

func (b *Bedrock) Name() string

func (*Bedrock) Probe

func (b *Bedrock) Probe(pc ProviderContext) (Result, error)

type Google

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

func NewGoogle

func NewGoogle(apiKey, baseURL string) *Google

func (*Google) Name

func (g *Google) Name() string

func (*Google) Probe

func (g *Google) Probe(pc ProviderContext) (Result, error)

type OpenAI

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

func NewOpenAI

func NewOpenAI(apiKey, baseURL string) *OpenAI

func (*OpenAI) Name

func (o *OpenAI) Name() string

func (*OpenAI) Probe

func (o *OpenAI) Probe(pc ProviderContext) (Result, error)

type Provider

type Provider interface {
	Name() string
	Probe(ctx ProviderContext) (Result, error)
}

type ProviderContext

type ProviderContext struct {
	Model          string
	Prompt         string
	MaxTokens      int
	Timeout        time.Duration
	ResponseFormat string
}

type Result

type Result struct {
	TTFT         time.Duration
	TotalLatency time.Duration
	TokenCount   int
	Content      string
}

Jump to

Keyboard shortcuts

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