Documentation
¶
Overview ¶
Package fake provides an in-memory adapter for tests: it exercises the gateway end to end without spawning a CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// AdapterID namespaces the models; defaults to "fake".
AdapterID string
// Variants are the model variants to advertise.
Variants []string
// Reply is returned as the assistant's text, split into a few deltas.
Reply string
// Thinking, when set, is emitted as reasoning deltas.
Thinking string
// Fail, when set, is emitted instead of a completion.
Fail *ir.Error
// ProbeErr is returned by Probe.
ProbeErr error
// FirstTokenDelay is slept after the start event and before any text, as a
// backend that is thinking does.
FirstTokenDelay time.Duration
// Delay is slept after the text and before the terminal event, to exercise
// cancellation and streaming keepalives.
Delay time.Duration
// Silent, when set, closes the event channel without a terminal event, as a
// CLI that dies mid-run does.
Silent bool
// Usage, when set, is reported on the done event.
Usage *ir.Usage
// Schema, when set, makes the adapter report that it can hold an answer to
// a JSON Schema, so a frontend accepts one instead of refusing it.
Schema bool
// Efforts, when set, are the reasoning-effort levels this backend claims.
Efforts []ir.Effort
// Requests records what the gateway asked for.
Requests []ir.Request
}
Adapter is a scripted adapter.Adapter.
func (*Adapter) EffortLevels ¶ added in v0.1.5
EffortLevels implements adapter.EffortSetter.
func (*Adapter) EnforcesSchema ¶ added in v0.1.3
EnforcesSchema implements adapter.SchemaEnforcer.