kaxil commented on code in PR #70651:
URL: https://github.com/apache/airflow/pull/70651#discussion_r3707023594
##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm_branch.py:
##########
@@ -95,4 +111,38 @@ def execute(self, context: Context) -> str | Iterable[str]
| None:
else:
branches = str(output)
+ if self.require_approval:
+ self.defer_for_approval(context, branches) # type: ignore[misc]
Review Comment:
The single-branch dropdown is exactly it. Multi-branch mode still lands on
free text though -- `modification_schema` is `None` when
`allow_multiple_branches=True`, so the reviewer types raw JSON and a typo fails
at resume the same way. The UI can already render the better form:
`isFieldMultiSelect` in
`airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldSelector.tsx:82`
selects `FieldMultiSelect` for `{"type": "array", "enum": [...]}`. What blocks
it is two lines in the mixin -- `"value": output` stores the JSON string, and
`execute_complete` rejects a non-string `params_input["output"]` -- so an array
param needs the mixin to accept a list first. Reasonable to leave as a
follow-up if you'd rather not widen the mixin contract here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]