aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/aflow/testdata
Commit message (Collapse)AuthorAgeFilesLines
* pkg/aflow: add Flow.Consts instead of ProvideDmitry Vyukov3 days1-0/+34
| | | | | | | | | There is no point in using Provide more than once, and anywhere besides the first action of a flow. So it's not really an action, but more of a flow property. Add Flow.Consts field to handle this case better. Also provide slightly less verbose syntax by using a map instead of a struct, and add tests.
* pkg/aflow: fix handling of optional tool argumentsDmitry Vyukov2026-02-192-0/+196
| | | | | | | Currently we crash on nil deref, if LLM specifies explicit 'nil' for an optional (pointer) argument. Handle such cases properly. Fixes #6811
* pkg/aflow: make it possible for LLMAgent to return only structured outputsDmitry Vyukov2026-02-102-0/+150
| | | | | In some cases there may be not final text reply, only some structured outputs (e.g. some bool). Don't require final reply, if structured outputs are specified.
* pkg/aflow: fix structured outputs handlingDmitry Vyukov2026-02-102-0/+316
| | | | | | If LLM calls set-results tool to set structured results, and then calls another unrelated tool, currently we lose structured results (overwrite with nil). Don't do that, keep structured results.
* pkg/aflow: abstract away LLM temperatureDmitry Vyukov2026-02-025-12/+12
| | | | | | | | | | Introduce abstract "task type" for LLM agents instead of specifying temperature explicitly for each agent. This has 2 advantages: - we don't hardcode it everywhere, and can change centrally as our understanding of the right temperature evolves - we can control other LLM parameters (topn/topk) using task type as well Update #6576
* pkg/aflow: fix role in test repliesDmitry Vyukov2026-01-301-9/+9
|
* pkg/aflow: refactor the LLM summarization testDmitry Vyukov2026-01-302-10/+185
| | | | | | | | | It's very inconvinient to hardcode exact LLM replies in this test, because it's hard to understand when exactly it will be asked to summarize. It's easy to make a bug in the test, and provide summary reply when it wasn't asked to. Instead support proving full generateContent callback, and just model what an LLM would do -- provide summary only when it's asked to.
* pkg/aflow: reduce size of golden test filesDmitry Vyukov2026-01-305-1261/+0
| | | | Don't memorize repeated request configs.
* pkg/aflow: adding sliding window summary featureYulong Zhang2026-01-302-0/+705
| | | | | | | | | This adds a flow feature (and creates a new flow using it) called "sliding window summary". It works by asking the AI to always summarize the latest knowledge, and then we toss the old messages if they fall outside the context sliding window.
* pkg/aflow: add explicit DoWhile.MaxIterationsDmitry Vyukov2026-01-271-0/+133
| | | | | | Add DoWhile.MaxIterations and make it mandatory. I think it's useful to make workflow implementer to think explicitly about a reasonable cap on the number of iterations.
* pkg/aflow: handle input token overflow for LLM toolsDmitry Vyukov2026-01-272-11/+278
| | | | | | | Handle LLM tool input token overflow by removing the last tool reply, and replacing it with an order to answer right now. I've seen an LLM tool went into too deap research and in the end just overflowed input tokens. It could provide at least some answer instead.
* pkg/aflow: keep LLM reply on tool callsDmitry Vyukov2026-01-262-1/+7
|
* pkg/aflow: fix Temperature handlingDmitry Vyukov2026-01-261-5/+5
| | | | | | If LLMAgent.Temperature is assigned an untyped float const (0.5) it will be typed as float64 rather than float32. So recast them. Cap Temperature at model's supported MaxTemperature.
* pkg/aflow: add DoWhile loop actionDmitry Vyukov2026-01-241-0/+191
| | | | | DoWhile represents "do { body } while (cond)" loop. See added test for an example.
* pkg/aflow: add LLMToolDmitry Vyukov2026-01-232-0/+838
| | | | | | | LLMTool acts like a tool for the parent LLM, but is itself implemented as an LLM agent. It can have own tools, different from the parent LLM agent. It can do complex multi-step research, and provide a concise answer to the parent LLM without polluting its context window.
* pkg/aflow: handle empty LLM repliesDmitry Vyukov2026-01-232-4/+332
|
* pkg/aflow: refactor testsDmitry Vyukov2026-01-236-0/+2887
Add helper function that executes test workflows, compares results (trajectory, LLM requests) against golden files, and if requested updates these golden files.