Lee-W commented on code in PR #74695:
URL: https://github.com/apache/airflow/pull/74695#discussion_r4374368841
##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm.py:
##########
@@ -214,12 +221,14 @@ class LLMOperator(CancellableAgentRunMixin, BaseOperator,
LLMApprovalMixin, Usag
connection does not silently switch off a control the author set.
Independent of
``require_approval``, which always asks. ``on_uncertain="review"``
needs Airflow 3.1+,
like ``require_approval``. Default ``None``: no gate, behaviour
unchanged.
- :param serialize_output: If ``True`` and ``output_type`` is a Pydantic
- ``BaseModel`` subclass, the model instance is dumped to a ``dict`` via
- ``model_dump()`` before being pushed to XCom. Default ``False`` --
- the Pydantic instance flows through XCom unchanged. Set to ``True``
- when a downstream consumer needs the dict shape (e.g. sending to an
- external system that expects JSON-style payloads).
+ :param serialize_output: If ``True``, a Pydantic ``BaseModel`` output, or a
+ list, tuple, set or dict holding models, is dumped to JSON-compatible
+ values with ``pydantic_core.to_jsonable_python`` before being pushed to
Review Comment:
Updated the `serialize_output` docstrings of `LLMOperator` and
`AgentOperator`, `structured_output.rst`, the operator pages and
`stability.rst`. All of them now describe the same three cases. `stability.rst`
no longer says Agent follows the same rules as `@task.llm`, since Agent does
not walk sets or dict keys. The `LLMOperator` row now mentions that `[MyModel,
int]` is pushed as a dict.
--
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]