logo
🤖 AI 工具

Gemini

Gemini Cheat Sheet - 快速参考指南,收录常用语法、命令与实践。

📂 分类 · AI 工具🧭 Markdown 速查🏷️ 3 个标签
#ai#google#multimodal
向下滚动查看内容
返回全部 Cheat Sheets

Overview

Model Versions
ModelFeaturesBest For
Gemini 2.0 FlashFast, multimodalDaily tasks, quick queries
Gemini 1.5 ProLong context (1M tokens)Document analysis, coding
Gemini UltraMost capableComplex reasoning
Key Capabilities
  • Text generation and editing
  • Code writing and debugging
  • Image understanding and generation
  • Document and PDF analysis
  • Google Workspace integration
  • Real-time web search
  • YouTube video summarization
Access Methods
  • gemini.google.com - Web interface
  • Gemini App - Mobile (iOS/Android)
  • Google AI Studio - Developer playground
  • Vertex AI - Enterprise API

Prompt Basics

Prompt Structure
CODE
滚动查看更多
[Context] [Task] [Format] [Constraints]
Example
CODE
滚动查看更多
You are a marketing expert.
Write 5 Instagram caption ideas for a coffee shop.
Use emojis and include hashtags.
Keep each under 150 characters.
Role Assignment
CODE
滚动查看更多
Act as a [role] with expertise in [domain].
Your task is to [specific task].
Output Formatting
CODE
滚动查看更多
Respond in the following format:
- Summary: (2-3 sentences)
- Key Points: (bullet list)
- Recommendation: (1 paragraph)

Google Extensions

Available Extensions
ExtensionFunction
Google FlightsSearch flights
Google HotelsFind accommodations
Google MapsLocation info, directions
YouTubeVideo summaries
Google WorkspaceDocs, Gmail, Drive
Using Extensions

Flights Search

CODE
滚动查看更多
@Google Flights Find flights from Sydney to Tokyo
next month, round trip, economy class

Hotel Search

CODE
滚动查看更多
@Google Hotels Find hotels in Melbourne CBD
for 2 nights, under $200/night, with pool

YouTube Summary

CODE
滚动查看更多
@YouTube Summarize this video:
[paste YouTube URL]
Workspace Integration

Gmail Search

CODE
滚动查看更多
@Gmail Find emails from John about the project
proposal from last week

Docs Summary

CODE
滚动查看更多
@Google Docs Summarize the main points from
my document "Q4 Marketing Plan"

Drive Search

CODE
滚动查看更多
@Google Drive Find spreadsheets related to
budget planning from this year

Prompting Techniques

Zero-Shot

Direct question without examples

CODE
滚动查看更多
What are the main differences between
REST and GraphQL APIs?
Few-Shot

Provide examples for pattern learning

CODE
滚动查看更多
Convert to formal language:

Casual: "Hey, can you help me out?"
Formal: "Would you be able to assist me?"

Casual: "That's awesome!"
Formal: "That is excellent."

Casual: "gonna grab some food"
Formal:
Chain of Thought

Step-by-step reasoning

CODE
滚动查看更多
Solve this problem step by step:

A store has 150 items. They sell 30% on Monday,
then receive 50 new items on Tuesday.
How many items do they have now?

Think through each step before answering.
Self-Consistency

Multiple reasoning paths

CODE
滚动查看更多
Analyze this business decision using three
different frameworks:
1. SWOT Analysis
2. Cost-Benefit Analysis
3. Risk Assessment

Then provide a unified recommendation.

Writing Prompts

Content Creation

Blog Post

CODE
滚动查看更多
Write a blog post about [topic]:
- Target audience: [audience]
- Tone: [casual/professional/technical]
- Length: approximately [X] words
- Include: introduction, main points, conclusion
- Add a compelling headline

Social Media

CODE
滚动查看更多
Create [number] social media posts about [topic]:
- Platform: [Instagram/Twitter/LinkedIn]
- Include relevant hashtags
- Add call-to-action
- Keep within character limits
Email Writing

Professional Email

CODE
滚动查看更多
Write a professional email:
- Purpose: [meeting request/follow-up/inquiry]
- Recipient: [role/relationship]
- Key points to cover: [list]
- Tone: [formal/friendly professional]
- Include subject line
Editing & Rewriting
CODE
滚动查看更多
Improve this text:
- Fix grammar and spelling
- Improve clarity and flow
- Maintain the original meaning
- Make it more engaging

Original: [paste text]

Code Prompts

Code Generation
CODE
滚动查看更多
Write a [language] function that:
- Input: [description]
- Output: [description]
- Requirements: [list requirements]
- Include error handling
- Add comments explaining the logic
Code Review
CODE
滚动查看更多
Review this code for:
1. Bugs and errors
2. Security vulnerabilities
3. Performance issues
4. Best practices
5. Readability improvements

```[language]
[paste code]
CODE
滚动查看更多
Debugging
CODE
滚动查看更多

Debug this code:

```[language]
[paste code]

Error message: [paste error] Expected behavior: [describe] Actual behavior: [describe]

CODE
滚动查看更多
Code Explanation
CODE
滚动查看更多

Explain this code in simple terms:

-   What does it do?
-   How does it work step by step?
-   What are the key concepts used?

```[language]
[paste code]
CODE
滚动查看更多

Analysis Prompts

Data Analysis
CODE
滚动查看更多

Analyze this data:
[paste data or describe dataset]

Provide:

1. Summary statistics
2. Key patterns and trends
3. Notable outliers
4. Actionable insights
5. Visualization suggestions

Document Analysis
CODE
滚动查看更多

Analyze this document and provide:

-   Executive summary (3-5 sentences)
-   Key findings
-   Important dates/numbers
-   Action items
-   Questions that need clarification

[paste document or upload]

Comparative Analysis
CODE
滚动查看更多

Compare [Option A] vs [Option B]:

-   Key similarities
-   Key differences
-   Pros and cons of each
-   Recommendation based on [criteria]

Image Prompts

Image Understanding
CODE
滚动查看更多

Analyze this image:

-   Describe what you see in detail
-   Identify any text
-   Note colors, composition, style
-   Suggest potential uses

Image Generation (Imagen)
CODE
滚动查看更多

Generate an image of:
[detailed description]

Style: [photorealistic/illustration/cartoon]
Mood: [bright/dark/professional]
Colors: [color palette]
Composition: [layout description]

Visual Content Ideas
CODE
滚动查看更多

Based on this image, suggest:

-   5 social media caption ideas
-   Related content themes
-   Color palettes to match
-   Similar visual styles to explore

Productivity Prompts

Meeting Preparation
CODE
滚动查看更多

Help me prepare for a meeting about [topic]:

-   Key talking points
-   Potential questions to expect
-   Data points to reference
-   Agenda suggestion
-   Follow-up action items template

Research Assistant
CODE
滚动查看更多

Research [topic] and provide:

-   Overview (2-3 paragraphs)
-   Key facts and statistics
-   Recent developments
-   Different perspectives
-   Reliable sources to explore further

Learning Helper
CODE
滚动查看更多

Teach me about [topic]:

-   Explain core concepts simply
-   Use real-world analogies
-   Provide practical examples
-   Common misconceptions
-   Practice questions to test understanding

Project Planning
CODE
滚动查看更多

Create a project plan for [project]:

-   Project phases and milestones
-   Task breakdown
-   Time estimates
-   Resource requirements
-   Risk factors and mitigation

API Usage

Python SDK
PYTHON
滚动查看更多
import google.generativeai as genai

genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel('gemini-1.5-pro')

response = model.generate_content("Hello!")
print(response.text)
With System Instruction
PYTHON
滚动查看更多
model = genai.GenerativeModel(
    'gemini-1.5-pro',
    system_instruction="You are a helpful coding assistant."
)

response = model.generate_content("Review my code")
Multi-Turn Chat
PYTHON
滚动查看更多
chat = model.start_chat(history=[])
response = chat.send_message("Hi, I need help with Python")
print(response.text)

response = chat.send_message("How do I read a file?")
print(response.text)
Image Input
PYTHON
滚动查看更多
import PIL.Image

image = PIL.Image.open('image.jpg')
response = model.generate_content([
    "Describe this image in detail",
    image
])
print(response.text)
Streaming
PYTHON
滚动查看更多
response = model.generate_content(
    "Write a story",
    stream=True
)
for chunk in response:
    print(chunk.text, end="")

Gemini Advanced Features

Long Context

Process up to 1 million tokens

CODE
滚动查看更多
Analyze this entire codebase/document:
[paste large content]

Identify:
- Overall structure
- Key components
- Dependencies
- Potential issues
Multimodal Input

Combine text, images, and documents

CODE
滚动查看更多
Look at this [image/document] and:
1. Summarize the content
2. Extract key information
3. Answer specific questions about it
4. Suggest improvements
Code Execution

Run Python code in responses

CODE
滚动查看更多
Calculate and show the result:
- Process this data: [data]
- Create a visualization
- Export the results

Keyboard Shortcuts

Web Interface
ShortcutAction
EnterSend message
Shift + EnterNew line
Ctrl + /Show shortcuts
Ctrl + Shift + CCopy response

Best Practices

Do's
  • Be specific and detailed
  • Provide context and examples
  • Use structured formatting
  • Break complex tasks into steps
  • Iterate and refine prompts
  • Verify important information
Don'ts
  • Share sensitive/personal data
  • Rely solely on AI for critical decisions
  • Use vague or ambiguous language
  • Expect perfect accuracy
  • Skip verification of facts
Tips for Better Results
CODE
滚动查看更多
1. Start with clear objectives
2. Provide relevant context
3. Specify desired format
4. Include constraints
5. Ask follow-up questions
6. Request explanations when needed

相关 Cheat Sheets

1v1免费职业咨询
logo

Follow Us

linkedinfacebooktwitterinstagramweiboyoutubebilibilitiktokxigua

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png

地址

Level 10b, 144 Edward Street, Brisbane CBD(Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
四川省成都市武侯区桂溪街道天府大道中段500号D5东方希望天祥广场B座45A13号
Business Hub, 155 Waymouth St, Adelaide SA 5000

Disclaimer

footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

匠人学院网站上的所有内容,包括课程材料、徽标和匠人学院网站上提供的信息,均受澳大利亚政府知识产权法的保护。严禁未经授权使用、销售、分发、复制或修改。违规行为可能会导致法律诉讼。通过访问我们的网站,您同意尊重我们的知识产权。 JR Academy Pty Ltd 保留所有权利,包括专利、商标和版权。任何侵权行为都将受到法律追究。查看用户协议

© 2017-2025 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572