Documentation
¶
Overview ¶
Package configschema renders the JSON Schema artifacts of Pi's configuration files (models.json, settings.json, keybindings.json and themes) from Go schema trees. The trees mirror the TypeBox schemas of Pi's coding-agent and ai packages, and Render mirrors packages/coding-agent/scripts/generate-schemas.ts: node order, annotation placement and $defs extraction follow the TypeScript output.
Index ¶
- Constants
- func ArtifactPaths() []string
- func Render(keybindings Artifact) (map[string]string, error)
- type Artifact
- type CompatSchemaEntry
- type Definition
- type Opt
- type Prop
- type Schema
- func AnthropicAllowedFallbackModelSchema() *Schema
- func AnthropicMessagesCompatSchema() *Schema
- func Array(items *Schema, opts ...Opt) *Schema
- func BedrockCompatSchema() *Schema
- func Boolean(opts ...Opt) *Schema
- func CacheRetentionSchema() *Schema
- func ChatTemplateKwargValueSchema() *Schema
- func Enum(values []string, opts ...Opt) *Schema
- func Integer(opts ...Opt) *Schema
- func Literal(value any, opts ...Opt) *Schema
- func MistralConversationsCompatSchema() *Schema
- func ModelCostRatesSchema() *Schema
- func ModelCostSchema() *Schema
- func ModelCostTierSchema() *Schema
- func ModelImageInputLimitsSchema() *Schema
- func ModelImageResizeOptionsSchema() *Schema
- func ModelInputLimitsSchema() *Schema
- func ModelInputModalitySchema() *Schema
- func ModelPromptCacheSchema() *Schema
- func ModelThinkingLevelSchema() *Schema
- func ModelsConfigSchema() *Schema
- func Null(opts ...Opt) *Schema
- func Number(opts ...Opt) *Schema
- func Object(props []Prop, opts ...Opt) *Schema
- func OpenAICompletionsCompatSchema() *Schema
- func OpenAIResponsesCompatSchema() *Schema
- func OpenRouterRoutingSchema() *Schema
- func Partial(s *Schema, opts ...Opt) *Schema
- func ProviderCompatSchema() *Schema
- func Record(value *Schema, opts ...Opt) *Schema
- func RecordOf(keys []string, value *Schema, opts ...Opt) *Schema
- func SessionAffinityFormatSchema() *Schema
- func String(opts ...Opt) *Schema
- func SystemOneCompatSchema() *Schema
- func ThinkingLevelMapSchema() *Schema
- func ThinkingLevelSchema() *Schema
- func ThinkingTokenBudgetFieldSchema() *Schema
- func Union(alternatives []*Schema, opts ...Opt) *Schema
- func Unknown(opts ...Opt) *Schema
- func VercelGatewayRoutingSchema() *Schema
Constants ¶
const KeybindingsArtifactPath = "schemas/keybindings.schema.json"
KeybindingsArtifactPath is the path of the keybindings artifact, which the caller supplies to Render and ArtifactPaths.
Variables ¶
This section is empty.
Functions ¶
func ArtifactPaths ¶
func ArtifactPaths() []string
ArtifactPaths lists the artifact paths in generation order (generate-schemas.ts schemaArtifacts).
Types ¶
type Artifact ¶
type Artifact struct {
Path string
Schema *Schema
Definitions []Definition
}
Artifact is one generated schema file and the shared sub-schemas its generator turns into $defs.
type CompatSchemaEntry ¶
type CompatSchemaEntry struct{ API, Schema string }
CompatSchemaEntry is one entry of CompatSchemasByApi: an API and the name of its compat schema.
func CompatSchemasByApi ¶
func CompatSchemasByApi() []CompatSchemaEntry
CompatSchemasByApi is compat-schema.ts CompatSchemasByApi: the compatibility schema of each API whose models accept compat, in Pi's key order (Pi 4954d760 adds azure-openai-responses and openai-codex-responses, which share the Responses schema).
type Definition ¶
Definition is one named $defs entry.
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is one JSON Schema node whose keys keep their insertion order, the order in which JSON.stringify writes a TypeBox schema.
func AnthropicAllowedFallbackModelSchema ¶
func AnthropicAllowedFallbackModelSchema() *Schema
func AnthropicMessagesCompatSchema ¶
func AnthropicMessagesCompatSchema() *Schema
func BedrockCompatSchema ¶
func BedrockCompatSchema() *Schema
func CacheRetentionSchema ¶
func CacheRetentionSchema() *Schema
func ChatTemplateKwargValueSchema ¶
func ChatTemplateKwargValueSchema() *Schema
func MistralConversationsCompatSchema ¶
func MistralConversationsCompatSchema() *Schema
func ModelCostRatesSchema ¶
func ModelCostRatesSchema() *Schema
func ModelCostSchema ¶
func ModelCostSchema() *Schema
func ModelCostTierSchema ¶
func ModelCostTierSchema() *Schema
func ModelImageInputLimitsSchema ¶
func ModelImageInputLimitsSchema() *Schema
func ModelImageResizeOptionsSchema ¶
func ModelImageResizeOptionsSchema() *Schema
func ModelInputLimitsSchema ¶
func ModelInputLimitsSchema() *Schema
func ModelInputModalitySchema ¶
func ModelInputModalitySchema() *Schema
func ModelPromptCacheSchema ¶
func ModelPromptCacheSchema() *Schema
func ModelThinkingLevelSchema ¶
func ModelThinkingLevelSchema() *Schema
func ModelsConfigSchema ¶
func ModelsConfigSchema() *Schema
func OpenAICompletionsCompatSchema ¶
func OpenAICompletionsCompatSchema() *Schema
func OpenAIResponsesCompatSchema ¶
func OpenAIResponsesCompatSchema() *Schema
func OpenRouterRoutingSchema ¶
func OpenRouterRoutingSchema() *Schema
func ProviderCompatSchema ¶
func ProviderCompatSchema() *Schema
ProviderCompatSchema is mergeCompatProperties: a property keeps the position of its first schema, and an override replaces its value.
func Record ¶
Record is Type.Record(Type.String(), value): an object whose every property matches value.
func RecordOf ¶
RecordOf is Type.Record over the string literals keys: an object with one required property per key.
func SessionAffinityFormatSchema ¶
func SessionAffinityFormatSchema() *Schema
func SystemOneCompatSchema ¶
func SystemOneCompatSchema() *Schema
SystemOneCompatSchema is compat-schema.ts SystemOneCompatSchema.
func ThinkingLevelMapSchema ¶
func ThinkingLevelMapSchema() *Schema
func ThinkingLevelSchema ¶
func ThinkingLevelSchema() *Schema
func ThinkingTokenBudgetFieldSchema ¶
func ThinkingTokenBudgetFieldSchema() *Schema
func VercelGatewayRoutingSchema ¶
func VercelGatewayRoutingSchema() *Schema