kaxil opened a new pull request, #62740:
URL: https://github.com/apache/airflow/pull/62740

   closes https://github.com/apache/airflow/issues/62738
   
   LLM-driven branching: the LLM decides which downstream task(s) to execute.
   
   **Operator:**
   ```python
   route = LLMBranchOperator(
       task_id="route_ticket",
       prompt="User says: 'My password reset email never arrived.'",
       llm_conn_id="my_llm",
       system_prompt="Route support tickets to the right team.",
   )
   route >> [handle_billing(), handle_auth(), handle_general()]
   ```
   
   **Decorator:**
   ```python
   @task.llm_branch(llm_conn_id="my_llm", system_prompt="Route tickets.")
   def route_ticket(message: str):
       return f"Route this ticket: {message}"
   ```
   
   **`allow_multiple_branches=True`** lets the LLM select more than one branch 
(`output_type=list[enum]`).
   
   Design decisions:
   - Empty `downstream_task_ids` raises `ValueError` early instead of letting 
pydantic-ai fail on an empty enum.
   
   related: #62598, #62599
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [ ] Yes


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