googleapis / googleapis/python-genai

Large PDF documents take too long to process

オープン
#809 コメント 5 件 リアクション 0 件 担当者 1 名 @Venkaiahbabuneelam が担当を希望しています GitHub で見る
api: gemini-api priority: p2 type: bug
主要言語
Python
スター
4k
フォーク
1k
平均マージ
2日 11時間
マージ済み PR(30日)
40

説明

Although there's a limit of 1000 pages for a PDF document, it becomes very difficult to use it starting after 300 pages. It takes too long for the API to return an answer (>3 minutes). I tried caching it and that also didn't seem to decrease latency. I found that very weird, since including a large file at gemini.google.com and asking something is much faster, usually returning an answer in less than 30s. Why is it that a request containing a large PDF takes too long in the API? Any tips on how to optimize the speed?

#### Environment details

- Programming language: Python
- OS: MacOS
- Language runtime version: 3.11
- Package version: 1.12.1

#### Steps to reproduce

```
chunk_1 = gemini_client.files.get(name="large_doc_part_1.pdf")
chunk_2 = gemini_client.files.get(name="large_doc_part_2.pdf")
response = gemini_client.models.generate_content(
model="gemini-2.5-pro-preview-05-06",
contents=[chunk_1, chunk_2, "Tell me something interesting about this document"],
)
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。