kaxil commented on code in PR #69003:
URL: https://github.com/apache/airflow/pull/69003#discussion_r3481873572


##########
providers/anthropic/docs/connections.rst:
##########
@@ -0,0 +1,106 @@
+ .. Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+ ..   http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+.. _howto/connection:anthropic:
+
+Anthropic Connection
+====================
+
+The `Anthropic <https://www.anthropic.com/>`__ connection type enables access 
to the Claude API
+through the official Anthropic Python SDK.
+
+Default Connection IDs
+----------------------
+
+The Anthropic hook points to the ``anthropic_default`` connection by default.
+
+Configuring the Connection
+--------------------------
+
+API Key
+    Your Anthropic API key. Required for the first-party API 
(``platform="anthropic"``),
+    and also used as the Microsoft Foundry API key (``platform="foundry"``, 
together with
+    the ``resource`` extra). Not required for the ``bedrock``, ``vertex`` or 
``aws``
+    platforms, which authenticate through the respective cloud provider's 
credential chain.
+
+Base URL (optional)
+    A custom base URL for the first-party API (for example, an LLM gateway or 
proxy).
+
+Extra (optional)
+    A JSON dictionary of additional parameters. All keys are optional:
+
+    * ``platform`` — which client to build: ``anthropic`` (default), 
``bedrock``, ``vertex``,
+      ``aws`` or ``foundry``.
+    * ``model`` — default model id used whenever an operator or hook call does 
not pass
+      ``model`` (e.g. ``hook.create_message(...)``, 
``hook.create_agent(...)``). Set it here
+      to change the model without editing DAGs; falls back to the provider 
default

Review Comment:
   Applied in 
[`260a157`](https://github.com/apache/airflow/pull/69003/commits/260a157f944e129f2857c147362e202856041f04).



##########
providers/anthropic/src/airflow/providers/anthropic/hooks/anthropic.py:
##########
@@ -0,0 +1,531 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import time
+from enum import Enum
+from functools import cached_property
+from typing import TYPE_CHECKING, Any, cast
+
+from anthropic import (
+    Anthropic,
+    AnthropicAWS,
+    AnthropicBedrock,
+    AnthropicFoundry,
+    AnthropicVertex,
+    IdentityTokenFile,
+    WorkloadIdentityCredentials,
+)
+
+from airflow.providers.anthropic.exceptions import (
+    AnthropicAgentSessionError,
+    AnthropicAgentSessionTimeout,
+    AnthropicBatchTimeout,
+    AnthropicError,
+)
+from airflow.providers.common.compat.sdk import BaseHook
+
+if TYPE_CHECKING:
+    from collections.abc import Iterable, Iterator
+
+    from anthropic.types import Message
+    from anthropic.types.beta import (
+        BetaEnvironment,
+        BetaManagedAgentsAgent,
+        BetaManagedAgentsSession,
+        environment_create_params,
+    )
+    from anthropic.types.beta.sessions import BetaManagedAgentsEventParams
+    from anthropic.types.messages import MessageBatch, 
MessageBatchIndividualResponse
+    from anthropic.types.messages.batch_create_params import Request
+
+#: Default model used when an operator or hook caller does not specify one.
+DEFAULT_MODEL = "claude-opus-4-8"

Review Comment:
   Applied in 
[`260a157`](https://github.com/apache/airflow/pull/69003/commits/260a157f944e129f2857c147362e202856041f04).,
 thanks.



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