observation

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 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 observation classifies adapted model requests without retaining bodies.

Index

Constants

View Source
const ProviderKey = "sailry.observation"

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context keeps exact byte ranges outside the adapted request text.

func NewContext

func NewContext(parts []Source) *Context

func PersistedContext

func PersistedContext(text string, skills []string) Context

func (Context) MarshalJSON

func (context Context) MarshalJSON() ([]byte, error)

func (*Context) Text

func (context *Context) Text() string

func (*Context) UnmarshalJSON

func (context *Context) UnmarshalJSON(raw []byte) error

type Inventory

type Inventory struct {
	System   string
	Sources  []Source
	Contexts []Context
}

Inventory belongs to one frozen model request, never a cached provider. A nil inventory means provenance is unavailable; an empty one means known empty.

func (Inventory) MarshalJSON

func (inventory Inventory) MarshalJSON() ([]byte, error)

func (*Inventory) Options

func (*Inventory) Options()

func (*Inventory) UnmarshalJSON

func (inventory *Inventory) UnmarshalJSON(raw []byte) error

type ResponsesHistory added in v0.2.7

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

ResponsesHistory carries one receipt per recently completed session in memory. The engine serializes Start and Complete with turn claims and durable ends.

func (*ResponsesHistory) Complete added in v0.2.7

func (history *ResponsesHistory) Complete(ctx context.Context)

Complete hands off only a receipt observed by this execution. A turn with no measurable last attempt cannot forward the previous turn's receipt.

func (*ResponsesHistory) Start added in v0.2.7

type ResponsesShape added in v0.2.7

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

type ResponsesTrace added in v0.2.7

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

ResponsesTrace belongs to one execution. Only the latest receipt's keyed digests and item sizes are retained, and only comparisons enter history.

func ResponsesTraceFrom added in v0.2.7

func ResponsesTraceFrom(ctx context.Context) *ResponsesTrace

func (*ResponsesTrace) Clear added in v0.2.7

func (trace *ResponsesTrace) Clear()

func (*ResponsesTrace) Prepare added in v0.2.7

func (trace *ResponsesTrace) Prepare(raw []byte, inventory *Inventory) (Result, *ResponsesShape)

func (*ResponsesTrace) Record added in v0.2.7

func (trace *ResponsesTrace) Record(request string, attempt uint64, cached *uint64, shape *ResponsesShape) *protocol.ConversationResponsesBoundary

Record advances in attempt order. Missing capture breaks adjacency, since an unobserved or unconfirmed request may have reached the upstream cache.

type Result

type Result struct {
	Categories []protocol.ConversationObservationCategory
	Complete   bool
}

func Prepared

func Prepared(raw []byte, inventory *Inventory) Result

Prepared inspects the final adapted body. It never changes or retains raw.

type Source

type Source struct {
	Kind protocol.ConversationObservationCategoryKind
	Text string
}

Jump to

Keyboard shortcuts

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