From 0f1326b2bd824f8b7e98eff11312ccd3a62815b4 Mon Sep 17 00:00:00 2001 From: mudler Date: Tue, 4 Jul 2023 23:34:51 +0200 Subject: [PATCH] fixups --- api/openai.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/openai.go b/api/openai.go index 3826a52..d95efc0 100644 --- a/api/openai.go +++ b/api/openai.go @@ -402,7 +402,7 @@ func chatEndpoint(cm *ConfigMerger, o *Option) func(c *fiber.Ctx) error { } return func(c *fiber.Ctx) error { processFunctions := false - funcs := []grammar.Function{} + funcs := grammar.Functions{} model, input, err := readInput(c, o.loader, true) if err != nil { return fmt.Errorf("failed reading parameters from request:%w", err) @@ -419,7 +419,6 @@ func chatEndpoint(cm *ConfigMerger, o *Option) func(c *fiber.Ctx) error { ((config.functionCallString != "none" || config.functionCallString == "") || len(config.functionCallNameString) > 0) { log.Debug().Msgf("Response needs to process functions") - var funcs grammar.Functions = input.Functions processFunctions = true // Force picking one of the functions by the request @@ -428,6 +427,7 @@ func chatEndpoint(cm *ConfigMerger, o *Option) func(c *fiber.Ctx) error { } // Append the no action function + funcs = append(funcs, input.Functions...) funcs = append(funcs, noActionGrammar) // Update input grammar