Ir para o conteúdo

Lição 7 · Documents, Images and Video

Long Documents and Files

Upload documents to Gemini, ask questions answered from the file, handle long reports in steps, and verify quotes, numbers and page references.

One of the most practical uses of Gemini is reading: a 60-page report, a rental contract or a pile of survey comments. Gemini can accept files and answer questions about them. It can also skip a detail, mix up two sections or state something the file never says. This lesson shows how to get useful answers and how to check them.

Attaching files

In the app you can upload files from your device, add files from Google Drive (which needs history turned on and Google Workspace connected), or add a code folder or repository. As of December 2026, Google's help page lists up to 10 files per prompt, 100 MB for most file types and 2 GB for a video. Other limits apply to special cases, plans can change them, and a large file still has to fit the context available to you.

Ask grounded questions

A grounded answer is based on material you provide, not on general knowledge. Ask for that explicitly:

TEXT
Use only the attached report.
1. What are the three main findings?
2. For each, give the page or section and a short exact quote.
3. If the report does not answer a question, say "not in the report".

The quote and location are not proof. They are a way to check. Open the file, search for the quote and read the surrounding paragraph. A model can produce a quote that looks real but is slightly changed or invented.

Python Check that quotes really appear in the text

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The second quote adds "by half", which the document never says. A quick search catches it. The check only tests wording, so you still need to read the section to confirm the quote is used fairly.

Long documents in steps

For a long report, a single "summarize this" often gives a flat answer that follows the headings. Work in layers:

  1. Map: "List the sections with one line each."
  2. Focus: "In section 4, what evidence supports the main claim?"
  3. Challenge: "What limits or counter-evidence does the report mention?"
  4. Produce: "Write a one-page brief for a manager using only points from steps 2 and 3."

Place long pasted text before your question. In an API request, the same advice applies: give the context first and ask at the end.

Where long context struggles

A large context window lets Gemini take in a lot of material, but Google's own long-context guidance notes that finding many separate facts is harder than finding one, and results vary. In practice:

  • Ask for one kind of item at a time ("all deadlines", then "all payment terms").
  • Do not assume a list of "all" items is complete. Spot-check by searching the file.
  • For counts and totals, extract the rows and compute them with a spreadsheet or code.
Python Compute totals yourself instead of trusting a summary

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Gemini is good at helping you write such a script or formula. The calculation itself is more reliable when ordinary code or a spreadsheet does it.

Scans, tables and layout

Scanned pages, complex tables and text inside charts are harder than plain text. Check numbers from those against the original. Ask Gemini to point out any part it could not read, and rotate or rescan blurry pages first.

Comparing two documents

TEXT
I attached contract_v1 and contract_v2.
Make a table: Clause | Version 1 | Version 2 | What changed.
List only clauses whose meaning changed. Quote both versions.

To be sure nothing is missed, also compare the files with a document comparison tool, which finds every wording change. For legal, medical or financial documents, treat the AI result as a reading aid. A qualified person should make decisions that matter.

Before you upload

Question Why it matters
Am I allowed to share this file? Work documents may be confidential or regulated.
Does it contain personal data? Remove names and ID numbers you do not need.
Which account and plan am I using? Data handling differs.
Is the answer important? Decide how you will verify it first.

See privacy and personal data for ways to reduce sensitive data in prompts.

A worked reading plan

Imagine a 40-page rental agreement. You want to know what happens if you leave early. Instead of "Summarize this contract", ask in this order:

  1. "List every section heading that could affect ending the lease early."
  2. "For each of those sections, quote the sentence that sets a deadline, fee or condition."
  3. "Which of these depend on other sections or attachments? Name them."
  4. "Write questions I should ask the landlord. Do not give legal advice."

Then open the document and read the named sections yourself. Search for words such as "notice", "terminate" and "fee" to find passages the answer missed. Question 3 is worth asking because a rule in one section can be changed by an exception elsewhere. If an attachment is mentioned but not uploaded, the model cannot know what it says, so add it or treat that part as unknown.

Keep versions straight

Name files clearly before upload, and note the version you checked next to your results. If a document is updated, run your questions again instead of relying on the old summary.

Common mistake: assuming that an upload means the whole file was read carefully. If something matters, ask a question whose answer you already know and see whether Gemini finds it.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Why ask Gemini for quotes and section numbers?

    Quotes make checking practical, but you still need to check them.
  2. 2. What is the most reliable way to total many amounts from a file?

    Ordinary calculation tools do arithmetic reliably.
  3. 3. You ask for all deadlines in a long contract. What should you assume?

    Finding many separate items is harder than finding one.

Summary

  • Ask for answers grounded in your files, with quotes and locations you can check.
  • Work through long documents in layers: map, focus, challenge, produce.
  • Check completeness, and compute totals with reliable tools.
  • Decide whether you may upload a file before you upload it.

Next: Images, Audio, Video and Gemini Live

Seu progresso fica salvo neste navegador. Não precisa de conta.