kaxil commented on code in PR #71464:
URL: https://github.com/apache/airflow/pull/71464#discussion_r3764868500
##########
providers/anthropic/docs/operators/anthropic.rst:
##########
@@ -282,6 +282,60 @@ task's real outcome is preserved and a warning is logged.
session records instead. This is the same scenario as the retry warning
above, so
``retries=0`` keeps both problems away.
+Configuring the agent
+"""""""""""""""""""""
+
+Agent-level settings are not operator arguments: they belong to the agent,
which is created
+once and referenced by ID on every run.
+:meth:`~airflow.providers.anthropic.hooks.anthropic.AnthropicHook.create_agent`
forwards
+keyword arguments to the API unchanged, so these need no provider support.
+
+**Pinning the inference region.** Pass ``model`` as a config object instead of
a bare id to
+confine inference to one region:
+
+.. code-block:: python
+
+ hook.create_agent(
+ name="us-only-analyst",
+ model={"id": "claude-opus-4-8", "inference_geo": "us"},
+ )
+
+The accepted values are ``"us"`` and ``"global"``; anything else is rejected
with
+``400 inference_geo: must be one of ["global" "us"]``. When ``inference_geo``
is unset,
+requests fall through to the workspace's ``default_inference_geo``. On an
update, ``model``
+is whole-object replacement, so omitting ``inference_geo`` clears it rather
than preserving
+it.
+
+In a ``multiagent`` configuration the coordinator's pin and every roster
member's must all
+be set to the same value, or all be unset -- a mismatch is rejected. Following
both this and
+the roster example below on one agent is the easy way to trip that.
+
+**Adding an advisor.** A coordinator agent can consult a second model mid-turn
by adding an
+``advisor`` entry to its ``multiagent`` roster:
+
+.. code-block:: python
+
+ hook.create_agent(
+ name="coordinator",
+ model="claude-opus-4-8",
Review Comment:
Done, here and in the coordinator, the advisor entry, and the `create_agent`
docstring.
Checked both roles against the API rather than assuming, since advisor
eligibility is a separate policy from model availability: `claude-opus-5` is
accepted as the agent model with `inference_geo: "us"`, and as an `advisor`
entry in a coordinator roster.
Worth noting the provider's `DEFAULT_MODEL` is still `claude-opus-4-8`, so
these examples are now ahead of the default. That seems right for docs, but it
is a deliberate difference rather than an oversight.
##########
providers/anthropic/docs/operators/anthropic.rst:
##########
@@ -282,6 +282,60 @@ task's real outcome is preserved and a warning is logged.
session records instead. This is the same scenario as the retry warning
above, so
``retries=0`` keeps both problems away.
+Configuring the agent
+"""""""""""""""""""""
+
+Agent-level settings are not operator arguments: they belong to the agent,
which is created
+once and referenced by ID on every run.
+:meth:`~airflow.providers.anthropic.hooks.anthropic.AnthropicHook.create_agent`
forwards
+keyword arguments to the API unchanged, so these need no provider support.
+
+**Pinning the inference region.** Pass ``model`` as a config object instead of
a bare id to
+confine inference to one region:
+
+.. code-block:: python
+
+ hook.create_agent(
+ name="us-only-analyst",
+ model={"id": "claude-opus-4-8", "inference_geo": "us"},
+ )
+
+The accepted values are ``"us"`` and ``"global"``; anything else is rejected
with
+``400 inference_geo: must be one of ["global" "us"]``. When ``inference_geo``
is unset,
+requests fall through to the workspace's ``default_inference_geo``. On an
update, ``model``
+is whole-object replacement, so omitting ``inference_geo`` clears it rather
than preserving
+it.
+
+In a ``multiagent`` configuration the coordinator's pin and every roster
member's must all
+be set to the same value, or all be unset -- a mismatch is rejected. Following
both this and
+the roster example below on one agent is the easy way to trip that.
+
+**Adding an advisor.** A coordinator agent can consult a second model mid-turn
by adding an
+``advisor`` entry to its ``multiagent`` roster:
+
+.. code-block:: python
+
+ hook.create_agent(
+ name="coordinator",
+ model="claude-opus-4-8",
+ multiagent={
+ "type": "coordinator",
+ "agents": [
+ worker_agent_id,
+ {"type": "advisor", "model": "claude-opus-4-8"},
Review Comment:
Applied. Verified against the API that `claude-opus-5` is accepted as an
`advisor` roster entry, not just as an agent model -- advisor eligibility is a
separate policy, so it was worth the call rather than assuming.
--
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]