]> git.giacomolli.uk - onechat/blobdiff - prompt.go
Name and order the terminal client code
[onechat] / prompt.go
index b536a36d9658722969d477bd936ad176f1e69b2c..546a86b4c2eec9aa7abf408614f14e351afbca32 100644 (file)
--- a/prompt.go
+++ b/prompt.go
@@ -26,7 +26,8 @@ const (
 // word. The reference design names its own agent, so promptText has the name of
 // the agent and the kind reply in its place. It describes only what OneChat can
 // do, so it leaves out the spec text on images, subagents, computers, and
 // word. The reference design names its own agent, so promptText has the name of
 // the agent and the kind reply in its place. It describes only what OneChat can
 // do, so it leaves out the spec text on images, subagents, computers, and
-// background tasks. prompt adds the clause on the instructions of the user only
+// background tasks. Its paragraph on persistent mode tells the model that a
+// final answer ends the turn. prompt adds the clause on the instructions of the user only
 // when there are instructions. It holds no date and no state, so turns and
 // compactions share its prompt cache.
 const promptText = `You are {name}, an AI agent that works for one user in a single chat that never
 // when there are instructions. It holds no date and no state, so turns and
 // compactions share its prompt cache.
 const promptText = `You are {name}, an AI agent that works for one user in a single chat that never
@@ -72,6 +73,13 @@ say in your reply what you learned that will matter later.
 
 Messages the user sends while you work reach you between tool calls.
 
 
 Messages the user sends while you work reach you between tool calls.
 
+You are in persistent mode: a reply with no tool call is your final answer, and
+it ends your turn. You act again only when the user writes. So keep going until
+the user's task is done, or until only the user can unblock it. Answer a
+question asked in the middle of a task, then go on with the task in the same
+turn. When the user says "continue", resume the latest unfinished task from the
+view.
+
 # Compactions
 
 You write {name}'s memory: one step of the tree, compressing one message into a
 # Compactions
 
 You write {name}'s memory: one step of the tree, compressing one message into a
@@ -126,8 +134,8 @@ func prompt(name, instructions string) string {
 // agentTools returns the function tools of every call: zoom, date, shell,
 // read, write, and edit. A compaction sends them too and never calls them,
 // because a change of the tools ends the shared prompt cache.
 // agentTools returns the function tools of every call: zoom, date, shell,
 // read, write, and edit. A compaction sends them too and never calls them,
 // because a change of the tools ends the shared prompt cache.
-func agentTools() []Tool {
-       return []Tool{
+func agentTools() []ModelTool {
+       return []ModelTool{
                {
                        Type:        "function",
                        Name:        "zoom",
                {
                        Type:        "function",
                        Name:        "zoom",