kaxil commented on code in PR #76975:
URL: https://github.com/apache/airflow/pull/76975#discussion_r4649425949
##########
providers/common/ai/src/airflow/providers/common/ai/batch/pydantic_ai_backend.py:
##########
@@ -809,6 +928,164 @@ def extract_output(self, raw: RawResultItem, spec:
OutputSpec) -> ExtractedOutpu
return ExtractedOutput(kind="absent")
+class OpenAIBatchAdapter(PydanticAIBatchAdapter):
+ """
+ Batch adapter for OpenAI's Batch API, on the Responses API
(``/v1/responses``).
+
+ pydantic-ai batches only its Responses model, so an ``openai-chat:`` model
id is built as the
+ ``openai:`` model of the same name and logged. Azure OpenAI has no
adapter. A batch's group
+ includes the model, so every request must use the same one. Raw Responses
fields in
+ ``request_params`` (``user``, ``metadata``, ...) go through
``extra_body``; the typed form of
+ a setting is preferred where one exists (``openai_reasoning_effort``, not
``reasoning_effort``).
Review Comment:
Done: `reasoning_effort`, `verbosity` and `logprobs` now fail before
submission, naming the Responses setting to use. Those are the Chat-only keys
with a typed equivalent in pydantic-ai 2.66; the rest are already managed or
rejected.
--
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]