X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/a4cfb030bf949e2fc9cd0ddace9e33f24b791b18..6e3e9c5c10f3d35bae7e9846334974a09418aef7:/prompt.go diff --git a/prompt.go b/prompt.go index c6df057..71671c5 100644 --- 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{