minor fixups

This commit is contained in:
mudler committed 2023-07-06 11:55:19 +02:00
1 parent c4495ad8f2
commit 483fddccf9
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -281,7 +281,7 @@ func updateConfig(config *Config, input *OpenAIRequest) {
n, exists := fnc["name"]
if exists {
nn, e := n.(string)
if !e {
if e {
name = nn
}
}
+5 -5
View File
@@ -421,15 +421,15 @@ func chatEndpoint(cm *ConfigMerger, o *Option) func(c *fiber.Ctx) error {
processFunctions = true
// Append the no action function
funcs = append(funcs, input.Functions...)
funcs = append(funcs, noActionGrammar)
// Force picking one of the functions by the request
if config.functionCallNameString != "" {
funcs = funcs.Select(config.functionCallNameString)
}
// Append the no action function
funcs = append(funcs, input.Functions...)
funcs = append(funcs, noActionGrammar)
// Update input grammar
jsStruct := funcs.ToJSONStructure()
config.Grammar = jsStruct.Grammar("")
@@ -452,7 +452,7 @@ func chatEndpoint(cm *ConfigMerger, o *Option) func(c *fiber.Ctx) error {
roleFn := "assistant_function_call"
r := config.Roles[roleFn]
if r != "" {
role = roleFn
role = r
}
}
r := config.Roles[role]