Apollo 11

gemini-cookbookgemini-apiexamplesgemini
Copyright 2025 Google LLC.
[ ]

Prompting with an Apollo 11 transcript

This notebook provides a quick example of how to prompt Gemini using a text file. In this case, you'll use a 400 page transcript from Apollo 11.

[ ]

Setup your API key

To run the following cell, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you don't already have an API key, or you're not sure how to create a Colab Secret, see Authentication for an example.

[ ]

Download the transcript.

[ ]
--2025-03-04 11:48:01--  https://storage.googleapis.com/generativeai-downloads/data/a11.txt
Resolving storage.googleapis.com (storage.googleapis.com)... 74.125.135.207, 74.125.142.207, 74.125.195.207, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|74.125.135.207|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 847790 (828K) [text/plain]
Saving to: ‘a11.txt.1’

a11.txt.1           100%[===================>] 827.92K  --.-KB/s    in 0.008s  

2025-03-04 11:48:01 (107 MB/s) - ‘a11.txt.1’ saved [847790/847790]

Upload the file using the File API so its easier to pass it to the model later on.

[ ]
Uploading file...
Completed upload: https://generativelanguage.googleapis.com/v1beta/files/umcpmw8s1adm

Generate Content

After the file has been uploaded, you can make client.models.generate_content requests that reference the File API URI. Then you will ask the model to find a few lighthearted moments.

[ ]
MODEL_ID
Here are four lighthearted moments from the Apollo 11 air-to-ground voice transcription:

1.  **00 00 05 35 CDR: You sure sound clear down there, Bruce. Sounds like you're sitting in your living room.**
    **00 00 05 39 CC: Oh, thank you. You all are coming through beautifully, too.**
    *This exchange is light because the Commander compliments the CapCom on the clarity of his voice, suggesting a very relaxed and comfortable connection.*

2.  **00 00 54 13 CMP: And tell Glenn Parker down at the Cape that he lucked out.**
    **00 00 54 17 CC: Understand. Tell Glenn Parker he lucked out.**
    **00 00 54 22 CMP: Yes. He lucked out. He doesn't owe me a cup of coffee.**
    **00 00 54 26 CC: This is Houston. Roger. We'll pass it on.**
    *This is funny because they are saying they're saying someone "lucked out" and doesn't owe someone a cup of coffee. The phrase "lucked out" has a casual, playful feel, and the quick passing of a message involving coffee adds to it.*

3.  **00 01 29 27 LMP: Cecil B. deAldrin is standing by for instructions.**
    *Buzz Aldrin refers to himself in a mock-formal, theatrical way, referencing the famous director Cecil B. DeMille. This is humorous due to the contrast between the serious, high-tech mission and the melodramatic, old-Hollywood reference.*

4.  **00 04 28 45 CMP: I wanted to be 18 or 20 pounds above nominal, babe.**
    **00 04 28 49 CC: Sorry about that.**
    *There is a humorous use of the word babe as in what was supposed to be the intention.*

Delete File

Files are automatically deleted after 2 days or you can manually delete them using files.delete().

[ ]
DeleteFileResponse()

Learning more

The File API accepts files under 2GB in size and can store up to 20GB of files per project. Learn more about the File API here.