googleapis / googleapis/python-genai

Midsize PDF file yields Error 400: "The request's total referenced files bytes are too large to be read"

Aperta
#308 17 commenti 3 reazioni 1 assegnatario Assegnata a @jamg7 Vedi su GitHub
api: gemini-api documentation priority: p2 type: bug
Lingua principale
Python
Stelle
4k
Fork
1k
Merge medio
2g 12h
PR unite (30g)
41

Descrizione

#### Environment details

- Programming language: Python
- OS: Mac OS 15.3.
- Language runtime version: 3.10
- Package version: v.1.1.0

#### Steps to reproduce

I have a midsize PDF file with 160MB and 127 pages. I can successfully upload the PDF with `client.files.upload(file=pdf_path)`.

However, when I try to use the uploaded file in `client.models.generate_content()` I get this error:

`ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': "The request's total referenced files bytes are too large to be read", 'status': 'INVALID_ARGUMENT'}}`

My code works on the same PDF, when I shorten it to say 10 pages.

How can I fix this error and use the full PDF?

Thanks in advance for any help in this matter.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.