Skip to content

Commit

Permalink
fix: add json_schema to PARAMETER_RULE_TEMPLATE
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Nov 29, 2024
1 parent 45e8a3e commit 0d9c1e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/types/entities/plugin_entities/model_declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const (
FREQUENCY_PENALTY DefaultParameterName = "frequency_penalty"
MAX_TOKENS DefaultParameterName = "max_tokens"
RESPONSE_FORMAT DefaultParameterName = "response_format"
JSON_SCHEMA DefaultParameterName = "json_schema"
)

var PARAMETER_RULE_TEMPLATE = map[DefaultParameterName]ModelParameterRule{
Expand Down Expand Up @@ -222,6 +223,17 @@ var PARAMETER_RULE_TEMPLATE = map[DefaultParameterName]ModelParameterRule{
Required: false,
Options: []string{"JSON", "XML"},
},
JSON_SCHEMA: {
Label: &I18nObject{
EnUS: "JSON Schema",
},
Type: parser.ToPtr(PARAMETER_TYPE_STRING),
Help: &I18nObject{
EnUS: "Set a response json schema will ensure LLM to adhere it.",
ZhHans: "设置返回的json schema,llm将按照它返回",
},
Required: false,
},
}

func (m *ModelParameterRule) TransformTemplate() error {
Expand Down

0 comments on commit 0d9c1e5

Please sign in to comment.