fix: simpler

This commit is contained in:
Carlos Alexandro Becker
2025-07-28 22:47:41 -03:00
parent 3135b6fa4d
commit 820e55ebba
2 changed files with 9 additions and 34 deletions

View File

@@ -13,7 +13,6 @@ import (
"github.com/charmbracelet/catwalk/pkg/catwalk"
"github.com/charmbracelet/crush/internal/csync"
"github.com/charmbracelet/crush/internal/env"
"github.com/invopop/jsonschema"
"github.com/tidwall/sjson"
)
@@ -46,16 +45,6 @@ const (
SelectedModelTypeSmall SelectedModelType = "small"
)
// JSONSchema returns the JSON schema for SelectedModelType
func (SelectedModelType) JSONSchema() *jsonschema.Schema {
return &jsonschema.Schema{
Type: "string",
Description: "Model type selection for different use cases",
Enum: []any{"large", "small"},
Default: "large",
}
}
type SelectedModel struct {
// The model id as used by the provider API.
// Required.
@@ -111,16 +100,6 @@ const (
MCPHttp MCPType = "http"
)
// JSONSchema returns the JSON schema for MCPType
func (MCPType) JSONSchema() *jsonschema.Schema {
return &jsonschema.Schema{
Type: "string",
Description: "Type of MCP connection protocol",
Enum: []any{"stdio", "sse", "http"},
Default: "stdio",
}
}
type MCPConfig struct {
Command string `json:"command,omitempty" jsonschema:"description=Command to execute for stdio MCP servers,example=npx"`
Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set for the MCP server"`
@@ -239,7 +218,7 @@ type Agent struct {
// This is the id of the system prompt used by the agent
Disabled bool `json:"disabled,omitempty"`
Model SelectedModelType `json:"model"`
Model SelectedModelType `json:"model" jsonschema:"required,description=The model type to use for this agent,enum=large,enum=small,default=large"`
// The available tools for the agent
// if this is nil, all tools are available