From fdd4af1042d05fc7209ffaada95017ac169e69ae Mon Sep 17 00:00:00 2001 From: mudler Date: Mon, 13 May 2024 00:16:13 +0200 Subject: [PATCH] Do not inject a reply action --- agent/actions.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/agent/actions.go b/agent/actions.go index a731bbf..68af724 100644 --- a/agent/actions.go +++ b/agent/actions.go @@ -150,7 +150,8 @@ func (a *Agent) generateParameters(ctx context.Context, pickTemplate string, act } func (a *Agent) systemInternalActions() Actions { - defaultActions := append(a.options.userActions, action.NewReply()) + // defaultActions := append(a.options.userActions, action.NewReply()) + defaultActions := a.options.userActions if a.options.initiateConversations && a.selfEvaluationInProgress { // && self-evaluation.. acts := append(defaultActions, action.NewConversation()) @@ -206,7 +207,9 @@ func (a *Agent) pickAction(ctx context.Context, templ string, messages []openai. // Find the action chosenAction := a.systemInternalActions().Find(thought.actioName) if chosenAction == nil { - return nil, "", fmt.Errorf("no action found for intent:" + thought.actioName) + // LLM replied with an answer? + //fmt.Errorf("no action found for intent:" + thought.actioName) + return action.NewReply(), thought.message, nil } return chosenAction, thought.message, nil }