]> git.giacomolli.uk - onechat/blobdiff - prompt.go
Store the subagents and read them with zoom
[onechat] / prompt.go
index c6df0575f5686ef8708b099ddf6d0046180690f0..71671c510caa6b0c3ec837de6555f1ecc5807e76 100644 (file)
--- a/prompt.go
+++ b/prompt.go
@@ -58,6 +58,7 @@ long for one message is split over several in a row.
 Tools:
 - zoom(id, n) opens line id+n into the two lines it was made from;
 - zoom(id, 1) gives message id whole
+- zoom("Name") gives an agent's whole chat
 - date(id) gives the date and time of message id
 
 # Turns
@@ -139,10 +140,11 @@ func promptTools() []ModelTool {
                {
                        Type:        "function",
                        Name:        "zoom",
-                       Description: "Open the line id+n of the view into the two lines of n/2 under it; n = 1 gives the message whole.",
+                       Description: "Open the line id+n of the view into the two lines of n/2 under it; n = 1 gives the message whole. With an agent's name, give that agent's whole chat.",
                        Parameters: promptObjectSchema(map[string]any{
-                               "id": promptIntegerSchema("The first message of the line: a multiple of n."),
-                               "n":  promptIntegerSchema("The number of messages of the line: a power of 2."),
+                               "id":   promptIntegerSchema("The first message of the line: a multiple of n."),
+                               "n":    promptIntegerSchema("The number of messages of the line: a power of 2."),
+                               "name": promptNullableStringSchema("The name of an agent whose whole chat to give, or null for the line id+n."),
                        }),
                        Strict: true,
                },
@@ -223,6 +225,14 @@ func promptIntegerSchema(description string) map[string]any {
        }
 }
 
+// promptNullableStringSchema returns the JSON schema of a string or null.
+func promptNullableStringSchema(description string) map[string]any {
+       return map[string]any{
+               "type":        []string{"string", "null"},
+               "description": description,
+       }
+}
+
 // promptStringSchema returns the JSON schema of a string.
 func promptStringSchema(description string) map[string]any {
        return map[string]any{