contracts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 8 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 contracts holds the JSON Schemas (draft 2020-12) of tool inputs and outputs, and the closed schemas of the quarantined reader's answers (notes/). The schema files are embedded; Validate checks raw tool arguments against the input schema before any service is called.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("schema validation failed")

ErrInvalid marks arguments or results that do not match their schema.

Functions

func Input

func Input(tool string) (json.RawMessage, error)

Input returns the raw input schema of a tool, for the tool listing.

func NoteDescription

func NoteDescription(schemaID string) (string, error)

NoteDescription returns the top-level "description" of a note schema: one line per value, for the system prompt of the quarantined reader.

func NoteSchema

func NoteSchema(schemaID string) (json.RawMessage, error)

NoteSchema returns the closed schema that edi.extract_note answers with for schemaID (notes/<schemaID>.json), as the model's response format.

func Output

func Output(tool string) (json.RawMessage, error)

Output returns the raw output schema of a tool, for the tool listing.

func ToolNames

func ToolNames() []string

ToolNames lists the tools that have a schema: the tools of the gateway. The linter of upstream descriptions uses it to find references to them.

func Validate

func Validate(tool string, raw []byte) error

Validate checks raw tool arguments against the input schema of the tool. Empty arguments count as an empty object. The error wraps ErrInvalid.

func ValidateNote

func ValidateNote(schemaID string, raw []byte) error

ValidateNote checks the model's answer against the note schema schemaID.

func ValidateOutput

func ValidateOutput(tool string, raw []byte) error

ValidateOutput checks a tool result against the output schema.

Types

This section is empty.

Jump to

Keyboard shortcuts

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