Skip to content

Commit 9092064

Browse files
mikecluckstainless-app[bot]
authored andcommitted
feat: vertex eu region (#1658)
1 parent 25b6c31 commit 9092064

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/anthropic/lib/vertex/_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def __init__(
121121
base_url = "https://aiplatform.googleapis.com/v1"
122122
elif region == "us":
123123
base_url = "https://aiplatform.us.rep.googleapis.com/v1"
124+
elif region == "eu":
125+
base_url = "https://aiplatform.eu.rep.googleapis.com/v1"
124126
else:
125127
base_url = f"https://{region}-aiplatform.googleapis.com/v1"
126128

tests/lib/test_vertex.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ def test_us_region_base_url(self) -> None:
129129
client = AnthropicVertex(region="us", project_id="test-project", access_token="fake-token")
130130
assert str(client.base_url).rstrip("/") == "https://aiplatform.us.rep.googleapis.com/v1"
131131

132+
def test_eu_region_base_url(self) -> None:
133+
"""Test that us region uses the correct base URL."""
134+
client = AnthropicVertex(region="eu", project_id="test-project", access_token="fake-token")
135+
assert str(client.base_url).rstrip("/") == "https://aiplatform.eu.rep.googleapis.com/v1"
136+
132137
@pytest.mark.parametrize("region", ["us-central1", "europe-west1", "asia-southeast1"])
133138
def test_regional_base_url(self, region: str) -> None:
134139
"""Test that regional endpoints use the correct base URL format."""

0 commit comments

Comments
 (0)