YAshhh29 commented on PR #69812:
URL: https://github.com/apache/airflow/pull/69812#issuecomment-5038205026

   Done — ran the `text_format` path end-to-end against the real OpenAI 
Responses API. Thanks @kaxil for the nudge to verify live.
   
   **Environment:** Airflow standalone (this branch, 
`feature/openai-structured-outputs`) with the branch `openai` provider 
installed, `LocalExecutor`, real OpenAI account (`api.openai.com`), default 
model `gpt-4o-mini`.
   
   **Sample DAG** (`openai_structured_smoke`) — one `OpenAIResponseOperator` 
task with a Pydantic `text_format`:
   
   ```python
   class Person(BaseModel):
       name: str
       age: int
   
   OpenAIResponseOperator(
       task_id="extract_person",
       conn_id="openai_default",
       model="gpt-4o-mini",
       input_text="Extract the name and age from: 'Alice is 30 years old.'",
       text_format=Person,
   )
   
   Result: the task succeeds and pushes the parsed structured output to XCom as 
a plain dict — {"name": "Alice", "age": 30} — no manual serialization, exactly 
the flow this PR adds. gpt-4o-mini (the default) handled structured outputs 
fine, matching your note about dropping the specific-model claim.
   
   1. Status — Grid (success): extract_person → success, Operator 
OpenAIResponseOperator.
   
   <img width="1420" height="473" alt="Screenshot 2026-07-22 004139" 
src="https://github.com/user-attachments/assets/1248f9fa-9253-48b0-8b8d-79aea9758ee4";
 />
   
   2. Logs (UI): task log showing the connection retrieval and Generated 
response resp_… from the operator.
   
   
   <img width="1431" alt="Task logs" 
src="https://github.com/user-attachments/assets/25928f3b-f62c-42d5-9d4e-85612c076a75";
 />
   
   4. XCom: return_value = {"name": "Alice", "age": 30} — the structured dict.
   
   <img width="1420" alt="XCom return_value" 
src="https://github.com/user-attachments/assets/e8402f3d-0caa-4aee-b13b-a7dbbfa288ad";
 />
   
   5. Terminal (airflow dags test): explicit proof of the real call — POST 
https://api.openai.com/v1/responses "HTTP/1.1 200 OK" followed by SetXCom(... 
value={'name': 'Alice', 'age': 30} ...) and state=success.
   
   <img width="1682" alt="Terminal 200 OK" 
src="https://github.com/user-attachments/assets/ca938af9-255b-4c9c-a2d7-d6b621181843";
 />
   
   


-- 
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]

Reply via email to