return statesg

This commit is contained in:
mudler
2024-04-01 22:50:11 +02:00
parent 7c679ead94
commit 8e3a1fcbe5
4 changed files with 50 additions and 26 deletions

View File

@@ -11,6 +11,17 @@ import (
"github.com/sashabaranov/go-openai"
)
type ActionState struct {
ActionCurrentState
Result string
}
type ActionCurrentState struct {
Action Action
Params action.ActionParams
Reasoning string
}
// Actions is something the agent can do
type Action interface {
Run(action.ActionParams) (string, error)
@@ -135,7 +146,7 @@ func (a *Agent) pickAction(ctx context.Context, templ string, messages []openai.
return nil, "", err
}
err = hudTmpl.Execute(prompt, a.prepareHUD())
err = hudTmpl.Execute(hud, a.prepareHUD())
if err != nil {
return nil, "", err
}