llmresolver

package
v0.28.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAvailableModels = errors.New("no models found in runtime state")

ErrNoAvailableModels is returned when no providers are available.

View Source
var ErrNoSatisfactoryModel = errors.New("no model matched the requirements")

ErrNoSatisfactoryModel is returned when providers exist but none match requirements.

Functions

func Chat

Chat implements the chat resolution workflow using the provided dependencies.

func Embed

Embed implements the embedding resolution workflow using the provided dependencies.

func NormalizeModelName

func NormalizeModelName(modelName string) string

NormalizeModelName standardizes model names for comparison

func PromptExecute

func PromptExecute(
	ctx context.Context,
	req Request,
	getModels func(ctx context.Context, backendTypes ...string) ([]libmodelprovider.Provider, error),
	resolver func(candidates []libmodelprovider.Provider) (libmodelprovider.Provider, string, error),
) (libmodelprovider.LLMPromptExecClient, libmodelprovider.Provider, string, error)

PromptExecute implements the prompt execution resolution workflow using the provided dependencies.

func Randomly

Randomly is a policy that selects a random provider and random backend.

This provides basic load balancing across available resources.

func Stream

Stream implements the streaming resolution workflow using the provided dependencies.

Types

type EmbedRequest

type EmbedRequest struct {
	ModelName    string
	ProviderType string
	Tracker      libtracker.ActivityTracker
}

type Request

type Request struct {
	ProviderTypes []string
	ModelNames    []string
	ContextLength int
	Tracker       libtracker.ActivityTracker
}

Jump to

Keyboard shortcuts

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