cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

File search API not available with Vertex AI

Open telolola opened this issue 1 month ago • 1 comments

Description of the bug:

The File Search API (file_search_stores) is marked as unavailable when using the Gemini client with Vertex AI authentication (vertexai=True).

This limitation blocks enterprise users who rely on Vertex AI service account authentication from using the File Search feature.

Actual vs expected behavior:

Tested using:

  • SDK: google-genai version 1.50.1
  • Python: 3.12
  • Region: us-central1

Steps to reproduce:

from google import genai
from google.genai import types
import os

# Setup service account authentication
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "/path/to/service-account.json"

# Initialize client with Vertex AI
client = genai.Client(
    vertexai=True,
    project="my-gcp-project",
    location="us-central1"
)

# Attempt to create File Search store
try:
    file_search_store = client.file_search_stores.create(
        config={'display_name': 'test-store'}
    )
except ValueError as e:
    print(e)
    # Output: "This method is only supported in the Gemini Developer client."

The file_search_stores.create(), upload_to_file_search_store(), and related File Search methods explicitly reject Vertex AI clients.

Any other information you'd like to share?

At a minimum, should cookbook state this limitation? The File Search documentation doesn't clearly indicate that this is a Gemini Developer API-only feature. The documentation shows how to initialize the client but doesn't mention the Vertex AI limitation.

e.g. prominent note at the top of the File Search docs:

⚠️ Note: File Search is currently only available with the Gemini Developer API (using API keys). It is not yet supported with Vertex AI authentication.

(unless I've missed this somewhere!)

telolola avatar Nov 17 '25 21:11 telolola

@mrinalghoshh Is there any way we can help to make the fileSearchStore api be supported when using the VertexAi api?

Thanks

mikiastilahun avatar Nov 20 '25 15:11 mikiastilahun

Hi @mikiastilahun,

The File Search API is currently available only via the Gemini API. I am creating a internal feature request for this issue. Thank you!

shmishra99 avatar Dec 03 '25 06:12 shmishra99

if you want to use a RAG platform through Vertex AI and the GenAI SDK, you can use Vertex AI Search.

I realise they are not identical but check it out if you need a RAG tool.

markmcd avatar Dec 05 '25 02:12 markmcd