From 13b08c8cb3d89de5f229545504a93cd698919277 Mon Sep 17 00:00:00 2001 From: mudler Date: Sat, 6 Apr 2024 15:08:21 +0200 Subject: [PATCH] Consume answer if we didn't picked up any tool' --- agent/agent.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index dfdf665..fa8e4dc 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -227,7 +227,13 @@ func (a *Agent) consumeJob(job *Job, role string) { if chosenAction == nil { //job.Result.SetResult(ActionState{ActionCurrentState{nil, nil, "No action to do, just reply"}, ""}) - job.Result.Finish(fmt.Errorf("no action to do")) + //job.Result.Finish(fmt.Errorf("no action to do"))\ + a.currentConversation = append(a.currentConversation, openai.ChatCompletionMessage{ + Role: "assistant", + Content: reasoning, + }) + job.Result.SetResponse(reasoning) + job.Result.Finish(nil) return }