Documentation
¶
Overview ¶
Package chatruntime runs hosted chat using explicit models, persistence, capability dispatch, and an isolated JavaScript executor. It has no dependency on the SDK root or an Airlock server.
Index ¶
- func RenderPrompt(instructions string, catalog []capability.Definition, direct bool) (string, error)
- func RenderTypeScript(catalog []capability.Definition) (string, error)
- func Run(ctx context.Context, in Input) (result *sol.RunResult, err error)
- type Backend
- type ExecutorFactory
- type Input
- type Invocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderPrompt ¶
func RenderPrompt(instructions string, catalog []capability.Definition, direct bool) (string, error)
RenderPrompt uses exactly the catalog passed to Run, without discovering or independently filtering capabilities. Instructions are host-composed text.
func RenderTypeScript ¶
func RenderTypeScript(catalog []capability.Definition) (string, error)
RenderTypeScript describes asynchronous bindings from the canonical schemas.
Types ¶
type ExecutorFactory ¶
type ExecutorFactory func(context.Context, []capability.Definition) (jsexec.Session, error)
ExecutorFactory allocates a fresh realm with exactly these authorized bindings. Each binding takes one JSON object argument matching Definition.InputSchema. The executor calls Invoker with Definition.Path.ID() and a positional array. Run calls the factory only after approval and closes the session on every exit.
type Input ¶
type Input struct {
Message string
Instructions string
Model stream.Model
ModelLimits session.ModelLimits
SessionStore session.SessionStore
Capabilities []capability.Definition
Backend Backend
ExecutorFactory ExecutorFactory
Sink eventstream.Sink
MaxSteps int
Temperature *float64
DirectTools bool
AutoConfirm bool
Redactor func(string) string
ForceCompact bool
// Resume accepts only a permission checkpoint produced by this runtime.
// Approval is required when Resume is set; false explicitly denies the call.
Resume *sol.SuspensionContext
Approved *bool
}
Input is scoped to one run. The host owns authorization, run completion, checkpoint persistence, and conversation serialization across replicas. Capabilities must be the broker-authorized subset of capability.Catalog.
type Invocation ¶
type Invocation struct {
CapabilityID string
ToolCallID string
Input json.RawMessage
}
Invocation carries canonical identity and the enclosing model tool call ID. Backend implementations bind authenticated run attribution independently of the script, authorize each call, and return redacted output and references.