]> git.giacomolli.uk - onechat/blobdiff - turn.go
Escape tags in rich replies as HTML entities
[onechat] / turn.go
diff --git a/turn.go b/turn.go
index 08a144e48ac7dafcda1588e4e4387946d36177ca..c6a083bd1418ec11b0b9d7a31b031a062d7631b1 100644 (file)
--- a/turn.go
+++ b/turn.go
@@ -17,7 +17,7 @@ var errTurnLogWrite = errors.New("log write failed")
 // 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
        }
@@ -32,7 +32,7 @@ func newTurnLoop(agent *Agent, memory *Memory, client TurnClient, clock func() t
                wake:   make(chan struct{}, 1),
        }
 
-       l.tools = &toolbox{
+       l.tools = &Toolbox{
                log:     l,
                chat:    memory,
                workdir: agent.config.Workdir,
@@ -64,8 +64,8 @@ type Event struct {
 // 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
@@ -78,8 +78,8 @@ type TurnLoop struct {
        agent  *Agent
        memory *Memory
        client TurnClient
-       tools  *toolbox
-       layout *viewLayout
+       tools  *Toolbox
+       layout *ViewLayout
        clock  func() time.Time
        notify func(Event)
        wake   chan struct{}
@@ -261,7 +261,7 @@ func (l *TurnLoop) chain(ctx context.Context) error {
                        Model:        l.agent.config.Model,
                        Effort:       l.agent.config.Effort,
                        Instructions: instructions,
-                       Tools:        agentTools(),
+                       Tools:        promptTools(),
                        Input:        input,
                        Turn:         turn,
                })