google-ai-studio

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google AI Studio Skill

Google AI Studio Skill

Overview

概述

Claude can use Google AI Studio at aistudio.google.com to test prompts, explore Gemini models, tune parameters, and prototype AI applications. Useful for prompt engineering, model comparison, and API experimentation.
Claude可以通过aistudio.google.com使用Google AI Studio来测试提示词、探索Gemini模型、调整参数以及构建AI应用原型。这在提示词工程、模型对比和API实验方面非常实用。

Quick Install

快速安装

bash
curl -sSL https://canifi.com/skills/google-ai-studio/install.sh | bash
Or manually:
bash
cp -r skills/google-ai-studio ~/.canifi/skills/
bash
curl -sSL https://canifi.com/skills/google-ai-studio/install.sh | bash
或者手动安装:
bash
cp -r skills/google-ai-studio ~/.canifi/skills/

Setup

设置

Configure via canifi-env:
bash
undefined
通过canifi-env进行配置:
bash
undefined

First, ensure canifi-env is installed:

首先,确保canifi-env已安装:

canifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefined
canifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefined

Privacy & Authentication

隐私与认证

Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭据,由你掌控。Canifi LifeOS尊重你的隐私。

Option 1: Manual Browser Login (Recommended)

选项1:手动浏览器登录(推荐)

If you prefer not to share credentials with Claude Code:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
  1. 使用CDP模式完成浏览器自动化设置
  2. 在Playwright控制的Chrome窗口中手动登录该服务
  3. Claude将使用你的已认证会话,且全程不会获取你的密码

Option 2: Environment Variables

选项2:环境变量

If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
注意:存储在canifi-env中的凭据仅能在你的本地机器上访问,绝不会被传输。

Capabilities

功能特性

  • Test prompts with different models
  • Adjust model parameters (temperature, tokens)
  • Create and save prompt templates
  • Test structured outputs
  • Explore model capabilities
  • Generate API code snippets
  • Test function calling
  • Create chat-based applications
  • Compare model outputs
  • Debug prompt issues
  • 使用不同模型测试提示词
  • 调整模型参数(温度、令牌数)
  • 创建并保存提示词模板
  • 测试结构化输出
  • 探索模型能力
  • 生成API代码片段
  • 测试函数调用
  • 创建基于对话的应用
  • 对比模型输出
  • 调试提示词问题

Usage Examples

使用示例

Example 1: Test Prompt

示例1:测试提示词

User: "Test this prompt in AI Studio with different temperatures"
Claude: Opens AI Studio, enters prompt, tests at temp 0.2, 0.7, 1.0.
        Returns: "Results comparison:
        Low temp: More focused, deterministic
        High temp: More creative, varied..."
用户:"在AI Studio中用不同的温度值测试这个提示词"
Claude:打开AI Studio,输入提示词,分别在温度0.2、0.7、1.0下测试。
        返回结果:"结果对比:
        低温度:更聚焦、确定性强
        高温度:更具创意、多样性强..."

Example 2: Generate API Code

示例2:生成API代码

User: "Get the API code for my prompt in Python"
Claude: Opens AI Studio, configures prompt, exports code.
        Returns Python code snippet ready for integration.
用户:"获取我的提示词对应的Python API代码"
Claude:打开AI Studio,配置提示词,导出代码。
        返回可直接用于集成的Python代码片段。

Example 3: Test Structured Output

示例3:测试结构化输出

User: "Test getting JSON output from Gemini"
Claude: Opens AI Studio, configures structured output schema,
        tests prompt. Returns: "Structured output working, here's the schema..."
用户:"测试从Gemini获取JSON输出"
Claude:打开AI Studio,配置结构化输出 schema,
        测试提示词。返回结果:"结构化输出正常工作,以下是对应的schema..."

Example 4: Model Comparison

示例4:模型对比

User: "Compare Gemini Pro vs Gemini Flash for my use case"
Claude: Tests same prompt on both models, compares:
        Speed, quality, cost considerations.
        Returns: "Recommendation: Flash for speed, Pro for complex reasoning"
用户:"针对我的使用场景对比Gemini Pro和Gemini Flash"
Claude:在两个模型上测试相同提示词,对比:
        速度、质量、成本考量。
        返回结果:"推荐:追求速度选Flash,处理复杂推理选Pro"

Authentication Flow

认证流程

  1. Claude navigates to aistudio.google.com via Playwright MCP
  2. Authenticates with GOOGLE_EMAIL if needed
  3. Handles 2FA if prompted (notifies user via iMessage)
  4. Accesses studio interface
  1. Claude通过Playwright MCP导航至aistudio.google.com
  2. 如有需要,使用GOOGLE_EMAIL进行认证
  3. 若触发双因素认证,将通过iMessage通知用户
  4. 访问Studio界面

AI Studio Workflow

AI Studio 工作流程

1. Navigate to aistudio.google.com
2. Create new prompt or open existing
3. Configure model and parameters
4. Enter prompt content
5. Run and evaluate output
6. Iterate on prompt
7. Export code or save template
1. 导航至aistudio.google.com
2. 创建新提示词或打开现有提示词
3. 配置模型和参数
4. 输入提示词内容
5. 运行并评估输出
6. 迭代优化提示词
7. 导出代码或保存模板

Selectors Reference

选择器参考

javascript
// New prompt button
'[aria-label="Create new prompt"]'

// Model selector
'.model-selector' or '[aria-label="Model"]'

// Temperature slider
'[aria-label="Temperature"]'

// Max tokens
'[aria-label="Maximum output tokens"]'

// Prompt input
'.prompt-input' or '[aria-label="Prompt"]'

// Run button
'[aria-label="Run"]'

// Output panel
'.output-panel'

// Get code button
'[aria-label="Get code"]'

// Save button
'[aria-label="Save"]'

// History panel
'.history-panel'
javascript
// 新建提示词按钮
'[aria-label="Create new prompt"]'

// 模型选择器
'.model-selector' or '[aria-label="Model"]'

// 温度滑块
'[aria-label="Temperature"]'

// 最大令牌数
'[aria-label="Maximum output tokens"]'

// 提示词输入框
'.prompt-input' or '[aria-label="Prompt"]'

// 运行按钮
'[aria-label="Run"]'

// 输出面板
'.output-panel'

// 获取代码按钮
'[aria-label="Get code"]'

// 保存按钮
'[aria-label="Save"]'

// 历史记录面板
'.history-panel'

Model Parameters

模型参数

Temperature: 0.0-2.0 (creativity vs consistency)
Max Output Tokens: Up to model limit
Top-P: 0.0-1.0 (nucleus sampling)
Top-K: Number of tokens to consider
Stop Sequences: Strings to stop generation
Safety Settings: Content filtering levels
Temperature: 0.0-2.0(创意性与一致性的平衡)
Max Output Tokens: 不超过模型限制
Top-P: 0.0-1.0(核采样)
Top-K: 考虑的令牌数量
Stop Sequences: 终止生成的字符串
Safety Settings: 内容过滤级别

Error Handling

错误处理

  • Login Failed: Retry 3 times, notify user via iMessage
  • Session Expired: Re-authenticate automatically
  • Model Not Available: Try alternative model, notify user
  • Rate Limited: Wait and retry with backoff
  • Prompt Too Long: Truncate or split, suggest alternatives
  • API Error: Retry, report error details
  • 登录失败:重试3次,通过iMessage通知用户
  • 会话过期:自动重新认证
  • 模型不可用:尝试替代模型,通知用户
  • 速率限制:等待后重试并使用退避策略
  • 提示词过长:截断或拆分,提供替代方案建议
  • API错误:重试,报告错误详情

Self-Improvement Instructions

自我优化说明

When you learn a better way to use Google AI Studio:
  1. Document the improvement in your response
  2. Suggest updating this skill file with the new approach
  3. Include specific parameter combinations that work well
  4. Note any new models or features available
当你掌握了使用Google AI Studio的更好方法时:
  1. 在回复中记录优化点
  2. 建议更新此技能文件以采用新方法
  3. 附上效果良好的具体参数组合
  4. 标注可用的新模型或功能

Notes

注意事项

  • AI Studio provides access to latest Gemini models
  • Free tier has usage limits; check quota
  • API keys generated here work with Gemini API
  • Tuned models can be created and saved
  • Supports text, image, and multimodal prompts
  • Code export available in Python, Node.js, cURL
  • History of prompts maintained for reference
  • Useful for prototyping before production deployment
  • AI Studio可访问最新的Gemini模型
  • 免费 tier 有使用限制,请查看配额
  • 在此生成的API密钥可用于Gemini API
  • 可创建并保存微调后的模型
  • 支持文本、图像和多模态提示词
  • 可导出Python、Node.js、cURL格式的代码
  • 保留提示词历史记录以供参考
  • 非常适合在生产部署前进行原型开发