You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/08/31 08:08:56 UTC

(camel) branch quick-fix/vertex-ai-global-region-url created (now e2207318692e)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch quick-fix/vertex-ai-global-region-url
in repository https://gitbox.apache.org/repos/asf/camel.git


      at e2207318692e chore: fix Vertex AI global region URL in LlmClient

This branch includes the following new commits:

     new e2207318692e chore: fix Vertex AI global region URL in LlmClient

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: chore: fix Vertex AI global region URL in LlmClient

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch quick-fix/vertex-ai-global-region-url
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e2207318692e3b5e1915a410be13e507aec2f3aa
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 31 10:08:32 2026 +0200

    chore: fix Vertex AI global region URL in LlmClient
    
    CLOUD_ML_REGION=global must use the aiplatform.googleapis.com host with
    no region prefix; the region-prefixed host only applies to regional
    locations (e.g. us-east5). The unconditional prefix broke the TUI's
    F8 AI panel and camel ask/explain/harden when Vertex AI env vars were
    set to the global region.
    
    Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java
index 18d517badab5..94f94b788887 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java
@@ -1226,9 +1226,13 @@ public class LlmClient {
     private String resolveAnthropicUrl() {
         if (isVertexAi()) {
             String vertexModel = resolveVertexModel(model);
+            // The "global" location uses the global host with no region prefix;
+            // regional locations (e.g. us-east5) prefix the host with the region.
+            String host
+                    = "global".equals(vertexRegion) ? "aiplatform.googleapis.com" : vertexRegion + "-aiplatform.googleapis.com";
             return String.format(
-                    "https://%s-aiplatform.googleapis.com/v1/projects/%s/locations/%s/publishers/anthropic/models/%s:rawPredict",
-                    vertexRegion, vertexProjectId, vertexRegion, vertexModel);
+                    "https://%s/v1/projects/%s/locations/%s/publishers/anthropic/models/%s:rawPredict",
+                    host, vertexProjectId, vertexRegion, vertexModel);
         }
         String base = url != null ? url : DEFAULT_ANTHROPIC_URL;
         if (base.endsWith("/")) {