Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ The agent includes:
3\. **Contributing guide**: A sample document uploaded to Gemini Files API and referenced via file_data

**Vertex AI:**
3\. **Research paper**: Gemma research paper from Google Cloud Storage via GCS file reference
4\. **AI research paper**: Same research paper accessed via HTTPS URL for comparison
3\. **Research paper**: Gemini research paper from Google Cloud Storage via GCS file reference
4\. **AI research paper**: Another Gemini research paper accessed via HTTPS URL for comparison

## Content Used

Expand All @@ -40,14 +40,14 @@ The agent includes:

**Vertex AI:**

- **Gemma Research Paper**: Research paper accessed via GCS URI (as `file_data`)
- GCS URI: `gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf`
- **Gemini Research Paper**: Research paper accessed via GCS URI (as `file_data`)
- GCS URI: `gs://cloud-samples-data/generative-ai/pdf/2507.06261.pdf`
- Demonstrates native GCS file access in Vertex AI
- PDF format with technical AI research content about Gemini 1.5
- **AI Research Paper**: Same research paper accessed via HTTPS URL (as `file_data`)
- **AI Research Paper**: Another research paper accessed via HTTPS URL (as `file_data`)
- HTTPS URL: `https://storage.googleapis.com/cloud-samples-data/generative-ai/pdf/2403.05530.pdf`
- Demonstrates HTTPS file access in Vertex AI
- Agent can discover these are the same document and compare access methods
- Agent can compare documents and selectively provide information from different documents

## Setup

Expand Down Expand Up @@ -103,7 +103,7 @@ python -m static_non_text_content.main --prompt "What reference materials do you

```bash
cd contributing/samples
python -m static_non_text_content.main --debug --prompt "What is the Gemma research paper about?"
python -m static_non_text_content.main --debug --prompt "What is the Gemini research paper about?"
```

## Default Test Prompts
Expand All @@ -120,7 +120,7 @@ The sample automatically runs test prompts when no `--prompt` is specified:
4\. "What does the contributing guide document say about best practices?"

**Vertex AI only (additional prompts):**
5\. "What is the Gemma research paper about and what are its key contributions?"
5\. "What is the Gemini research paper about and what are its key contributions?"
6\. "Can you compare the research papers you have access to? Are they related or different?"

**Gemini Developer API** tests: `inline_data` (image) + Files API `file_data` (uploaded document)
Expand Down
14 changes: 7 additions & 7 deletions contributing/samples/multimodal/static_non_text_content/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def create_static_instruction_with_file_upload():
types.Part(
file_data=types.FileData(
file_uri=(
"gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf"
"gs://cloud-samples-data/generative-ai/pdf/2507.06261.pdf"
),
mime_type="application/pdf",
display_name="Gemma Research Paper",
display_name="Gemini Research Paper",
)
)
)
Expand All @@ -96,14 +96,14 @@ def create_static_instruction_with_file_upload():
file_data=types.FileData(
file_uri="https://storage.googleapis.com/cloud-samples-data/generative-ai/pdf/2403.05530.pdf",
mime_type="application/pdf",
display_name="AI Research Paper (HTTPS)",
display_name="Gemini Research Paper (HTTPS)",
)
)
)

additional_text = (
" You also have access to a Gemma research paper from GCS"
" and an AI research paper from HTTPS URL."
" You also have access to a Gemini research paper from GCS"
" and another Gemini research paper from HTTPS URL."
)

else:
Expand Down Expand Up @@ -187,8 +187,8 @@ def create_static_instruction_with_file_upload():
instruction_text = """
When users ask questions, you should:
1. Use the reference chart above to provide context when discussing visual data or charts
2. Reference the Gemma research paper (from GCS) when discussing AI research, model architectures, or technical details
3. Reference the AI research paper (from HTTPS) when discussing research topics
2. Reference the Gemini research paper (from GCS) when discussing AI research, model architectures, or technical details
3. Reference the other Gemini research paper (from HTTPS) when discussing research topics
4. Be helpful and informative in your responses
5. Explain how the provided reference materials relate to their questions"""
else:
Expand Down