diff --git a/core/http/endpoints/openai/chat.go b/core/http/endpoints/openai/chat.go index f63a991319d..f0088d2a691 100644 --- a/core/http/endpoints/openai/chat.go +++ b/core/http/endpoints/openai/chat.go @@ -201,7 +201,7 @@ func ChatEndpoint(cl *config.BackendConfigLoader, ml *model.ModelLoader, startup } switch { - case !config.FunctionsConfig.GrammarConfig.NoGrammar && shouldUseFn: + case config.FunctionsConfig.GrammarConfig.EnableGrammar && shouldUseFn: noActionGrammar := functions.Function{ Name: noActionName, Description: noActionDescription, diff --git a/gallery/mudler.yaml b/gallery/mudler.yaml index 77bdc8eb4b6..3ca8595a481 100644 --- a/gallery/mudler.yaml +++ b/gallery/mudler.yaml @@ -10,7 +10,8 @@ config_file: |- - <|end_of_text|> function: - return_name_in_function_response: true + grammar: + enable: true template: chat: | diff --git a/pkg/functions/parse.go b/pkg/functions/parse.go index 8e848a60b1f..585bee4f39d 100644 --- a/pkg/functions/parse.go +++ b/pkg/functions/parse.go @@ -25,8 +25,8 @@ type GrammarConfig struct { // In this way if the LLM selects a free string, it won't be mixed necessarly with JSON objects NoMixedFreeString bool `yaml:"no_mixed_free_string"` - // NoGrammar disables the grammar parsing and parses the responses directly from the LLM - NoGrammar bool `yaml:"disable"` + // EnableGrammar disables the grammar parsing and parses the responses directly from the LLM + EnableGrammar bool `yaml:"enable"` // Prefix is the suffix to append to the grammar when being generated // This is useful when models prepend a tag before returning JSON