// newTurnLoop returns the loop of agent with its memory. Its calls go through
// client, and notify gets each event. The clock gives the date of a turn.
func newTurnLoop(agent *Agent, memory *Memory, client TurnClient, clock func() time.Time, notify func(Event)) (*TurnLoop, error) {
- layout, err := loadLayout(filepath.Join(agent.dir, layoutFileName))
+ layout, err := loadViewLayout(filepath.Join(agent.dir, viewLayoutFileName))
if err != nil {
return nil, err
}
wake: make(chan struct{}, 1),
}
- l.tools = &toolbox{
+ l.tools = &Toolbox{
log: l,
chat: memory,
workdir: agent.config.Workdir,
// of turnInput. The loop runs the tool calls of each response and sends their
// results back, until a response has no tool call: the final answer.
//
-// The view goes out as the messages of a viewLayout, so the first request of
-// a turn reads the view of the turn before from the prompt cache.
+// The view goes out as the messages of a ViewLayout, so the first request of a
+// turn reads the view of the turn before from the prompt cache.
//
// Each later request of a turn begins with the whole input of the request
// before it, then its output items, then the tool results. The output items
agent *Agent
memory *Memory
client TurnClient
- tools *toolbox
- layout *viewLayout
+ tools *Toolbox
+ layout *ViewLayout
clock func() time.Time
notify func(Event)
wake chan struct{}
Model: l.agent.config.Model,
Effort: l.agent.config.Effort,
Instructions: instructions,
- Tools: agentTools(),
+ Tools: promptTools(),
Input: input,
Turn: turn,
})