on main help sign in
fix: add $schema to jsonschema
b0b85e6Carlos Alexandro Becker
internal/config/config.go+2−1
@@ -20,7 +20,6 @@ import (
20const (
20const (
21 appName = "crush"
21 appName = "crush"
22 defaultDataDirectory = ".crush"
22 defaultDataDirectory = ".crush"
23− defaultLogLevel = "info"
24)
23)
25
24
26var defaultContextPaths = []string{
25var defaultContextPaths = []string{
@@ -244,6 +243,8 @@ type Agent struct {
244
243
245// Config holds the configuration for crush.
244// Config holds the configuration for crush.
246type Config struct {
245type Config struct {
246+ Schema string `json:"$schema,omitempty"`
247+
247 // We currently only support large/small as values here.
248 // We currently only support large/small as values here.
248 Models map[SelectedModelType]SelectedModel `json:"models,omitempty" jsonschema:"description=Model configurations for different model types,example={\"large\":{\"model\":\"gpt-4o\",\"provider\":\"openai\"}}"`
249 Models map[SelectedModelType]SelectedModel `json:"models,omitempty" jsonschema:"description=Model configurations for different model types,example={\"large\":{\"model\":\"gpt-4o\",\"provider\":\"openai\"}}"`
249
250
schema.json+3
@@ -5,6 +5,9 @@
5 "$defs": {
5 "$defs": {
6 "Config": {
6 "Config": {
7 "properties": {
7 "properties": {
8+ "$schema": {
9+ "type": "string"
10+ },
8 "models": {
11 "models": {
9 "additionalProperties": {
12 "additionalProperties": {
10 "$ref": "#/$defs/SelectedModel"
13 "$ref": "#/$defs/SelectedModel"