Skip to content

Document the dynamic system_prompt pattern for common-ai agents#69636

Merged
gopidesupavan merged 2 commits into
apache:mainfrom
jason810496:docs/common-ai/dynamic-system-prompt
Jul 10, 2026
Merged

Document the dynamic system_prompt pattern for common-ai agents#69636
gopidesupavan merged 2 commits into
apache:mainfrom
jason810496:docs/common-ai/dynamic-system-prompt

Conversation

@jason810496

Copy link
Copy Markdown
Member

Why

system_prompt on AgentOperator/LLMOperator (and @task.agent/@task.llm) is a templated field, but the provider docs only mention this in passing — there's no worked example showing it templated from an upstream task's XCom, a common pattern for tailoring an agent's instructions to an earlier classification.

What

  • Add a "Dynamic System Prompt" section to docs/operators/agent.rst, backed by a new example DAG function (example_agent_dynamic_system_prompt) in example_dags/example_agent.py that Jinja-templates system_prompt from a classify task's XCom.
  • Add a one-line seealso cross-reference in docs/operators/llm.rst, since @task.llm templates system_prompt identically.

Was generative AI tooling used to co-author this PR?

@gopidesupavan
gopidesupavan merged commit 66b23a6 into apache:main Jul 10, 2026
83 checks passed
joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
…ache#69636)

* Document dynamic system_prompt pattern for common-ai agents

* Address review nits in dynamic system_prompt example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants