Compare commits
2 Commits
8ae16cb633
...
4c5922d571
Author | SHA1 | Date | |
---|---|---|---|
4c5922d571 | |||
7834943cb6 |
25
pkg/agents/console.go
Normal file
25
pkg/agents/console.go
Normal 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
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user