From 43ca0dccf73be1cb48c1325a1d10db0cf33fbc2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Dec 2024 09:34:13 +0000 Subject: [PATCH] Update version to v1.4.118 and commit --- core/chatter.go | 21 ++++++++++----------- pkgs/fabric/version.nix | 2 +- version.go | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/core/chatter.go b/core/chatter.go index 1da775f96..b621d36ab 100644 --- a/core/chatter.go +++ b/core/chatter.go @@ -111,12 +111,12 @@ func (o *Chatter) BuildSession(request *common.ChatRequest, raw bool) (session * } // Process any template variables in the message content (user input) - // Double curly braces {{variable}} indicate template substitution + // Double curly braces {{variable}} indicate template substitution // Ensure we have a message before processing, other wise we'll get an error when we pass to pattern.go if request.Message == nil { request.Message = &goopenai.ChatCompletionMessage{ - Role: goopenai.ChatMessageRoleUser, - Content: " ", + Role: goopenai.ChatMessageRoleUser, + Content: " ", } } @@ -128,16 +128,15 @@ func (o *Chatter) BuildSession(request *common.ChatRequest, raw bool) (session * var patternContent string if request.PatternName != "" { - pattern, err := o.db.Patterns.GetApplyVariables(request.PatternName, request.PatternVariables, request.Message.Content) - // pattrn will now contain user input, and all variables will be resolved, or errored - - if err != nil { - return nil, fmt.Errorf("could not get pattern %s: %v", request.PatternName, err) - } - patternContent = pattern.Pattern + pattern, err := o.db.Patterns.GetApplyVariables(request.PatternName, request.PatternVariables, request.Message.Content) + // pattrn will now contain user input, and all variables will be resolved, or errored + + if err != nil { + return nil, fmt.Errorf("could not get pattern %s: %v", request.PatternName, err) + } + patternContent = pattern.Pattern } - systemMessage := strings.TrimSpace(contextContent) + strings.TrimSpace(patternContent) if request.Language != "" { systemMessage = fmt.Sprintf("%s. Please use the language '%s' for the output.", systemMessage, request.Language) diff --git a/pkgs/fabric/version.nix b/pkgs/fabric/version.nix index d4403fcd1..7631d24d3 100644 --- a/pkgs/fabric/version.nix +++ b/pkgs/fabric/version.nix @@ -1 +1 @@ -"1.4.117" +"1.4.118" diff --git a/version.go b/version.go index d9f5df740..6ab18b243 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package main -var version = "v1.4.117" +var version = "v1.4.118"