Documentation
¶
Index ¶
- Variables
- type AccountingStore
- type Authenticator
- type AuthenticatorFunc
- type Authorizer
- type CatalogSource
- type Clock
- type CounterStore
- type Dependencies
- type DisabledResponseCache
- type DiscardTelemetrySink
- type Engine
- func (e *Engine) Authorize(ctx context.Context, principal contract.Principal, publicModel string) error
- func (e *Engine) Drain(ctx context.Context) error
- func (e *Engine) Handler(options HTTPOptions) (http.Handler, error)
- func (e *Engine) Invoke(ctx context.Context, principal contract.Principal, request contract.Request) (contract.Response, error)
- func (e *Engine) Reload(ctx context.Context) error
- func (e *Engine) Snapshot() (*catalog.Snapshot, error)
- func (e *Engine) Status() Status
- func (e *Engine) Stream(ctx context.Context, principal contract.Principal, request contract.Request) (EventStream, error)
- type EventStream
- type GatewayStream
- type HTTPOptions
- type Options
- type ResponseCache
- type SecretResolver
- type Selector
- type Status
- type SystemClock
- type TelemetryEvent
- type TelemetrySink
- type Timer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AccountingStore ¶
type Authenticator ¶
type AuthenticatorFunc ¶
func (AuthenticatorFunc) Authenticate ¶
type Authorizer ¶
type CatalogSource ¶
type CounterStore ¶
type Dependencies ¶
type Dependencies struct {
Catalog CatalogSource
Secrets SecretResolver
Adapters *adapter.Registry
Authorizer Authorizer
Accounting AccountingStore
Counters CounterStore
Cache ResponseCache
Guardrails *guardrail.Registry
Telemetry TelemetrySink
Selector Selector
Clock Clock
}
type DisabledResponseCache ¶
type DisabledResponseCache struct{}
DisabledResponseCache is an explicit cache opt-out.
func (DisabledResponseCache) Delete ¶
func (DisabledResponseCache) Delete(context.Context, string) error
type DiscardTelemetrySink ¶
type DiscardTelemetrySink struct{}
DiscardTelemetrySink is an explicit opt-out for hosts that do not emit gateway telemetry.
func (DiscardTelemetrySink) Record ¶
func (DiscardTelemetrySink) Record(context.Context, TelemetryEvent)
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) Authorize ¶
func (e *Engine) Authorize(ctx context.Context, principal contract.Principal, publicModel string) error
Authorize evaluates model visibility through the same host policy used by invocation. Protocol handlers use it for discovery without duplicating ACLs.
func (*Engine) Handler ¶
func (e *Engine) Handler(options HTTPOptions) (http.Handler, error)
Handler exposes the engine's supported OpenAI-compatible HTTP routes.
type EventStream ¶
type EventStream = contract.EventStream
type GatewayStream ¶
type GatewayStream struct {
// contains filtered or unexported fields
}
func (*GatewayStream) Next ¶
func (s *GatewayStream) Next(ctx context.Context) (contract.StreamEvent, error)
Next hands the first validated event to the caller and irrevocably commits this stream to its selected deployment. Provider switching is impossible after this method returns an event.
type HTTPOptions ¶
type HTTPOptions struct {
Authenticator Authenticator
Protocol openai.Options
}
HTTPOptions configures the strict OpenAI-compatible HTTP surface. The authenticator is supplied here so hosts that invoke the engine directly do not need to configure an unused HTTP authentication path.
type ResponseCache ¶
type SecretResolver ¶
type Status ¶
type Status struct {
Ready bool `json:"ready"`
Draining bool `json:"draining"`
Degraded bool `json:"degraded"`
Revision uint64 `json:"revision"`
RejectedRevision uint64 `json:"rejected_revision,omitempty"`
ReloadStage string `json:"reload_stage,omitempty"`
}
Status is a redacted, point-in-time view of engine lifecycle and catalog readiness. Failure stages are stable categories and never contain host or provider error text.
type SystemClock ¶
type SystemClock struct{}
SystemClock is the production wall clock implementation.
func (SystemClock) Now ¶
func (SystemClock) Now() time.Time
type TelemetryEvent ¶
type TelemetrySink ¶
type TelemetrySink interface {
Record(context.Context, TelemetryEvent)
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
openaicompat
Package openaicompat implements a strict OpenAI-compatible upstream adapter.
|
Package openaicompat implements a strict OpenAI-compatible upstream adapter. |
|
examples
|
|
|
basic
command
|
|
|
internal
|
|
|
protocol
|
|