diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-16 20:48:47 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-20 21:12:57 +0000 |
| commit | 4dc35ec28780d6a78e8afcf2650d4ada4fcd245c (patch) | |
| tree | 2d230546858e301914fc8f3d92fb83935ba7a796 /pkg/aflow/flow.go | |
| parent | 91e26ec437abcd42a8255aa88e31b45da059529e (diff) | |
pkg/aflow: handle common LLM mis-behaviors wrt tool calling
Gracefully handle (reply to LLM with error):
- incorrect tool name
- incorrect tool arg type
- missing tool arg
Silently handle:
- more than one call to set-results
- excessive tool args
Fixes #6604
Diffstat (limited to 'pkg/aflow/flow.go')
| -rw-r--r-- | pkg/aflow/flow.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/aflow/flow.go b/pkg/aflow/flow.go index a391f5a01..d1bbe4c69 100644 --- a/pkg/aflow/flow.go +++ b/pkg/aflow/flow.go @@ -57,12 +57,12 @@ func register[Inputs, Outputs any](typ ai.WorkflowType, description string, Type: typ, Description: description, checkInputs: func(inputs map[string]any) error { - _, err := convertFromMap[Inputs](inputs, false) + _, err := convertFromMap[Inputs](inputs, false, false) return err }, extractOutputs: func(state map[string]any) map[string]any { // Ensure that we actually have all outputs. - tmp, err := convertFromMap[Outputs](state, false) + tmp, err := convertFromMap[Outputs](state, false, false) if err != nil { panic(err) } |
