trajectory

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package trajectory defines the experimental canonical working memory used by heterogeneous fast and slow model continuations.

The trajectory is deliberately independent of any provider wire format. Provider adapters compile immutable trajectory prefixes into their native chat format and may retain opaque, provider-authenticated continuation state (for example, encrypted thought signatures) without exposing it to clients.

Index

Constants

This section is empty.

Variables

View Source
var ErrVersionConflict = errors.New("trajectory version conflict")

ErrVersionConflict means a writer tried to publish work derived from a trajectory prefix that is no longer current. Callers must rebuild from the new prefix; silently appending stale model output would violate causal continuity.

Functions

func AssistantHeard

func AssistantHeard(snapshot Snapshot) map[string]spoken.Mark

AssistantHeard resolves, for each assistant item, which of its words the user actually received.

Only items with an explicit boundary appear. Absence is not "nothing was heard": a text-only binding, an upstream provider, and every trajectory written before boundaries existed all deliver content nobody measured, and a caller must fall back to the item's own text there rather than to silence.

Later transitions win, because that is what append-only means here and because the last word on how much was heard belongs to the client: the server knows what it sent, and only the client knows where playback stopped.

func AssistantVisibility

func AssistantVisibility(snapshot Snapshot) map[string]Visibility

AssistantVisibility resolves append-only assistant-state transitions in a snapshot. It is used by provider compilers so content cancelled before playback does not reappear as conversational history.

func BatchIntroducesPendingRepair

func BatchIntroducesPendingRepair(items []Item) bool

BatchIntroducesPendingRepair reports whether repair events in one safe-point batch leave a newly required repair unresolved. It is used to select a slow-only continuation without inspecting assistant or transcript text.

func CancelledAssistantInvocations

func CancelledAssistantInvocations(snapshot Snapshot) map[string]struct{}

CancelledAssistantInvocations returns invocations whose visible assistant content was later cancelled. Provider-native state for these invocations must not be replayed because it can contain the cancelled text.

func Continues

func Continues(earlier, later Item) bool

Continues reports that later is earlier said further.

func PartlyHeardAssistantInvocations

func PartlyHeardAssistantInvocations(snapshot Snapshot) map[string]struct{}

PartlyHeardAssistantInvocations returns invocations whose assistant content the user heard only part of.

A provider that retains its own native message for an invocation replays that message verbatim, and the native message is the whole turn - every word, including the ones playback never reached. Replaying it undoes the projection that made the turn honest, so these invocations fall back to the portable projection exactly as cancelled ones do. The difference is only in why: a cancelled turn is content nobody heard at all, and this is content somebody heard some of, which is the harder case and the one worth being careful about.

func PromotedToolProposalIDs

func PromotedToolProposalIDs(snapshot Snapshot) map[string]struct{}

PromotedToolProposalIDs returns proposal item IDs that have either an exact promotion or a valid, causally linked schema-normalized promotion in the same invocation scope.

Provider call IDs are not globally unique: many providers reuse values such as "call_0" for each invocation. Invocation, source revision, name, canonical arguments, and the causal proposal edge are consequently all part of the match. Similar, rejected, and unresolved proposals are not hidden.

func ResolveObservationSupersession

func ResolveObservationSupersession(prefix []Item, item Item) (int, error)

ResolveObservationSupersession returns the exact canonical-prefix item an observation replaces, or -1 when the observation declares no replacement. It is the single supersession-edge resolver used by both Store admission and read-only projections: consumers must not independently approximate stream identity, revision ordering, or causal linkage when deciding that prior user input may be hidden.

The prefix must contain only items preceding item. An error means the claimed edge is not canonical and must not be used to rewrite a projection.

func SaidFurther

func SaidFurther(earlier, later string) bool

SaidFurther reports that later is earlier carried on: the same words, and then more of them. It is the text-level half of Continues, separate because a recogniser's pieces are compared before they are ever items.

func SpokenWords

func SpokenWords(text string) []string

SpokenWords lowercases and drops punctuation, because a recogniser re-punctuates what it has already given you between one commit and the next: "a warm afternoon and I was walking" becomes "a warm afternoon. And I was walking" and back again, and compared as text neither is a prefix of the other.

func TerminalToolProposalIDs

func TerminalToolProposalIDs(snapshot Snapshot) (
	proposalIDs map[string]struct{}, dispositionItemIDs map[string]struct{},
)

TerminalToolProposalIDs returns the proposal item IDs made terminal by a valid ToolProposalDisposition and the item IDs of the dispositions that establish that status.

Terminality is intentionally derived only from a complete, valid ordering of the supplied items. The helper replays the items through the canonical Store validator before trusting any disposition. If the slice contains a malformed item, a forward or missing causal edge, a duplicate identity, or contradictory promotion/disposition evidence, both returned sets are empty. This fail-closed rule matters for provider adapters: an arbitrary snapshot must never make a pending proposal look terminal merely because it contains disposition-shaped data.

Snapshot shape is part of the evidence: a version that does not equal the item count also fails closed. Neither the snapshot nor its nested payloads are mutated.

func ToolCallArgumentsDigest

func ToolCallArgumentsDigest(arguments json.RawMessage) string

ToolCallArgumentsDigest binds a derivation to the exact argument bytes in a proposal or effective call. It deliberately does not canonicalize JSON: byte identity is part of the immutable trajectory contract.

func VerifyPrefix

func VerifyPrefix(snapshot Snapshot, identity PrefixIdentity) error

VerifyPrefix proves that identity names the exact prefix embedded in snapshot. A later snapshot is accepted only when its first identity.Version items still produce the same digest.

Types

type AssistantState

type AssistantState struct {
	AssistantItemID string     `json:"assistant_item_id"`
	Visibility      Visibility `json:"visibility"`
	PlayedAudioMS   uint64     `json:"played_audio_ms,omitempty"`
	// Heard is which of this item's words the user actually received.
	//
	// PlayedAudioMS beside it says how long the agent was audible, which is
	// what a repair policy needs and is not what a provider projection needs.
	// A duration cannot say where in the sentence the audio stopped, so a
	// projection built from it alone has two options and both are wrong: show
	// the whole turn, and the agent believes it said words nobody heard; show
	// none of it, and it says the heard half again. This is the third option,
	// and it is a fact rather than an inference.
	//
	// A pointer because most transitions have no boundary to report - queueing
	// is not playing - and because the log's existing entries must decode
	// unchanged.
	Heard *spoken.Mark `json:"heard,omitempty"`
}

AssistantState appends a visibility transition for prior assistant content.

type Authority

type Authority string

Authority separates what an item may *do* from what it merely *says*.

Speech attributed to the human participant carries user authority. Content that an observer extracted from the environment — narrated screen text, a camera description, a sensor reading — carries observer authority and is data forever: it can be reasoned about, but it can never be promoted to an instruction, and no tool call may cite it as its own justification. This is the structural defence against prompt injection through observed content.

const (
	// AuthorityUser marks speech or text attributed to the human participant.
	AuthorityUser Authority = "user"
	// AuthorityObserver marks environment content extracted by an observer.
	AuthorityObserver Authority = "observer"
	// AuthoritySystem marks runtime-authored content such as instructions.
	AuthoritySystem Authority = "system"
)

func AuthorityOf

func AuthorityOf(item Item) Authority

AuthorityOf resolves the authority an item carries. Only observations can carry observer authority; everything else is attributed by producer phase.

type EventMetadata

type EventMetadata struct {
	EventID            string `json:"event_id"`
	Type               string `json:"type"`
	Source             string `json:"source"`
	Channel            string `json:"channel"`
	OccurredNS         uint64 `json:"occurred_ns"`
	CorrelationID      string `json:"correlation_id,omitempty"`
	SupersedesRevision uint64 `json:"supersedes_revision,omitempty"`
	// BatchID, BatchIndex, and BatchSize mark items committed together at one
	// safe point. A model handed four events attends to the last one unless the
	// group is legible as a group, so the marker is part of the log rather than
	// a rendering convention: every compiler sees the same boundary.
	BatchID    string `json:"batch_id,omitempty"`
	BatchIndex int    `json:"batch_index,omitempty"`
	BatchSize  int    `json:"batch_size,omitempty"`
}

EventMetadata preserves where and when an externally produced event occurred. MonotonicNS on Item remains canonical commit time; OccurredNS is source time and may precede it while an event waits for a safe point. Routing priority is intentionally absent: it is runtime control metadata, not model-visible conversation content.

type Item

type Item struct {
	ID                      string                   `json:"id"`
	Kind                    Kind                     `json:"kind"`
	MonotonicNS             uint64                   `json:"monotonic_ns"`
	CausalParentIDs         []string                 `json:"causal_parent_ids,omitempty"`
	SourceRevision          uint64                   `json:"source_revision,omitempty"`
	InvocationID            string                   `json:"invocation_id,omitempty"`
	Producer                Producer                 `json:"producer"`
	Content                 string                   `json:"content,omitempty"`
	Interrupted             bool                     `json:"interrupted,omitempty"`
	Visibility              Visibility               `json:"visibility,omitempty"`
	ToolCall                *ToolCall                `json:"tool_call,omitempty"`
	ToolCallDerivation      *ToolCallDerivation      `json:"tool_call_derivation,omitempty"`
	ToolProposalDisposition *ToolProposalDisposition `json:"tool_proposal_disposition,omitempty"`
	ToolResult              *ToolResult              `json:"tool_result,omitempty"`
	ToolPlaceholder         *ToolPlaceholder         `json:"tool_placeholder,omitempty"`
	Observation             *ObservationMeta         `json:"observation,omitempty"`
	AssistantState          *AssistantState          `json:"assistant_state,omitempty"`
	Repair                  *RepairState             `json:"repair,omitempty"`
	Event                   *EventMetadata           `json:"event,omitempty"`
	ProviderStateType       string                   `json:"provider_state_type,omitempty"`
	ProviderState           json.RawMessage          `json:"provider_state,omitempty"`
}

Item is an immutable unit in the canonical trajectory.

ProviderState is optional opaque JSON used only when the provider can resume its own authenticated reasoning representation. It is not emitted on the OpenAI Realtime wire boundary and should be omitted from public evidence by default. ProviderStateType prevents one adapter from interpreting another provider's state as native.

func WithoutSupersededPartials

func WithoutSupersededPartials(items []Item) []Item

WithoutSupersededPartials drops an utterance that a later one continues.

A recogniser commits its stable text as it goes, so one sentence reaches the trajectory several times, each version a little longer than the last. That is what the trajectory is for: every version was really committed, and adoption and repair are decided against them.

It is not what a conversation looks like. Rendered as messages, somebody who mentioned a capybara once appears to have mentioned it three times, and a model asked to count the animals answers three - correctly, for the conversation it was shown. Measured on an afternoon with two animals in it, the counts came back "3 4".

Only consecutive items, only from the same authority, and only where the earlier is a word-prefix of the later, which is what "the same sentence, further along" means and what nothing else looks like.

type ItemError

type ItemError struct {
	Index int
	ID    string
	Kind  Kind
	Err   error
}

ItemError names which item of a batch the store refused, and why.

The index is what makes the refusal actionable rather than fatal. A batch is a group of things that happened, not a proposition: one event being inadmissible - a visibility transition that a concurrent path already made, a supersession whose target is gone - says nothing about the others, and a caller that could only see "the batch failed" had no choice but to drop every event in it, including the ones the log would have accepted.

func (*ItemError) Error

func (failure *ItemError) Error() string

func (*ItemError) Unwrap

func (failure *ItemError) Unwrap() error

type Kind

type Kind string

Kind identifies the semantic role of an immutable trajectory item.

const (
	KindInstruction    Kind = "instruction"
	KindObservation    Kind = "observation"
	KindReasoning      Kind = "reasoning"
	KindAssistant      Kind = "assistant"
	KindAssistantState Kind = "assistant_state"
	// KindRepair records a typed obligation created when later canonical
	// evidence invalidates assistant audio that was already heard, and its
	// eventual resolution by a later committed assistant item.
	KindRepair Kind = "repair"
	// KindToolProposal is structured model working state without execution
	// authority. It lets a fast continuation express which capability it needs
	// without creating a side effect or satisfying a later ToolResult.
	KindToolProposal Kind = "tool_proposal"
	// KindToolProposalDisposition is an append-only runtime decision that makes
	// one earlier proposal terminal without promoting it into an executable
	// call. The proposal remains the sole source of its arguments; disposition
	// payloads carry only exact identity and a closed reason.
	KindToolProposalDisposition Kind = "tool_proposal_disposition"
	KindToolCall                Kind = "tool_call"
	KindToolResult              Kind = "tool_result"
	// KindToolPlaceholder marks an executable call that was in flight when the
	// trajectory was interrupted. Its eventual result supersedes it, so an
	// interrupted prefix stays well-formed instead of trailing off.
	KindToolPlaceholder Kind = "tool_placeholder"
)

type MatchedToolResult

type MatchedToolResult struct {
	Pending PendingToolCall
	Result  ToolResult
}

MatchedToolResult pairs a result with its authoritative pending call. The returned slice always follows canonical call order, independent of result arrival order.

func MatchToolResultBatch

func MatchToolResultBatch(snapshot Snapshot, invocationID string, results []ToolResult) ([]MatchedToolResult, error)

MatchToolResultBatch validates the synchronization contract for one slow invocation: every currently pending call must receive exactly one identity-matched terminal result in the same event. It does not mutate the trajectory; a caller still commits all returned pairs atomically.

type MediaRef

type MediaRef struct {
	Handle   string `json:"handle"`
	MIMEType string `json:"mime_type"`
	Source   string `json:"source,omitempty"`
	Width    int    `json:"width,omitempty"`
	Height   int    `json:"height,omitempty"`
	Bytes    int    `json:"bytes,omitempty"`
	// CapturedNS is source time, matching EventMetadata.OccurredNS semantics.
	CapturedNS uint64 `json:"captured_ns,omitempty"`
}

MediaRef is a handle to media retained outside the trajectory.

The trajectory is copied in full for every continuation request, so it never inlines bytes. An observer commits persistent text and attaches handles; a provider adapter that can use media resolves the handle through a Store supplied by the runtime, and one that cannot ignores it. Retention is bounded: a handle may resolve to nothing once its window has passed, and a dangling handle is a normal state rather than an error.

type ObservationMeta

type ObservationMeta struct {
	Observer  string     `json:"observer"`
	Source    string     `json:"source,omitempty"`
	Authority Authority  `json:"authority"`
	Media     []MediaRef `json:"media,omitempty"`
}

ObservationMeta records which observer produced an observation and what it was looking at. Its presence is what distinguishes environment content from participant speech; absence means the observation carries user authority, which is the pre-existing behaviour of the audio path.

type PendingRepair

type PendingRepair struct {
	TargetAssistantItemID string
	RequiredItemID        string
	PlayedAudioMS         uint64
}

func PendingRepairs

func PendingRepairs(snapshot Snapshot) []PendingRepair

PendingRepairs resolves the append-only repair lifecycle in canonical order.

One entry per target, always. The order was recorded whenever a target became pending rather than the first time it was ever seen, so an item cut off, corrected, and cut off again - an ordinary thing in a long call - appeared twice, and a caller that turns each entry into a resolving item built a batch resolving the same repair twice. The second is rejected, the batch is refused whole, and the obligation never clears.

type PendingToolCall

type PendingToolCall struct {
	ItemID         string
	SourceRevision uint64
	InvocationID   string
	Call           ToolCall
}

PendingToolCall is one executable call that has no terminal result in the supplied trajectory prefix.

func UnresolvedToolCalls

func UnresolvedToolCalls(snapshot Snapshot) []PendingToolCall

UnresolvedToolCalls returns executable calls in the prefix that have neither a terminal result nor a placeholder. These are the calls a runtime must either await or explicitly place a placeholder for before it stops.

type Phase

type Phase string

Phase identifies the continuation profile that produced an item.

const (
	PhaseRuntime Phase = "runtime"
	PhaseFast    Phase = "fast"
	PhaseSlow    Phase = "slow"
	PhaseTool    Phase = "tool"
	PhaseUser    Phase = "user"
)
const PhaseObserver Phase = "observer"

PhaseObserver produces observations from the environment rather than from the human participant. It is distinct from PhaseUser precisely so authority is decidable from provenance alone.

type PrefixIdentity

type PrefixIdentity struct {
	Version uint64 `json:"version"`
	Digest  string `json:"digest"`
}

PrefixIdentity names one immutable prefix without carrying its items. The digest is a domain-separated chain over encoding/json's deterministic encoding of each exact Item value through Version, including opaque JSON bytes. It is an OpenRealtime identity format, not an RFC canonical-JSON claim.

func IdentifyPrefix

func IdentifyPrefix(snapshot Snapshot, version uint64) (PrefixIdentity, error)

IdentifyPrefix derives the identity of snapshot.Items[:version]. Snapshot must itself be a complete, internally consistent prefix.

type Producer

type Producer struct {
	Phase           Phase  `json:"phase"`
	Provider        string `json:"provider,omitempty"`
	Model           string `json:"model,omitempty"`
	ReasoningEffort string `json:"reasoning_effort,omitempty"`
	SpeechAuthority string `json:"speech_authority,omitempty"`
}

Producer describes the model or runtime phase that produced an item. It is provenance supplied by the runtime, never a claim generated by a model.

SpeechAuthority records whether the producing provider was permitted to be heard. It is written here, at the point output commits, so the action plane can decide what may be voiced from the log alone rather than from a configuration it would have to be handed separately. An empty value means the item predates the distinction or was produced by the runtime itself.

type RepairState

type RepairState struct {
	TargetAssistantItemID string       `json:"target_assistant_item_id"`
	Status                RepairStatus `json:"status"`
	RepairAssistantItemID string       `json:"repair_assistant_item_id,omitempty"`
	PlayedAudioMS         uint64       `json:"played_audio_ms,omitempty"`
}

RepairState is runtime-authored lifecycle data. Required repairs target an already-played assistant item. Resolution names the later committed assistant item that explicitly carries the correction.

type RepairStatus

type RepairStatus string
const (
	RepairRequired RepairStatus = "required"
	RepairResolved RepairStatus = "resolved"
)

type Snapshot

type Snapshot struct {
	Version uint64 `json:"version"`
	Items   []Item `json:"items"`
}

Snapshot is an immutable copy of a trajectory prefix. Version is the number of items in the store when the snapshot was taken.

func Prefix

func Prefix(snapshot Snapshot, identity PrefixIdentity) (Snapshot, error)

Prefix verifies identity and returns a defensive copy of exactly the named immutable prefix.

func (Snapshot) InspectionCause

func (Snapshot) InspectionCause() element.InspectionCauseKind

InspectionCause classifies the immutable prefix identity only; no item or model-visible content enters inspection evidence.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a concurrency-safe append-only canonical trajectory.

func NewStore

func NewStore() *Store

NewStore creates an empty trajectory.

func (*Store) Append

func (store *Store) Append(item Item) error

Append atomically appends one item after validating the complete trajectory invariants.

func (*Store) AppendBatch

func (store *Store) AppendBatch(items []Item) error

AppendBatch validates and appends every item or appends none. Parents may refer to earlier items in the same batch, which makes a completed model turn publishable as one safe-point transaction.

func (*Store) AppendBatchAfter

func (store *Store) AppendBatchAfter(baseVersion uint64, supersedes func(Item) bool, items []Item) error

AppendBatchAfter atomically checks that nothing that matters has been appended since baseVersion and appends the batch.

It exists because "the version moved" and "what I reasoned from is no longer true" are different statements, and only the second is a reason to throw work away. A version check cannot tell them apart: it refuses a reasoner's tool call because the voice said "one moment" in the meantime, which changed nothing the reasoner relied on.

The caller supplies supersedes, because only the caller knows what its output depended on. The store knows what arrived. The predicate runs under the store lock and must not call back into the store or mutate the item.

func (*Store) AppendBatchAt

func (store *Store) AppendBatchAt(expectedVersion uint64, items []Item) error

AppendBatchAt atomically appends every item only when the store is still at expectedVersion. It is the safe-point commit primitive for asynchronous producers: providers may compute concurrently from immutable snapshots, but only output derived from the current prefix can enter the canonical log.

func (*Store) AppendBatchOnPrefix

func (store *Store) AppendBatchOnPrefix(prefix PrefixIdentity, items []Item) error

AppendBatchOnPrefix records history derived from an exact immutable prefix, even when later records have arrived. This proves provenance, not freshness or authority to perform a new effect. Callers must keep stale proposals out of this path. Canonical commit timestamps advance to the insertion boundary; the original source prefix and causal parents remain unchanged.

func (*Store) Prefix

func (store *Store) Prefix(version uint64) (Snapshot, error)

Prefix returns a deep copy ending before version. Version zero is the empty prefix; Version must not exceed the current number of items.

func (*Store) Snapshot

func (store *Store) Snapshot() Snapshot

Snapshot returns a deep copy of the complete current trajectory.

func (*Store) SnapshotWithPrefixIdentity

func (store *Store) SnapshotWithPrefixIdentity() (Snapshot, PrefixIdentity, error)

SnapshotWithPrefixIdentity returns one defensive snapshot together with an identity accumulated by the Store. The first call enables prefix tracking; if the Store is already populated, that call identifies the existing prefix once. Later appends encode and link each new item exactly once, while callers that never request identities pay no digest-maintenance cost.

type ToolCall

type ToolCall struct {
	CallID    string          `json:"call_id"`
	Name      string          `json:"name"`
	Arguments json.RawMessage `json:"arguments"`
}

ToolCall is a complete, validated request. Arguments must be one JSON object.

type ToolCallArgumentRewrite

type ToolCallArgumentRewrite struct {
	Argument   string `json:"argument"`
	Normalizer string `json:"normalizer"`
}

ToolCallArgumentRewrite names every direct argument transformation covered by a derivation. It is retained in sorted order so traces can explain what changed without exposing the argument value itself.

type ToolCallDerivation

type ToolCallDerivation struct {
	Kind                     ToolCallDerivationKind    `json:"kind"`
	SourceArgumentsDigest    string                    `json:"source_arguments_digest"`
	EffectiveArgumentsDigest string                    `json:"effective_arguments_digest"`
	RegistryReference        string                    `json:"registry_reference"`
	RegistryDigest           string                    `json:"registry_digest"`
	DeclarationDigest        string                    `json:"declaration_digest"`
	Rewrites                 []ToolCallArgumentRewrite `json:"rewrites"`
}

ToolCallDerivation is runtime-authored evidence for the exceptional case in which an executable tool call is deterministically derived from, rather than byte-identical to, its causally linked model proposal. The trajectory recognizes only explicitly versioned derivations and verifies the exact source and effective argument bytes before admitting the call.

type ToolCallDerivationKind

type ToolCallDerivationKind string

ToolCallDerivationKind identifies one closed, versioned derivation contract. New kinds require an explicit trajectory validator; arbitrary labels can never authorize changes to a canonical model proposal.

const (
	// ToolCallDerivationSchemaNormalizationV1 records that a deployment-owned
	// schema normalization element derived the effective arguments under the
	// immutable registry and declaration named by the accompanying digests.
	ToolCallDerivationSchemaNormalizationV1 ToolCallDerivationKind = "schema-normalization-v1"
)

type ToolPlaceholder

type ToolPlaceholder struct {
	CallID string `json:"call_id"`
	Name   string `json:"name"`
	// Reason is runtime-authored provenance such as "interrupted" or
	// "cancelled". It is never model-authored workflow state.
	Reason string `json:"reason"`
}

ToolPlaceholder marks an executable call that was in flight when the trajectory was interrupted.

It exists so an interrupted prefix is well-formed rather than dangling: a reader sees "this call was issued, the runtime stopped waiting, the result may still arrive" instead of a call that simply trails off. The eventual result supersedes it; a placeholder is never a terminal outcome and never satisfies the call.

type ToolProposalDisposition

type ToolProposalDisposition struct {
	ProposalItemID string                      `json:"proposal_item_id"`
	CallID         string                      `json:"call_id"`
	Name           string                      `json:"name"`
	Kind           ToolProposalDispositionKind `json:"kind"`
}

ToolProposalDisposition makes one earlier non-executable proposal terminal. It deliberately carries no arguments: the causally linked proposal remains the canonical model output, while this runtime-authored item records only why that proposal did not acquire execution authority.

type ToolProposalDispositionKind

type ToolProposalDispositionKind string

ToolProposalDispositionKind is closed so arbitrary runtime text cannot be reinterpreted as authority or as evidence that an action did not occur.

const (
	ToolProposalToolPolicySuppressed ToolProposalDispositionKind = "tool_policy_suppressed"
	ToolProposalRepetitionSuppressed ToolProposalDispositionKind = "repetition_suppressed"
)

type ToolResult

type ToolResult struct {
	CallID string          `json:"call_id"`
	Name   string          `json:"name"`
	Output json.RawMessage `json:"output,omitempty"`
	Error  string          `json:"error,omitempty"`
}

ToolResult is the terminal outcome of a prior ToolCall. Exactly one of Output and Error must be present. Output may be any valid JSON value.

type Visibility

type Visibility string

Visibility records how far assistant content crossed the speech commit boundary. State transitions are appended as KindAssistantState items rather than mutating the original assistant item.

const (
	VisibilityPrepared  Visibility = "prepared"
	VisibilityQueued    Visibility = "queued"
	VisibilityPlayed    Visibility = "played"
	VisibilityCancelled Visibility = "cancelled"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL