]> git.giacomolli.uk - onechat/blobdiff - probe.go
Run the turns of an agent in a loop
[onechat] / probe.go
index bbce24f65541d455b05796a4d30c58fdf5903e6d..6e0b81eaa48188e87af08d973864f92cb8ec3034 100644 (file)
--- a/probe.go
+++ b/probe.go
@@ -91,7 +91,7 @@ func probe(ctx context.Context, args []string, out io.Writer) error {
        client := newClient(address, auth, "onechat-"+probeName, usagePath)
        client.LimitCalls(probeCallLimit)
        summarizer := slotSummarizer{
        client := newClient(address, auth, "onechat-"+probeName, usagePath)
        client.LimitCalls(probeCallLimit)
        summarizer := slotSummarizer{
-               inner: newCompactor(client, probeName, config.Compactor),
+               inner: newCompactor(client, probePrompt, config.Compactor),
                slots: make(chan struct{}, builds),
        }
 
                slots: make(chan struct{}, builds),
        }
 
@@ -235,6 +235,12 @@ func (s slotSummarizer) Summarize(ctx context.Context, task Task) (string, error
        return s.inner.Summarize(ctx, task)
 }
 
        return s.inner.Summarize(ctx, task)
 }
 
+// probePrompt returns the system prompt of a probe run: the prompt of the agent
+// probeName, without instructions.
+func probePrompt() (string, error) {
+       return prompt(probeName, ""), nil
+}
+
 // probeEntry is one message of a probe log.
 type probeEntry struct {
        Kind string `json:"kind"`
 // probeEntry is one message of a probe log.
 type probeEntry struct {
        Kind string `json:"kind"`