gemini3pro

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gemini 3 Pro Text & Vision

Gemini 3 Pro 文本与视觉功能

Usage

使用方法

Run from the user's current working directory (do NOT cd into the skill directory):
Text generation:
bash
uv run scripts/query_gemini.py --prompt "your question" [--system-prompt "instructions"] [--output "response.md"] [--api-key KEY]
Image analysis (vision):
bash
uv run scripts/query_gemini.py --prompt "describe this image" --image "path/to/image.png" [--output "analysis.md"] [--api-key KEY]
从用户当前工作目录运行(请勿切换到skill目录):
文本生成:
bash
uv run scripts/query_gemini.py --prompt "your question" [--system-prompt "instructions"] [--output "response.md"] [--api-key KEY]
图像分析(视觉处理):
bash
uv run scripts/query_gemini.py --prompt "describe this image" --image "path/to/image.png" [--output "analysis.md"] [--api-key KEY]

Parameters

参数说明

  • --prompt
    /
    -p
    (required): Question, task, or instructions
  • --image
    /
    -i
    : Path to image for vision analysis (jpg, png, webp, gif)
  • --system-prompt
    /
    -s
    : System instructions to set context/persona
  • --output
    /
    -o
    : Save response to file (always prints to stdout too)
  • --api-key
    /
    -k
    : API key (overrides
    GRSAI_API_KEY
    env var)
  • --prompt
    /
    -p
    (必填):问题、任务或指令
  • --image
    /
    -i
    :视觉分析所用图像的路径(支持jpg、png、webp、gif格式)
  • --system-prompt
    /
    -s
    :用于设置上下文/角色的系统指令
  • --output
    /
    -o
    :将响应保存到文件(同时始终输出到stdout)
  • --api-key
    /
    -k
    :API密钥(会覆盖
    GRSAI_API_KEY
    环境变量)

API Key

API密钥

Provide via
--api-key
argument or set
GRSAI_API_KEY
environment variable.
可通过
--api-key
参数提供,或设置
GRSAI_API_KEY
环境变量。

Troubleshooting

故障排除

SymptomResolution
Error: No API key provided.
Set
GRSAI_API_KEY
env var or pass
--api-key
Error: Image not found:
Wrong path or unreadable file; verify the path exists
HTTP 401Wrong or expired API key
Unexpected response format
API error; check prompt for policy violations
uv: command not found
Install:
curl -LsSf https://astral.sh/uv/install.sh | sh
, then restart terminal
For transient errors (HTTP 429, network timeouts), the script retries automatically up to 3 times. If retries are exhausted, surface the error to the user.
症状解决方法
Error: No API key provided.
设置
GRSAI_API_KEY
环境变量,或传入
--api-key
参数
Error: Image not found:
路径错误或文件不可读;请验证路径是否存在
HTTP 401API密钥错误或已过期
Unexpected response format
API错误;检查提示内容是否违反政策
uv: command not found
安装方法:
curl -LsSf https://astral.sh/uv/install.sh | sh
,然后重启终端
对于临时错误(HTTP 429、网络超时),脚本会自动重试最多3次。若重试后仍失败,则向用户显示错误信息。

Output

输出

Print the response to stdout. Optionally save to file with
--output
. Do not pipe output unless the user asks.
将响应输出到stdout。可通过
--output
参数选择性保存到文件。除非用户要求,否则请勿通过管道传输输出。

Examples

示例

bash
uv run scripts/query_gemini.py --prompt "Explain the difference between TCP and UDP in simple terms"
bash
uv run scripts/query_gemini.py --prompt "What objects are in this image?" --image "photo.jpg" --output "analysis.md"
bash
uv run scripts/query_gemini.py --prompt "Explain the difference between TCP and UDP in simple terms"
bash
uv run scripts/query_gemini.py --prompt "What objects are in this image?" --image "photo.jpg" --output "analysis.md"