Commit a92672619ff3
Changed files (1)
tools
readwise-reader
tools/readwise-reader/readwise-reader.py
@@ -183,7 +183,10 @@ def _call_vertex_claude(model_id, prompt, max_tokens):
import requests
project = os.environ.get("GOOGLE_CLOUD_PROJECT", "itpc-gcp-pnd-pe-eng-claude")
location = os.environ.get("GOOGLE_CLOUD_LOCATION", "global")
- url = f"https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/anthropic/models/{model_id}:rawPredict"
+ if location == "global":
+ url = f"https://aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/anthropic/models/{model_id}:rawPredict"
+ else:
+ url = f"https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/anthropic/models/{model_id}:rawPredict"
for attempt in range(MAX_RETRIES):
token = _get_vertex_token()
try: