fixups and workarounds llm want to output tags
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -548,8 +549,11 @@ func (a *Agent) consumeJob(job *Job, role string) {
|
||||
// that a reply was not necessary anymore
|
||||
Messages: append(a.currentConversation, openai.ChatCompletionMessage{
|
||||
Role: "system",
|
||||
Content: "The assistant needs to reply without using any tool. " + replyResponse.Message,
|
||||
}),
|
||||
Content: "The assistant needs to reply without using any tool.",
|
||||
// + replyResponse.Message,
|
||||
},
|
||||
),
|
||||
//Messages: a.currentConversation,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -566,7 +570,8 @@ func (a *Agent) consumeJob(job *Job, role string) {
|
||||
msg := resp.Choices[0].Message
|
||||
|
||||
// If we didn't got any message, we can use the response from the action
|
||||
if chosenAction.Definition().Name.Is(action.ReplyActionName) && msg.Content == "" {
|
||||
if chosenAction.Definition().Name.Is(action.ReplyActionName) && msg.Content == "" ||
|
||||
strings.Contains(msg.Content, "<tool_call>") {
|
||||
a.logger.Info("No output returned from conversation, using the action response as a reply " + replyResponse.Message)
|
||||
|
||||
msg = openai.ChatCompletionMessage{
|
||||
|
||||
@@ -47,7 +47,7 @@ Considering the goal and the persistent goal, if you have one, and do something,
|
||||
const hudTemplate = `{{with .HUD }}{{if .ShowCharacter}}The assistant acts like an human, has a character and the replies and actions might be influenced by it.
|
||||
{{if .Character.Name}}This is the assistant name: {{.Character.Name}}
|
||||
{{end}}{{if .Character.Age}}This is the assistant age: {{.Character.Age}}
|
||||
{{end}}{{if .Character.Occupation}}This is the assistant jop: {{.Character.Occupation}}
|
||||
{{end}}{{if .Character.Occupation}}This is the assistant job: {{.Character.Occupation}}
|
||||
{{end}}{{if .Character.Hobbies}}This is the assistant's hobbies: {{.Character.Hobbies}}
|
||||
{{end}}{{if .Character.MusicTaste}}This is the assistant's music taste: {{.Character.MusicTaste}}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user