File search API not available with Vertex AI
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-genaiversion1.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!)
@mrinalghoshh Is there any way we can help to make the fileSearchStore api be supported when using the VertexAi api?
Thanks
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!
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.