Help us shape the future of Go! Take the 2026 Go Developer Survey

factory

package
v0.22.5 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCustomProvider

func CreateCustomProvider(providerName, model string) (api.ClientInterface, error)

CreateCustomProvider creates a provider from custom provider configuration

func CreateGenericProvider

func CreateGenericProvider(providerName, model string) (api.ClientInterface, error)

CreateGenericProvider creates a generic provider by name

func CreateProviderClient

func CreateProviderClient(clientType api.ClientType, model string) (api.ClientInterface, error)

CreateProviderClient is a factory function that creates providers

func GlobalFactory added in v0.16.2

func GlobalFactory() *providers.ProviderFactory

GlobalFactory returns the global provider factory instance.

Types

type TestClient

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

TestClient implements a mock client for CI/testing environments

func (*TestClient) CheckConnection

func (t *TestClient) CheckConnection() error

func (*TestClient) GetAverageTPS

func (t *TestClient) GetAverageTPS() float64

func (*TestClient) GetLastTPS

func (t *TestClient) GetLastTPS() float64

func (*TestClient) GetModel

func (t *TestClient) GetModel() string

func (*TestClient) GetModelContextLimit

func (t *TestClient) GetModelContextLimit() (int, error)

func (*TestClient) GetProvider

func (t *TestClient) GetProvider() string

func (*TestClient) GetTPSStats

func (t *TestClient) GetTPSStats() map[string]float64

func (*TestClient) GetVisionModel

func (t *TestClient) GetVisionModel() string

func (*TestClient) ListModels

func (t *TestClient) ListModels(ctx context.Context) ([]api.ModelInfo, error)

func (*TestClient) ResetTPSStats

func (t *TestClient) ResetTPSStats()

func (*TestClient) SendChatRequest

func (t *TestClient) SendChatRequest(ctx context.Context, messages []api.Message, tools []api.Tool, reasoning string, disableThinking bool) (*api.ChatResponse, error)

Create test client methods

func (*TestClient) SendChatRequestStream

func (t *TestClient) SendChatRequestStream(ctx context.Context, messages []api.Message, tools []api.Tool, reasoning string, disableThinking bool, callback api.StreamCallback) (*api.ChatResponse, error)

func (*TestClient) SendVisionRequest

func (t *TestClient) SendVisionRequest(ctx context.Context, messages []api.Message, tools []api.Tool, reasoning string, disableThinking bool) (*api.ChatResponse, error)

func (*TestClient) SetDebug

func (t *TestClient) SetDebug(debug bool)

func (*TestClient) SetModel

func (t *TestClient) SetModel(model string) error

func (*TestClient) SupportsVision

func (t *TestClient) SupportsVision() bool

func (*TestClient) VisionCapabilities added in v0.16.20

func (t *TestClient) VisionCapabilities() api.VisionCapabilities

VisionCapabilities returns the test client's vision limits — the safe defaults. TestClient never participates in real vision requests, but the method is required to satisfy api.ClientInterface. SP-103-D3 / AUDIT-GAP-2.

Jump to

Keyboard shortcuts

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