mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 08:02:38 +00:00
feat(ai-chat): keep the thinking effort runnable, and let a test run name its conversation
- Picking a model that cannot think left the old `reasoning_effort` in the flow input and the run sent it anyway. The composer now writes the effort alongside the model — carried where the new model has that level, cleared where it does not — through `carriedReasoning`, the rule the session chat already applied inline and now shares. - `reasoning_effort` no longer falls back to the Configure-inputs modal on a model that cannot reason. The popover always owns it once a model is chosen: the slider, or the row saying the model cannot think. On such a model the value is not a choice but a fact, so offering it in the modal only invited setting a level the provider rejects. - `memory_id` names the conversation a chat turn belongs to and is a query parameter, so no caller could supply it through `args` — and the error said only that it was required. It now says where it goes, `test_run_flow` supplies one for a chat-enabled flow, and its new `conversation_id` lets a caller continue a conversation instead of always starting a fresh one, which is the only way to test that an agent's memory works. - `flow-base.md` gains a Chat-Mode Flows section: wiring `provider` fields to flow inputs is what puts the model and thinking controls in the composer, and a fully static provider gives a chat that cannot change its model. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QN7VboDEm9HAB1t4sMxMdE
This commit is contained in:
co-authored by
Claude Opus 5
parent
2c79a2f143
commit
b40219652f
Generated
+44
-2
@@ -5252,9 +5252,51 @@ tool, \`websearch\` for web search.
|
||||
}
|
||||
\`\`\`
|
||||
|
||||
- \`provider\` is a static object, not a bare resource string: \`{ "kind": <provider kind>,
|
||||
- \`provider\` is an object, not a bare resource string: \`{ "kind": <provider kind>,
|
||||
"resource": "$res:<path>", "model": <model id> }\`. Required unless the module links to a saved
|
||||
agent through \`value.agent\`
|
||||
agent through \`value.agent\`. Static is right for a flow run from a form; a chat flow wires its
|
||||
fields to flow inputs instead — see below
|
||||
|
||||
### Chat-Mode Flows
|
||||
|
||||
A flow with \`value.chat_input_enabled: true\` is run from a chat instead of a form: the composer
|
||||
sends one message per turn and renders the conversation. It needs a required \`user_message\` string
|
||||
input, read by the agent.
|
||||
|
||||
**Wire the provider field by field, or the chat cannot change its model.** Each \`provider\` field fed
|
||||
by a flow input becomes a control in the composer — a provider picker, a model list, a thinking
|
||||
slider — while a field left static is fixed and shown read-only. \`user_attachments\` works the same
|
||||
way: point it at an s3-object input and the composer gets a paperclip.
|
||||
|
||||
\`\`\`json
|
||||
{
|
||||
"id": "chat_agent",
|
||||
"value": {
|
||||
"type": "aiagent",
|
||||
"input_transforms": {
|
||||
"provider": {
|
||||
"type": "javascript",
|
||||
"expr": "({ kind: 'anthropic', resource: '$res:f/ai/claude', model: flow_input.model, reasoning_effort: flow_input.thinking })"
|
||||
},
|
||||
"user_message": { "type": "javascript", "expr": "flow_input.user_message" },
|
||||
"user_attachments": { "type": "javascript", "expr": "flow_input.files" },
|
||||
"memory": { "type": "static", "value": { "kind": "auto", "context_length": 10 } },
|
||||
"streaming": { "type": "static", "value": true },
|
||||
"output_type": { "type": "static", "value": "text" }
|
||||
},
|
||||
"tools": []
|
||||
}
|
||||
}
|
||||
\`\`\`
|
||||
|
||||
- \`memory\` is what lets the agent see earlier turns; without it every message starts from nothing
|
||||
- \`streaming\` on makes the answer and its thinking appear token by token instead of all at once
|
||||
- Running one needs a \`memory_id\` **query parameter** — not a flow argument — naming the
|
||||
conversation the turn belongs to: a fresh UUID starts one, reusing a UUID continues it. The chat
|
||||
supplies it itself; a run driven any other way has to pass it or the server refuses the job
|
||||
- The provider expression must be one object literal whose values are literals or bare
|
||||
\`flow_input.x\` references. A spread, a call or a computed key leaves the composer unable to tell
|
||||
which input feeds which field, so it offers no control at all
|
||||
|
||||
### Tool Naming Rules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user