responsemeta

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package responsemeta defines the small, provider-neutral contract used to carry stateless Responses API continuation data through Eino messages and the JSONL session recorder.

Index

Constants

View Source
const (
	// OpaqueItemsExtraKey is the stable schema.Message.Extra key used by the
	// Responses transport, runner, and session replay.
	OpaqueItemsExtraKey = "jcode.responses.opaque_items"

	// MaxOpaqueItems bounds encrypted reasoning items retained per message.
	MaxOpaqueItems = 16
	// MaxOpaqueItemBytes bounds one canonical encrypted reasoning item.
	MaxOpaqueItemBytes = 512 << 10
	// MaxOpaqueItemsBytes bounds all encrypted items retained per message.
	MaxOpaqueItemsBytes = 2 << 20
)

Variables

This section is empty.

Functions

func CanonicalReasoningItem

func CanonicalReasoningItem(raw []byte) (json.RawMessage, bool)

CanonicalReasoningItem accepts only an encrypted Responses reasoning item and strips every provider-returned cleartext field. Summary is deliberately serialized as an empty array because the Codex Responses schema requires it.

func Extra

func Extra(items []json.RawMessage) map[string]any

Extra builds the canonical message metadata map for opaque items.

func FromExtra

func FromExtra(extra map[string]any) []json.RawMessage

FromExtra extracts canonical opaque items from the runtime message value. The transport and session replay use []json.RawMessage, while []any support keeps the contract resilient to a JSON marshal/unmarshal boundary.

func Normalize

func Normalize(items []json.RawMessage) []json.RawMessage

Normalize returns a bounded, canonical collection. It is safe to call on untrusted session data: invalid, cleartext-only, oversized, and excess items are ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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