Add runtime abstraction and agent loop
Co-authored-by: codegirl007 <codegirl-007@users.noreply.github.com>
This commit is contained in:
co-authored by
codegirl007
parent
54dc5658c6
commit
94146fcae2
@@ -0,0 +1,39 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"agentbox/internal/environment"
|
||||
)
|
||||
|
||||
type Observation struct {
|
||||
Screenshot []byte
|
||||
Timestamp time.Time
|
||||
Logs []environment.LogEntry
|
||||
PreviousActions []environment.InputAction
|
||||
}
|
||||
|
||||
type Step struct {
|
||||
Number int
|
||||
Timestamp time.Time
|
||||
ScreenshotPath string
|
||||
Message string
|
||||
Action *environment.InputAction
|
||||
}
|
||||
|
||||
type Decision struct {
|
||||
Reason string
|
||||
Action *environment.InputAction
|
||||
Done bool
|
||||
}
|
||||
|
||||
type Agent interface {
|
||||
Name() string
|
||||
NextAction(
|
||||
ctx context.Context,
|
||||
task string,
|
||||
history []Step,
|
||||
observation Observation,
|
||||
) (Decision, error)
|
||||
}
|
||||
Reference in New Issue
Block a user