Versions in this module Expand all Collapse all v1 v1.4.0 Oct 20, 2026 Changes in this version + var ErrBudgetExhausted = errors.New("task budget exhausted: new consumption stopped") + var ErrModelDenied = errors.New("model is not allowed by tenant policy") + var ErrNoProviderExecution = errors.New("model provider has no execution endpoint configured") + type BeginInput struct + AgentVersionRef string + AttemptID uuid.UUID + EstimatedInputTokens int64 + FencingToken int64 + IdempotencyKey string + MaxOutputTokens int64 + ModelRef string + RunID uuid.UUID + TaskID uuid.UUID + TenantID string + type BeginResult struct + Call store.ModelCall + DenyReasons []string + Descriptor store.ModelDescriptor + EffectiveMaxOutputTokens int64 + PolicyRevision string + type FinishInput struct + ExpectedVersion int64 + FinishReason string + InputTokens int64 + ModelCallID uuid.UUID + OutputTokens int64 + ProviderName string + ProviderRequestID string + Status store.ModelCallStatus + TenantID string + UsageCertainty store.ModelUsageCertainty + WireModel string + type Gateway struct + func NewGateway(policyChecker PolicyChecker, models ModelStore, budget store.BudgetStore, ...) *Gateway + func (g *Gateway) Begin(ctx context.Context, in BeginInput) (BeginResult, error) + func (g *Gateway) Finish(ctx context.Context, call store.ModelCall, in FinishInput) (store.ModelCall, error) + func (g *Gateway) GetModelCall(ctx context.Context, tenantID string, callID uuid.UUID) (store.ModelCall, error) + func (g *Gateway) Settle(ctx context.Context, call store.ModelCall, sequence int64, usage Usage) error + type InvokeInput struct + AgentVersionRef string + AttemptID uuid.UUID + FencingToken int64 + IdempotencyKey string + MaxOutputTokens int32 + Messages []provider.Message + ModelRef string + RunID uuid.UUID + Stream bool + TaskID uuid.UUID + Temperature *float64 + TenantID string + Tools []provider.ToolDefinition + type InvokeOutput struct + Call store.ModelCall + Content string + ToolCalls []provider.ToolCall + type Invoker struct + func NewInvoker(gateway *Gateway, providers *provider.Registry) *Invoker + func (inv *Invoker) Invoke(ctx context.Context, in InvokeInput) (InvokeOutput, error) + func (inv *Invoker) InvokeStream(ctx context.Context, in InvokeInput, onDelta func(string)) (InvokeOutput, error) + type ModelStore interface + CreateModelCall func(context.Context, store.CreateModelCallInput) (store.CreateModelCallResult, error) + FinishModelCall func(context.Context, store.FinishModelCallInput) (store.ModelCall, error) + GetModelCall func(context.Context, string, uuid.UUID) (store.ModelCall, error) + GetModelDescriptor func(context.Context, string, string, string) (store.ModelDescriptor, error) + type PolicyChecker interface + EvaluateModel func(context.Context, string, policy.ModelContext) policy.Decision + type ReceiptStore interface + WriteRuntimeReceipt func(context.Context, store.WriteRuntimeReceiptInput) error + type Usage struct + InputTokens int64 + OutputTokens int64