Vertex AI Batch Mode, URL Context

Hi All,

I’m working as a small development team, using Gemini-2.5-flash via vertex AI. we’re currently working on batch processing some data, we’ve externally gathered URLs in our pipeline and we’re trying to feed these to Vertex for batches.

A single Gemini API call works (using Gemini on a single instance versus a JSONL batch), however we get the following error when trying the same payload with vertex.

Here’s a sample query:

{
  "request": {
    "contents": [
      {
        "parts": [
          {
            "text": "find me the latest news from apple https://www.apple.com/ "
          }
        ]
      }
    ],
    "tools": [
          {
              "url_context": {}
          }
      ]
    
  }
}

Below is the error payload.
'request.tools.url_context' with no fields at [1:1]

I’ve tried sifting through the api docs, and I’ve also looked at medium articles from April with similar payloads that worked historically but currently do not.

2 Likes

I also tried everything: Vertex AI, grounding, Google search. Then I tried the Google API in batch mode, but apparently the new SDK is failing.

The only way I get it to work is using the Gemini API without batch, so I easily hit the rate limit

Are you using python SDK? Maybe in JavaScript, Java, or Go works

I’m using a JSON payload and writing a JSONL file to a storage bucket to be run against vertex, unsure if since these features are experimental it’s not yet available in batch mode

Hello

Welcome to the Forum!!

Just to confirm, you are trying to use url_context tool in batch api call and you are getting error. I hope my understand is correct.

Would it be possible for you to share your file which you are using for batch call and your code, so that I can try to reproduce your issue to get more insights?