Compare commits

...

2 Commits

25
pkg/agents/console.go Normal file
View File

@ -0,0 +1,25 @@
package agents
import (
"context"
"gitea.stevedudenhoeffer.com/steve/answer/pkg/agents/console"
)
// Console will construct a console.Agent, execute the agent, and return the knowledge gained, the output directory,
// and any possible error.
func (a Agent) Console(ctx context.Context, questions []string) (Knowledge, string, error) {
con := console.Agent{
Agent: a,
Model: a.model,
ContextualInformation: a.contextualInformation,
MaxCommands: 50,
}
res, err := con.Answer(ctx, questions)
if err != nil {
return Knowledge{}, "", err
}
return res.Knowledge, res.Directory, nil
}