Documentation
¶
Overview ¶
Package agent runs one turn. The model proposes, policy decides, and the follow-up pack goes back to the caller.
Index ¶
- Variables
- type Call
- type Completer
- type Executor
- type Loop
- func (l *Loop) Follow(ctx context.Context, operationID string, params map[string]string, ...) ([]Call, error)
- func (l *Loop) Invoke(ctx context.Context, operationID string, params map[string]string, ...) (Call, error)
- func (l *Loop) Run(ctx context.Context, userText string) (Outcome, error)
- func (l *Loop) Runtime() runtime.Runtime
- func (l *Loop) RuntimePtr() *runtime.Runtime
- func (l *Loop) SetFloor(hook policy.Hook)
- func (l *Loop) SetGate(gate *runtime.InvokeGate)
- func (l *Loop) SetInvokeLimit(n int)
- func (l *Loop) SetPolicy(hook policy.Hook)
- func (l *Loop) SetRuntime(rt *runtime.Runtime)
- func (l *Loop) WrapPolicy(around policy.Around)
- type Memory
- type Outcome
- type Request
- type Response
- type Scripted
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyPack = errors.New("empty context pack")
Functions ¶
This section is empty.
Types ¶
type Loop ¶
type Loop struct {
Catalog *catalog.Catalog
Semantics semantics.Notes
Model Completer
Policy policy.Hook
State *policy.State
Exec Executor
Notify policy.Notifier
Memory Memory
Flows map[string]*flow.Definition
Packs *runctx.Builder
JSON jsonopts.Set
Pages int
MaxBody int64
// contains filtered or unexported fields
}
The follow-up pack is returned. The model is not called again.
func (*Loop) Follow ¶
func (l *Loop) Follow(ctx context.Context, operationID string, params map[string]string, approvalID string) ([]Call, error)
Follow runs operationID through Invoke, then each declared relation or link that names a value. A link with no parameter mapping is not called. A missing response field is an error.
func (*Loop) Runtime ¶
Runtime is the invoke sequence this loop uses. Policy and state are the loop's current values. The snapshot copies exported fields. The shared runtime, including its gate lock, stays on RuntimePtr.
func (*Loop) RuntimePtr ¶ added in v0.1.8
RuntimePtr is the runtime Invoke uses. A shared runtime is that pointer.
func (*Loop) SetGate ¶ added in v0.1.6
func (l *Loop) SetGate(gate *runtime.InvokeGate)
SetGate shares one limiter with another Runtime.
func (*Loop) SetInvokeLimit ¶ added in v0.1.1
SetInvokeLimit sets calls per second per caller. Zero keeps 16.
func (*Loop) SetRuntime ¶ added in v0.1.8
SetRuntime uses rt for invoke. The loop still owns the model, memory, and context pack.
func (*Loop) WrapPolicy ¶
type Scripted ¶
type Scripted struct {
// contains filtered or unexported fields
}
func NewScripted ¶
func NewScripted() *Scripted