engine

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package engine is the stable, host-facing Eyrie API.

Hosts should prefer this package over assembling client, catalog, config, credentials, runtime, and setup packages directly. The lower-level packages remain public for backward compatibility and advanced integrations.

Engine is intentionally stateless with respect to product conversations: the host owns conversation history, tools, permissions, and checkpoints; Eyrie owns credential, catalog, selection, routing, and model transport.

Host-facing DTOs and the Provider port live in github.com/GrayCodeAI/eyrie/llm; this package re-exports them as type aliases and *Engine implements llm.Provider (see contract_assert.go).

Index

Constants

View Source
const (
	EventRouteSelected = "route_selected"
	EventRouteChanged  = "route_changed"
	EventContentDelta  = "content_delta"
	EventThinkingDelta = "thinking_delta"
	EventToolCallStart = "tool_call_start"
	EventToolCallDelta = "tool_call_delta"
	EventToolCallDone  = "tool_call_done"
	EventUsage         = "usage"
	EventRetry         = "retry"
	EventContinuation  = "continuation"
	EventWarning       = "warning"
	EventTTFT          = "ttft"
	EventDone          = "done"
)

Event type names. These are the stable stream vocabulary shared by the engine and its hosts; new types are additive and hosts must safely ignore unknown ones.

View Source
const (
	CheckOK   = llm.CheckOK
	CheckFail = llm.CheckFail
	CheckWarn = llm.CheckWarn
)

Re-export preflight status constants from the contract package.

View Source
const ContractVersion = "2"

ContractVersion is the compatibility version of the host-facing API.

Variables

View Source
var DefaultStore = credentials.DefaultStore

DefaultStore returns the process-wide credential store (for tests).

View Source
var SetDefaultStore = credentials.SetDefaultStore

SetDefaultStore replaces the process-wide credential store (for tests).

Functions

func AccountForEnv

func AccountForEnv(envVar string) string

AccountForEnv returns the keychain account name for an env var.

func CredentialGuidance

func CredentialGuidance(providerID, secret string) string

CredentialGuidance returns provider-specific, non-secret setup guidance.

func DefaultThinkingDisabled

func DefaultThinkingDisabled(providerID string) bool

DefaultThinkingDisabled reports whether a provider defaults thinking OFF when unset.

func FormatPreflight

func FormatPreflight(report PreflightReport) string

func FormatSetupError

func FormatSetupError(providerID string, err error) string

FormatSetupError returns a safe provider setup hint.

func HasSecret

func HasSecret(ctx context.Context, envKey string) bool

HasSecret reports whether a secret exists for an env var (for tests).

func IsCatalogCacheRequired

func IsCatalogCacheRequired(err error) bool

IsCatalogCacheRequired reports whether an operation needs the local model catalog to be refreshed before it can continue.

func IsCode

func IsCode(err error, code ErrorCode) bool

IsCode reports whether err or an error in its chain has the supplied code.

func MigrateEnvFileCredentials

func MigrateEnvFileCredentials(ctx context.Context) (int, error)

func NormalizeProviderID

func NormalizeProviderID(providerID string) string

NormalizeProviderID resolves provider aliases to Eyrie's runtime identifier.

func RegisterCustomGateway

func RegisterCustomGateway(gateway CustomGateway) error

RegisterCustomGateway registers safe OpenAI-compatible routing metadata for compatibility callers. New embedders should pass Options.CustomGateways so instances stay isolated. Registration must happen before Engine creation; each Engine snapshots the metadata and always resolves credentials through its own injected SecretStore.

func RegisteredGatewayCount

func RegisteredGatewayCount() int

RegisteredGatewayCount returns the first-class provider count from the provider registry. Hosts derive provider counts from Eyrie instead of hard-coding them, so new providers require no host changes.

func SecretStoreName

func SecretStoreName() string

SecretStoreName is safe presentation metadata for host UIs.

func SetSecretStoreServiceName

func SetSecretStoreServiceName(name string)

SetSecretStoreServiceName overrides the OS secret-store service name (default "eyrie"). Hosts call this once at startup so existing credentials filed under their product name (e.g. "hawk") stay readable.

func ThinkingToggleSupported

func ThinkingToggleSupported(providerID string) bool

ThinkingToggleSupported reports whether a provider's wire protocol honors thinking toggles.

Types

type CatalogHealth

type CatalogHealth = llm.CatalogHealth

CatalogHealth is the host-facing catalog health report.

type CatalogSnapshot

type CatalogSnapshot = llm.CatalogSnapshot

CatalogSnapshot is an immutable host-facing view of a loaded catalog. It is a type alias to the canonical llm.CatalogSnapshot so exactly one struct crosses the host boundary (matching every other type in this file).

type CheckStatus

type CheckStatus = llm.CheckStatus

CheckStatus is a preflight check status.

type ContentPart

type ContentPart = llm.ContentPart

ContentPart is a provider-neutral multimodal message part.

type CredentialProvider

type CredentialProvider = llm.CredentialProviderOption

CredentialProvider is safe setup metadata for a configurable provider. It contains identifiers and labels only, never credential material.

type CredentialResolution

type CredentialResolution = llm.CredentialResolution

CredentialResolution validates pasted input and returns provider choices. The input secret is never retained in this value.

type CredentialStatus

type CredentialStatus = llm.CredentialStatus

CredentialStatus is safe to render or log; it never contains a secret.

type CredentialStorageReport

type CredentialStorageReport struct {
	PlatformStore string `json:"platform_store"`
	Writable      bool   `json:"writable"`
	Detail        string `json:"detail,omitempty"`
	Formatted     string `json:"formatted,omitempty"`
}

CredentialStorageReport is safe to print and never includes secrets.

func CredentialStorage

func CredentialStorage(ctx context.Context) CredentialStorageReport

type CustomGateway

type CustomGateway struct {
	ID             string                     `json:"id"`
	DisplayName    string                     `json:"display_name,omitempty"`
	BaseURL        string                     `json:"base_url"`
	CredentialEnv  string                     `json:"credential_env,omitempty"`
	DefaultModel   string                     `json:"default_model,omitempty"`
	MaxTokensField string                     `json:"max_tokens_field,omitempty"`
	ContextWindow  int                        `json:"context_window,omitempty"`
	SortOrder      int                        `json:"sort_order,omitempty"`
	ChatPreference int                        `json:"chat_preference,omitempty"`
	Capabilities   *CustomGatewayCapabilities `json:"capabilities,omitempty"`
}

CustomGateway describes a user-configured OpenAI-compatible gateway. It contains only routing metadata; credential material remains in Eyrie's secret store and is discovered by CredentialEnv.

type CustomGatewayCapabilities

type CustomGatewayCapabilities struct {
	Streaming      bool `json:"streaming,omitempty"`
	Tools          bool `json:"tools,omitempty"`
	Vision         bool `json:"vision,omitempty"`
	StructuredJSON bool `json:"structured_json,omitempty"`
	Reasoning      bool `json:"reasoning,omitempty"`
}

CustomGatewayCapabilities declares capabilities known to be supported by a custom OpenAI-compatible gateway. A nil declaration is permissive for backward compatibility: the remote gateway remains the source of truth.

type DeploymentSummary

type DeploymentSummary = llm.DeploymentSummary

DeploymentSummary is the host-facing deployment routing summary.

type Engine

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

Engine is Eyrie's narrow host facade. It is safe for concurrent use when the configured SecretStore is safe for concurrent use.

func New

func New(opts Options) (*Engine, error)

New constructs a host-facing Eyrie engine.

func (*Engine) ActiveSelection

func (e *Engine) ActiveSelection(ctx context.Context) Route

ActiveSelection reads the persisted host selection from this Engine's state.

func (*Engine) ApplyCredentials

func (e *Engine) ApplyCredentials(ctx context.Context, providerID string) (CatalogSnapshot, error)

ApplyCredentials refreshes catalog state and persists sanitized deployment routing derived from the Engine's credential store. Secret fields are never written to provider.json.

func (*Engine) ApplyGatewayEnvironment

func (e *Engine) ApplyGatewayEnvironment(_ context.Context, providerID string)

ApplyGatewayEnvironment derives process-local regional base URLs. Deprecated: invocation-scoped hosts must use Engine state directly and must not mutate process environment. This remains only for legacy callers.

func (*Engine) CanonicalModel

func (e *Engine) CanonicalModel(ctx context.Context, modelID string) string

func (*Engine) Catalog

func (e *Engine) Catalog(ctx context.Context) (CatalogSnapshot, error)

Catalog returns the current cached catalog through a stable snapshot.

func (*Engine) CatalogHealth

func (e *Engine) CatalogHealth(ctx context.Context) CatalogHealth

func (*Engine) ClearSelection

func (e *Engine) ClearSelection(ctx context.Context) error

ClearSelection removes active provider/model state without modifying credentials, deployments, or routing.

func (*Engine) CompactNative

func (e *Engine) CompactNative(ctx context.Context, req NativeCompactionRequest) (string, error)

CompactNative performs provider-native compaction and returns a normalized summary. Conversation mutation remains the host's responsibility.

func (*Engine) CredentialEnvKeys

func (e *Engine) CredentialEnvKeys(providerID string) []string

func (*Engine) CredentialProviders

func (e *Engine) CredentialProviders(context.Context) []CredentialProvider

CredentialProviders lists safe provider choices for setup UIs.

func (*Engine) CredentialStatus

func (e *Engine) CredentialStatus(ctx context.Context, providerID string) (CredentialStatus, error)

CredentialStatus reports whether a provider credential is configured.

func (*Engine) DefaultModel

func (e *Engine) DefaultModel(ctx context.Context, provider, fallback string) string

DefaultModel returns the catalog default for a provider.

func (*Engine) DefaultProviderFilter

func (e *Engine) DefaultProviderFilter(ctx context.Context) string

func (*Engine) DefaultThinkingDisabled

func (e *Engine) DefaultThinkingDisabled(providerID string) bool

DefaultThinkingDisabled reports whether a provider defaults thinking OFF when unset.

func (*Engine) DeploymentRoutingEnabled

func (e *Engine) DeploymentRoutingEnabled(override *bool) bool

func (*Engine) DeploymentStatus

func (e *Engine) DeploymentStatus(ctx context.Context, activeModel string) (string, error)

func (*Engine) DeploymentSummary

func (e *Engine) DeploymentSummary(ctx context.Context, activeModel string) (DeploymentSummary, error)

func (*Engine) EffectiveSelection

func (e *Engine) EffectiveSelection(ctx context.Context, opts SelectionOptions) Selection

EffectiveSelection resolves persisted state plus optional host overrides using this Engine's injected catalog, provider config, and credential store.

func (*Engine) GatewayDefinitions

func (e *Engine) GatewayDefinitions() []Gateway

GatewayDefinitions returns pure registry/custom metadata in setup UI order. It does not read credentials, provider state, or the model catalog.

func (*Engine) GatewayForModel

func (e *Engine) GatewayForModel(ctx context.Context, modelID string) string

func (*Engine) GatewayRegion

func (e *Engine) GatewayRegion(providerID string) (label string, required bool)

GatewayRegion returns normalized region presentation for regional gateways.

func (*Engine) Gateways

func (e *Engine) Gateways(ctx context.Context) []Gateway

Gateways returns safe configuration status using this Engine's injected credential store, catalog path, and provider state path.

func (*Engine) Generate

func (e *Engine) Generate(ctx context.Context, req GenerateRequest) (*GenerateResponse, error)

Generate performs a blocking generation through Eyrie's resolved transport.

func (*Engine) GenerateImage added in v0.6.0

func (e *Engine) GenerateImage(ctx context.Context, req GenerateImageRequest) ([]GenerateImageResult, error)

GenerateImage generates images through the OpenAI-compatible endpoint configured in req. It is a stateless facade over client.ImageClient, returning decoded image bytes (plus any provider URL). The engine keeps no media state; the host owns conversation and persistence.

func (*Engine) HasCredentialEnv

func (e *Engine) HasCredentialEnv(ctx context.Context, envVar string) bool

HasCredentialEnv reports presence without exposing the credential value.

func (*Engine) ListLiveModels

func (e *Engine) ListLiveModels(ctx context.Context, providerID string) ([]Model, error)

ListLiveModels queries one provider directly without reading from or writing to the catalog cache for its result set. Credentials and routing metadata come exclusively from this Engine's injected state.

func (*Engine) ListModels

func (e *Engine) ListModels(ctx context.Context, providerID string, refresh bool) ([]Model, error)

ListModels returns provider models through the stable facade.

func (*Engine) ListPublicModels

func (e *Engine) ListPublicModels(ctx context.Context, providerID string) ([]Model, error)

ListPublicModels returns provider-published model metadata that does not require credentials. It never mutates the Engine catalog cache.

func (*Engine) MigrateProviderSecrets

func (e *Engine) MigrateProviderSecrets() error

MigrateProviderSecrets imports credential fields persisted in provider state into the Engine's secret store, then atomically strips them from provider.json.

func (*Engine) MigrateProviderSecretsContext

func (e *Engine) MigrateProviderSecretsContext(ctx context.Context) error

func (*Engine) ModelClassOf

func (e *Engine) ModelClassOf(ctx context.Context, modelID string) ModelClass

ModelClassOf resolves a model's relative catalog cost band.

func (*Engine) ModelInfo

func (e *Engine) ModelInfo(ctx context.Context, modelID string) (Model, bool, error)

ModelInfo returns normalized metadata for a model id or alias.

func (*Engine) ModelNames

func (e *Engine) ModelNames(ctx context.Context) []string

ModelNames returns canonical ids, display names, and aliases for completion.

func (*Engine) ModelProviders

func (e *Engine) ModelProviders(ctx context.Context) ([]string, error)

ModelProviders lists canonical catalog model owners and invocation-scoped custom gateway owners.

func (*Engine) PreferredModel

func (e *Engine) PreferredModel(ctx context.Context, provider string, class ModelClass, fallback string) string

PreferredModel returns a provider model in the requested relative class.

func (*Engine) PreferredModels

func (e *Engine) PreferredModels(ctx context.Context, primaryProvider string, class ModelClass, limit int) []string

PreferredModels returns unique cross-provider candidates in preference order.

func (*Engine) Preflight

func (e *Engine) Preflight(ctx context.Context) PreflightReport

func (*Engine) PreflightWithOptions

func (e *Engine) PreflightWithOptions(ctx context.Context, opts PreflightOptions) PreflightReport

func (*Engine) PrimaryModel

func (e *Engine) PrimaryModel(ctx context.Context) string

PrimaryModel returns Eyrie's stable best-effort catalog primary model.

func (*Engine) ProviderForModel

func (e *Engine) ProviderForModel(ctx context.Context, modelID string) string

ProviderForModel returns the canonical catalog owner or invocation-scoped custom gateway owner for a model.

func (*Engine) ProviderStateSecurityStatus

func (e *Engine) ProviderStateSecurityStatus() ProviderStateSecurity

ProviderStateSecurityStatus inspects provider.json without returning values.

func (*Engine) RefreshCatalog

func (e *Engine) RefreshCatalog(ctx context.Context, providerID string) (CatalogSnapshot, error)

RefreshCatalog refreshes one provider when providerID is non-empty, or all configured providers otherwise. Credentials are read from this Engine's injected store rather than a package-global store.

func (*Engine) RemoveCredential

func (e *Engine) RemoveCredential(ctx context.Context, providerID string) error

RemoveCredential deletes a provider credential from the configured store.

func (*Engine) Resolve

func (e *Engine) Resolve(ctx context.Context, req SelectionRequest) (Route, error)

Resolve selects a concrete provider/model and verifies known catalog requirements before transport construction.

func (*Engine) ResolveCredential

func (e *Engine) ResolveCredential(ctx context.Context, secret string) CredentialResolution

ResolveCredential validates credential input and returns safe provider choices. Eyrie does not retain or return the supplied secret.

func (*Engine) RoutingPreview

func (e *Engine) RoutingPreview(ctx context.Context, modelID string) (string, error)

func (*Engine) SaveCredential

func (e *Engine) SaveCredential(ctx context.Context, providerID, secret string) (CredentialStatus, error)

SaveCredential validates, stores, and probes a provider credential. The secret is persisted before the probe so a transient network failure does not discard user input. The returned error states that persistence occurred.

func (*Engine) SaveCredentialEnv

func (e *Engine) SaveCredentialEnv(ctx context.Context, envVar, secret string) error

SaveCredentialEnv validates and stores a legacy env-addressed credential. New callers should prefer SaveCredential(providerID, secret).

func (*Engine) SetActiveModel

func (e *Engine) SetActiveModel(ctx context.Context, modelID string) error

SetActiveModel persists a model choice and infers its serving provider from the configured catalog.

func (*Engine) SetActiveProvider

func (e *Engine) SetActiveProvider(ctx context.Context, providerID string) error

SetActiveProvider persists a provider choice without requiring a model.

func (*Engine) SetGatewayRegion

func (e *Engine) SetGatewayRegion(ctx context.Context, providerID, value string) error

SetGatewayRegion persists regional gateway configuration at the Engine path.

func (*Engine) SetSelection

func (e *Engine) SetSelection(ctx context.Context, providerID, modelID string) error

SetSelection persists the host/user's provider and model choice in this Engine's configured state path. It does not persist credentials.

func (*Engine) StatePaths

func (e *Engine) StatePaths() StatePaths

func (*Engine) Stream

func (e *Engine) Stream(ctx context.Context, req GenerateRequest) (EventStreamer, error)

Stream starts a normalized streaming generation. The returned stream must be closed by the caller. The concrete type is *Stream; the signature returns EventStreamer so *Engine satisfies llm.Provider / llm.Generator.

When the concrete *Stream is nil, this returns a typed-nil EventStreamer (interface nil) so callers can check stream == nil reliably.

func (*Engine) SupportsNativeCompaction

func (e *Engine) SupportsNativeCompaction(ctx context.Context, provider, model string) bool

SupportsNativeCompaction reports whether the selection and configured credential store support native compaction.

func (*Engine) ThinkingToggleSupported

func (e *Engine) ThinkingToggleSupported(providerID string) bool

ThinkingToggleSupported reports whether a provider's wire protocol honors thinking toggles.

func (*Engine) Transcribe added in v0.6.0

func (e *Engine) Transcribe(ctx context.Context, req TranscribeRequest) (string, error)

Transcribe transcribes audio through the OpenAI-compatible endpoint configured in req, returning the transcript text. It is a stateless facade over client.AudioClient.

type Error

type Error struct {
	Code      ErrorCode `json:"code"`
	Operation string    `json:"operation,omitempty"`
	Provider  string    `json:"provider,omitempty"`
	Model     string    `json:"model,omitempty"`
	Message   string    `json:"message,omitempty"`
	Retryable bool      `json:"retryable,omitempty"`
	Cause     error     `json:"-"`
}

Error is the typed error returned across the host boundary.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode string

ErrorCode is a stable, machine-readable engine failure category.

const (
	ErrorInvalidRequest      ErrorCode = "invalid_request"
	ErrorCredentialMissing   ErrorCode = "credential_missing"
	ErrorAuthentication      ErrorCode = "authentication_failed"
	ErrorCatalogUnavailable  ErrorCode = "catalog_unavailable"
	ErrorModelUnavailable    ErrorCode = "model_unavailable"
	ErrorCapabilityMismatch  ErrorCode = "capability_mismatch"
	ErrorContextExceeded     ErrorCode = "context_exceeded"
	ErrorRateLimited         ErrorCode = "rate_limited"
	ErrorBudgetExceeded      ErrorCode = "budget_exceeded"
	ErrorProviderUnavailable ErrorCode = "provider_unavailable"
	ErrorCancelled           ErrorCode = "cancelled"
	ErrorInternal            ErrorCode = "internal"
)

type Event

type Event = llm.EyrieStreamEvent

Event is a normalized model stream event. New optional fields and event types are additive; hosts must safely ignore unknown event types.

type EventStreamer

type EventStreamer = llm.EventStreamer

EventStreamer is the pull-based host stream contract.

type Gateway

type Gateway = llm.Gateway

Gateway is one host-facing provider/deployment configuration row.

type GenerateImageRequest added in v0.6.0

type GenerateImageRequest struct {
	MediaOptions
	Prompt string
	Model  string
	Size   string // e.g. "1024x1024"
	N      int
}

GenerateImageRequest is the host-facing request for image generation.

type GenerateImageResult added in v0.6.0

type GenerateImageResult struct {
	Image       []byte
	ProviderURL string
}

GenerateImageResult is one generated image plus its provider URL when present.

type GenerateRequest

type GenerateRequest = llm.GenerateRequest

GenerateRequest is the provider-neutral request accepted by Engine.

type GenerateResponse

type GenerateResponse = llm.EyrieResponse

GenerateResponse is a normalized blocking response.

type GenerationOptions

type GenerationOptions = llm.GenerationOptions

GenerationOptions contains model-generation controls that have equivalent semantics across one or more provider adapters. Provider-specific wire formats remain internal to Eyrie.

type Intent

type Intent = llm.Intent

Intent expresses a host's semantic preference without naming a provider.

type Limits

type Limits = llm.Limits

Limits bounds a generation request.

type MapStore

type MapStore = credentials.MapStore

MapStore is the in-memory credential store for tests (alias).

type MediaOptions added in v0.6.0

type MediaOptions struct {
	APIKey  string
	BaseURL string
}

MediaOptions carries the credentials and endpoint for a media backend call. Credentials are supplied per call by the host — no new secret paths are introduced, and the engine never stores media credentials.

type Message

type Message = llm.EyrieMessage

Message is the stable conversation DTO at the host boundary.

type Metadata

type Metadata = llm.Metadata

Metadata provides stable correlation identifiers. Providers receive only fields that their adapter explicitly supports.

type Model

type Model = llm.Model

Model is a host-facing catalog row.

type ModelClass

type ModelClass = llm.ModelClass

ModelClass is a provider-neutral relative model cost/capability band.

type NativeCompactionRequest

type NativeCompactionRequest = llm.NativeCompactionRequest

NativeCompactionRequest is a provider-native compaction request.

type OperationsGraphExport

type OperationsGraphExport = operationsgraph.Export

OperationsGraphExport is Eyrie's portable operations graph projection.

func BuildOperationsGraph

func BuildOperationsGraph(input OperationsGraphInput) (*OperationsGraphExport, error)

BuildOperationsGraph projects route and normalized usage telemetry without exposing provider, model, request, or generated content values.

type OperationsGraphInput

type OperationsGraphInput = operationsgraph.Input

OperationsGraphInput is the host-facing input for Eyrie's portable operations graph projection.

type Options

type Options struct {
	SecretStore        credentials.Store
	StateDir           string
	CatalogPath        string
	ProviderConfigPath string
	// RemoteCatalogURL is the trusted published catalog source used by full
	// refreshes. Empty selects Eyrie's compiled-in HTTPS catalog URL, never a
	// process-environment override.
	RemoteCatalogURL string
	// CustomGateways is snapshotted per Engine. A non-nil empty slice
	// explicitly declares that the host has no custom gateways.
	CustomGateways []CustomGateway
	// UseRegisteredCustomGateways opts into the deprecated process-global
	// RegisterCustomGateway registry when CustomGateways is nil.
	UseRegisteredCustomGateways bool
	// EnableRateLimiting wraps resolved transports with an adaptive rate
	// limiter that backs off when approaching provider limits. Off by default.
	EnableRateLimiting bool
	// RateLimitConfig configures the adaptive rate limiter. Zero value uses
	// sensible defaults (10% threshold, 10s max delay).
	RateLimitConfig client.AdaptiveRateLimitConfig
	// EnableCaching wraps resolved transports with a semantic response cache.
	// Only caches deterministic requests (temperature <= threshold). Off by
	// default.
	EnableCaching bool
	// CacheConfig configures the response cache. Zero value uses sensible
	// defaults (5min TTL, 100 entries, 0.5 temperature threshold).
	CacheConfig client.CacheConfig
}

Options supplies host-owned dependencies. A zero value uses Eyrie's safe defaults. Product-specific paths are deliberately not inferred here.

type Preference

type Preference = llm.Preference

Preference contains optional selection policy supplied by the host/user.

type PreflightCheck

type PreflightCheck = llm.PreflightCheck

PreflightCheck is one readiness check row.

type PreflightOptions

type PreflightOptions = llm.PreflightOptions

PreflightOptions configures a readiness check.

type PreflightReport

type PreflightReport = llm.PreflightReport

PreflightReport is the host-facing preflight result.

type Provider

type Provider = llm.Provider

Provider is the full host port (composition of role interfaces in llm).

type ProviderStateSecurity

type ProviderStateSecurity = llm.ProviderStateSecurity

ProviderStateSecurity reports provider.json security posture (no secrets).

type Requirements

type Requirements = llm.Requirements

Requirements describes capabilities that a resolved model must support.

type Route

type Route = llm.ResolvedRoute

Route is the concrete model/deployment decision made by Eyrie.

type Selection

type Selection = llm.Selection

Selection is the effective provider/model state supplied to a host session.

type SelectionOptions

type SelectionOptions = llm.SelectionOptions

SelectionOptions contains optional user or command-line overrides.

type SelectionRequest

type SelectionRequest struct {
	Requirements Requirements
	Preference   Preference
}

SelectionRequest asks Eyrie to resolve a concrete provider/model route.

type StatePaths

type StatePaths = llm.StatePaths

StatePaths reports the Engine's host-owned state locations without reading or parsing either file.

type Stream

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

Stream is a normalized, pull-based event stream. Next must not be called concurrently. Close is idempotent and may be called from another goroutine.

func (*Stream) Close

func (s *Stream) Close() error

Close cancels generation and releases provider resources.

func (*Stream) Err

func (s *Stream) Err() error

Err returns the terminal stream error, if any.

func (*Stream) Event

func (s *Stream) Event() Event

Event returns the most recent event produced by Next.

func (*Stream) Next

func (s *Stream) Next() bool

Next advances to the next event.

type Tool

type Tool = llm.EyrieTool

Tool is a model-visible tool definition. Eyrie emits requests for these tools; the host remains responsible for permission checks and execution.

type ToolCall

type ToolCall = llm.ToolCall

ToolCall is a normalized tool invocation.

func ParseInlineToolCalls

func ParseInlineToolCalls(content string) (string, []ToolCall)

ParseInlineToolCalls normalizes provider text-embedded tool calls into the stable engine contract. Providers that emit structured tool calls bypass this fallback.

type ToolChoice

type ToolChoice = llm.ToolChoiceOption

ToolChoice controls whether and how the model may request tools.

type ToolResult

type ToolResult = llm.ToolResult

ToolResult is a host-executed tool result sent back to a model.

type TranscribeRequest added in v0.6.0

type TranscribeRequest struct {
	MediaOptions
	Audio    []byte
	FileName string
	Model    string
	Language string // optional ISO-639-1
	Prompt   string // optional context/hint
}

TranscribeRequest is the host-facing request for audio transcription.

type Usage

type Usage = llm.EyrieUsage

Usage is normalized token accounting.

Jump to

Keyboard shortcuts

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