diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-15 11:37:02 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-19 09:21:15 +0000 |
| commit | 1276f83b46b38cc241614ebc4401720f5f1fc4ab (patch) | |
| tree | edf8e8d9c9ac313d9457cebf678aea9334804f05 /pkg/aflow/template_test.go | |
| parent | a9fc52269b8aab60248b6e4c5366216bc2191101 (diff) | |
pkg/aflow: add ability to generate several candidate replies for LLM agents
Add LLMAgent.Candidates parameter.
If set to a value N>1, then the agent is invoked N times,
and all outputs become slices.
The results can be later aggregated by another agent,
as shown in the test.
Diffstat (limited to 'pkg/aflow/template_test.go')
| -rw-r--r-- | pkg/aflow/template_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/aflow/template_test.go b/pkg/aflow/template_test.go index e42ddd2c3..3b24d62f6 100644 --- a/pkg/aflow/template_test.go +++ b/pkg/aflow/template_test.go @@ -44,6 +44,17 @@ func TestTemplate(t *testing.T) { }, { template: ` + {{range $i, $v := .array}} + {{$i}} {{$v}} + {{end}} + `, + vars: map[string]reflect.Type{ + "array": reflect.TypeFor[[]int](), + }, + used: []string{"array"}, + }, + { + template: ` {{if .bar}} {{.foo}} {{end}} |
