googleapis / googleapis/python-genai

What is the context limit for the File Search API?

Open
#1,658 8 comments 0 reactions 1 assignee Assigned to @kkorpal View on GitHub
priority: p3 type: question
Dominant language
Python
Stars
4k
Forks
1k
Avg merge
2d 11h
Merged PRs (30d)
40

Description

Hello,

Excited to try out the File Search API. It seems like smaller size files work well, but when I have tried to upload a 175KB xlsx file with 3 sheets it struggles to import eventually throwing 2 kinds of errors:

- `Upload has already been terminated`
- `Failed to count tokens.`

If I remove 2 sheets it works. If I add back 1 sheet and a few rows to it, it also seems to work. Overall, across the 3 sheets it is about 308K characters. (Mix of Latin and Cyrillic). And I am simply using the default chunking.

It seems like I am hitting some quota somewhere (tokens/context), but cannot see it anywhere mentioned in the doc: https://ai.google.dev/gemini-api/docs/file-search which says it can process files up to 100MB in size.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.