shared

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: AGPL-3.0 Imports: 6 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

Index

Constants

This section is empty.

Variables

View Source
var ErrTrailingJSON = errors.New("trailing JSON")

Functions

func AsTrimmedString

func AsTrimmedString(v any) string

AsTrimmedString returns the trimmed string form of v, or "" for non-strings.

func CloneObject added in v0.29.1

func CloneObject(src map[string]any) map[string]any

CloneObject returns a writable shallow copy, including for a nil source.

func DecodeJSON added in v0.29.1

func DecodeJSON(r io.Reader, dst any) error

DecodeJSON reads one complete value and preserves numbers in interface values.

func NormalizeNativeTerminalJSON added in v0.20.0

func NormalizeNativeTerminalJSON(raw []byte, protocol NativeTerminalProtocol) []byte

Keep protocol repair narrow: never invent a terminal event, repair truncated arguments, or change length/refusal/error outcomes. RawMessage preserves usage, large integer metadata, reasoning, signatures, and provider extensions.

func ParseJSONLike

func ParseJSONLike(raw string) any

ParseJSONLike parses raw as JSON, returning an empty map for empty input and wrapping unparseable input as {"value": raw}.

func RawString added in v0.29.1

func RawString(raw json.RawMessage) string

RawString returns the string value of a JSON field, or "" if absent or invalid.

func UnsupportedField added in v0.29.1

func UnsupportedField(obj map[string]any, allowed ...string) (string, bool)

UnsupportedField reports a non-null field outside the allowlist.

Types

type NativeTerminalProtocol added in v0.20.0

type NativeTerminalProtocol uint8

NativeTerminalProtocol identifies native wire formats with narrowly bounded terminal compatibility repairs.

const (
	NativeChatCompletions NativeTerminalProtocol = iota + 1
	NativeMessages
	NativeResponses
)

type NativeTerminalStream added in v0.20.0

type NativeTerminalStream struct {
	Protocol NativeTerminalProtocol
	// contains filtered or unexported fields
}

NativeTerminalStream owns only bounded evidence for actual tool calls. It accepts complete SSE data payloads; framing, timeouts, and byte limits remain with the relay. Zero values are valid when Protocol is set before use.

func (*NativeTerminalStream) AddData added in v0.20.0

func (s *NativeTerminalStream) AddData(raw []byte) []byte

Jump to

Keyboard shortcuts

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