Versions in this module Expand all Collapse all v0 v0.1.96 Sep 22, 2026 v0.1.95 Sep 20, 2026 v0.1.94 Sep 18, 2026 v0.1.93 Sep 16, 2026 v0.1.92 Sep 15, 2026 Changes in this version + type ContentEditor interface + EditsContent func() bool v0.1.91 Sep 11, 2026 Changes in this version type Completion + func (c *Completion) SetTargetText(t TextTarget, text string) error + func (c *Completion) SetToolArguments(choice int, callID string, args json.RawMessage) error + func (c *Completion) TextTargets() []TextTarget + type Config struct + func ParseConfig(plugin string, schema []Field, raw json.RawMessage) (*Config, error) + func (c *Config) BlockStatus(key string) int + func (c *Config) Bool(key string) bool + func (c *Config) Choice(key, def string, allowed ...string) string + func (c *Config) Err() error + func (c *Config) Float(key string, def, lo, hi float64) float64 + func (c *Config) Int(key string, def, lo, hi int) int + func (c *Config) Lines(key string) []string + func (c *Config) List(key string) []string + func (c *Config) OptionalFloat(key string, lo, hi float64) *float64 + func (c *Config) Raw(key string) json.RawMessage + func (c *Config) Roles(key string, def ...Role) map[Role]bool + func (c *Config) String(key, def string) string type Decision + NoStore bool + type Enforcement struct + Action Action + BlockStatus int + Message string + RespondText string + func (e Enforcement) Enforce(code string, detail any) Decision + func (e Enforcement) Reject(code string, detail any) Decision type Field + func BlockStatusField() Field + type HealthChecker interface + Health func(ctx context.Context) error type Host + HTTPClient func() *http.Client type Input + const InputBool + const InputList type Option + func RoleOptions() []Option type Part + func (p Part) DecodeMedia() (data []byte, mediaType string, ok bool) type Prompt + func (p *Prompt) SetMedia(msgID string, partIdx int, mediaType string, data []byte) error + func (p *Prompt) SetTargetText(t TextTarget, text string) error + func (p *Prompt) TextTargets(roles ...Role) []TextTarget type StreamEvent + Call int + Final bool type StreamPolicy + MinChunkChars int + type TextTarget struct + CallID string + Choice int + MessageID string + Part int + ResultPart int + Role Role + Text string v0.1.90 Sep 8, 2026 Changes in this version + const Version + type Action string + const ActionAllow + const ActionBlock + const ActionRespond + const ActionWarn + type Attempt struct + Duration time.Duration + ErrorCode string + Kind string + Model string + Provider string + ProviderName string + Seq int + StatusCode int + Success bool + type BuildInfo struct + GoVersion string + PluginAPIVersion string + type CacheInfo struct + PlannedPrefixMessages int + SessionTarget string + type ChangeKind string + const ChangeEdited + const ChangeInserted + const ChangeRemoved + const ChangeReplaced + type Changes struct + Dirty bool + Edits int + Messages map[string]ChangeKind + Params map[string]any + type Choice struct + FinishReason string + Index int + Message Message + type CompleteHook interface + OnComplete func(ctx context.Context, x *Exchange) + type Completion struct + Choices []Choice + ID string + Model string + Raw json.RawMessage + Usage Usage + func (c *Completion) Changes() Changes + func (c *Completion) ReplaceText(choice int, text string) error + func (c *Completion) Reset() + func (c *Completion) SetFinishReason(choice int, reason string) error + func (c *Completion) SetText(choice, partIdx int, text string) error + func (c *Completion) Text(choice int) string + type DanglingToolError struct + CallID string + MessageID string + PartnerID string + func (e *DanglingToolError) Error() string + type Decision struct + Action Action + Code string + Detail any + Message string + Response *Completion + Status int + func Allow() Decision + func Block(status int, code, message string) Decision + func Respond(text string) Decision + func Warn(code, message string, detail any) Decision + func (d Decision) Blocks() bool + type EventKind string + const EventFinish + const EventOther + const EventReasoningDelta + const EventTextDelta + const EventToolCallDelta + const EventUsage + type Exchange struct + Headers *Headers + Meta Meta + Prompt *Prompt + Response *Completion + Stream *StreamState + Values Values + type Field struct + Default any + Help string + Input Input + Key string + Label string + Options []Option + Placeholder string + Required bool + Scope FieldScope + type FieldScope string + const ScopeInstance + const ScopeRoute + type Headers struct + Request http.Header + Response http.Header + Upstream http.Header + type Host interface + History func(ctx context.Context, meta Meta) ([]Message, error) + Inference func() Inference + Logger func() *slog.Logger + Metrics func() Metrics + type Inference interface + Complete func(ctx context.Context, req InferenceRequest) (*Completion, error) + type InferenceRequest struct + MaxTokens int + Messages []Message + Model string + Temperature *float64 + UserPath string + type Input string + const InputCheckboxes + const InputModel + const InputNumber + const InputSecret + const InputSelect + const InputText + const InputTextarea + type Kind string + const KindComplete + const KindPrompt + const KindRequest + const KindResponse + const KindRoute + const KindStream + type Manifest struct + BuiltWith BuildInfo + ConfigSchema []Field + Description string + Guardrail bool + Kinds []Kind + Mutates bool + Name string + Version string + type Message struct + CacheBreakpoint bool + ID string + Name string + Parts []Part + Role Role + ToolCallID string + func TextMessage(role Role, text string) Message + func (m Message) Text() string + type Meta struct + Attempts []Attempt + AuthKeyID string + Cache CacheInfo + Dialect string + Endpoint string + Features map[string]bool + Labels map[string]string + Model string + Operation string + Origin string + Provider string + ProviderName string + RequestID string + RequestedModel string + SessionID string + Stream bool + UserPath string + VirtualModelSource string + WorkflowVersionID string + type Metrics interface + Inc func(name string, labels map[string]string) + Observe func(name string, value float64, labels map[string]string) + type Option struct + Label string + Value string + type Params struct + Extra map[string]any + MaxTokens *int + Model string + Stream bool + Temperature *float64 + ToolChoice any + TopP *float64 + type Part struct + Data []byte + Kind PartKind + MediaType string + Raw json.RawMessage + Text string + ToolCall *ToolCall + ToolResult *ToolResult + URL string + type PartKind string + const PartAudio + const PartFile + const PartImage + const PartOpaque + const PartReasoning + const PartRefusal + const PartText + const PartToolCall + const PartToolResult + type Plugin interface + Close func(ctx context.Context) error + Init func(ctx context.Context, config json.RawMessage, host Host) error + Manifest func() Manifest + type Prompt struct + Messages []Message + Params Params + Raw json.RawMessage + Tools []Tool + func (p *Prompt) Append(m Message) string + func (p *Prompt) Changes() Changes + func (p *Prompt) Clone() *Prompt + func (p *Prompt) Insert(at int, m Message) string + func (p *Prompt) LastUser() *Message + func (p *Prompt) Message(id string) *Message + func (p *Prompt) NewSince(n int) []Message + func (p *Prompt) Remove(msgID string) error + func (p *Prompt) Reset() + func (p *Prompt) SetParam(name string, value any) + func (p *Prompt) SetText(msgID string, partIdx int, text string) error + func (p *Prompt) SetToolArguments(msgID, callID string, args json.RawMessage) error + func (p *Prompt) SetToolResult(msgID, callID string, parts []Part) error + func (p *Prompt) SystemText() string + func (p *Prompt) Text(roles ...Role) string + func (p *Prompt) ToolCalls() []ToolCallRef + func (p *Prompt) Validate() error + type PromptHook interface + OnPrompt func(ctx context.Context, x *Exchange) (Decision, error) + type RequestHook interface + OnRequest func(ctx context.Context, x *Exchange) (Decision, error) + type ResponseHook interface + OnResponse func(ctx context.Context, x *Exchange) (Decision, error) + type Role string + const RoleAssistant + const RoleDeveloper + const RoleSystem + const RoleTool + const RoleUser + type RouteCandidate struct + InputPerMtok *float64 + Model string + OutputPerMtok *float64 + Provider string + Qualified string + Weight float64 + type RouteChoice struct + Qualified string + Reason string + type RouteOutcome struct + Latency time.Duration + Source string + StatusCode int + Success bool + Target RouteTarget + Timeout bool + type RouteRequest struct + Candidates []RouteCandidate + Config json.RawMessage + Meta Meta + Prompt *Prompt + SessionID string + SessionTarget string + Source string + type RouteStrategy interface + OnAttemptEnd func(outcome RouteOutcome) + Select func(ctx context.Context, req RouteRequest) (RouteChoice, error) + type RouteTarget struct + Model string + Provider string + func (t RouteTarget) Qualified() string + type StreamAction string + const StreamDrop + const StreamPass + const StreamReplace + const StreamTerminate + type StreamDecision struct + Action StreamAction + Terminate *Decision + Text string + func Drop() StreamDecision + func Pass() StreamDecision + func Replace(text string) StreamDecision + func Terminate(d Decision) StreamDecision + type StreamEvent struct + Choice int + Kind EventKind + Overlap int + Raw json.RawMessage + Seq int + Text string + type StreamHook interface + OnStreamEnd func(ctx context.Context, x *Exchange) (Decision, error) + OnStreamEvent func(ctx context.Context, x *Exchange, ev *StreamEvent) (StreamDecision, error) + StreamPolicy func() StreamPolicy + type StreamMode string + const StreamBuffer + const StreamObserve + const StreamTransform + type StreamPolicy struct + LookbehindChars int + MaxBufferBytes int + Mode StreamMode + type StreamState struct + func (s *StreamState) Append(ev *StreamEvent) + func (s *StreamState) Events() int + func (s *StreamState) ReplaceTail(ev *StreamEvent, tail int, text string) + func (s *StreamState) Text(choice int) string + type Tool struct + Description string + Name string + Parameters json.RawMessage + Raw json.RawMessage + type ToolCall struct + Arguments json.RawMessage + ID string + Name string + Server string + type ToolCallRef struct + Call ToolCall + HasResult bool + MessageID string + type ToolResult struct + CallID string + IsError bool + Parts []Part + type Usage struct + CachedInputTokens int + InputTokens int + OutputTokens int + TotalTokens int + type Values map[string]any + func (v Values) Get(key string) (any, bool) + func (v Values) Set(key string, value any)