# Files - can I refer to/send two files in the same call?

**URL:** <https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791>\
**Category:** Gemini API\
**Tags:** api\
**Created:** [March 7, 2025, 2:51pm UTC](https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791 "2025-03-07T14:51:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robo](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@robo](https://discuss.ai.google.dev/u/robo)\
**Post date:** [March 7, 2025, 2:51pm UTC](https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791/1 "2025-03-07T14:51:50Z")

</div>

I have to files. A pdf with exercises and a pdf with solutions.  
I would like to send both files in one call.  
So, I’d give one file the name “exercises” and the other “solutions” and would include that logic in the prompt.  
Something like this:

```auto
files = client_gemini.files.upload(file=[file_exercises, file_solutions], config={'display_name': ["exercises", "solutions"]})

```

Why not just append it to one file?  
I want to extract questions from the file with their solutions. The solutions are at the very end of the document. When I send it as one file, gemini gets confused and extracts the questions from the solution part too instead of mapping it to the exercises… and yes, the pdf is rather clear when it comes to solutions as on every solution pages it says SOLUTIONS. And also the chapter begins with the title “Solutions”.

---

<div class="post-metadata">

**Author:** ![GUNAND\_MAYANGLAMBAM](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/gunand_mayanglambam/32/4964_2.png) [@GUNAND\_MAYANGLAMBAM](https://discuss.ai.google.dev/u/GUNAND_MAYANGLAMBAM)\
**Post date:** [March 10, 2025, 8:58am UTC](https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791/3 "2025-03-10T08:58:41Z")

</div>

Hi @robo , Welcome to the forum.

I guess we can upload only one file at a time using the FileAPI. Instead, you can use `generate_content` method to process multiple files.

```auto
response = client.models.generate_content(
  model=model_name,
  contents=[prompt1, sample_pdf_1, sample_pdf_2, prompt2])

```

---

<div class="post-metadata">

**Author:** ![robo](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@robo](https://discuss.ai.google.dev/u/robo)\
**Post date:** [March 14, 2025, 8:51am UTC](https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791/5 "2025-03-14T08:51:53Z")

</div>

Hi, thanks! Ah, so I would not used the “files API”? Does it accept the same file types as the files API?

```auto
PDF - application/pdf
JavaScript - application/x-javascript, text/javascript
Python - application/x-python, text/x-python
TXT - text/plain
HTML - text/html
CSS - text/css
Markdown - text/md
CSV - text/csv
XML - text/xml
RTF - text/rtf

```

---

<div class="post-metadata">

**Author:** ![GUNAND\_MAYANGLAMBAM](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/gunand_mayanglambam/32/4964_2.png) [@GUNAND\_MAYANGLAMBAM](https://discuss.ai.google.dev/u/GUNAND_MAYANGLAMBAM)\
**Post date:** [March 17, 2025, 6:44am UTC](https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791/7 "2025-03-17T06:44:09Z")

</div>

You can use the file API to upload individual files and process multiple files in a single request. Here is the example documentation [link](https://ai.google.dev/gemini-api/docs/document-processing?lang=python#prompt-multiple).

---

<div class="post-metadata">

**Author:** ![jkirstaetter](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/jkirstaetter/32/61_2.png) [@jkirstaetter](https://discuss.ai.google.dev/u/jkirstaetter)\
**Post date:** [March 17, 2025, 6:58am UTC](https://discuss.ai.google.dev/t/files-can-i-refer-to-send-two-files-in-the-same-call/70791/8 "2025-03-17T06:58:46Z")

</div>

Hi @robo

Welcome to the forum.

Yes, you can add multiple `inlineData` parts into your request. Depending on the size of files there is no need to use the File API. But there are constraints, like max. 20 MB file size, etc.

See here: [Explore vision capabilities with the Gemini API &nbsp;|&nbsp; Google AI for Developers](https://ai.google.dev/gemini-api/docs/vision?lang=python#image-input)  
and here: [Explore vision capabilities with the Gemini API &nbsp;|&nbsp; Google AI for Developers](https://ai.google.dev/gemini-api/docs/vision?lang=python#multiple-images)

Cheers
