360 Secure SkillHub
360 安全技能中心

Gemini Assistant

通过命令行运行 handler.py,把文本或音频输入发送给 Google Gemini 模型并返回回答;返回的 JSON 中 text 为文本回复,音频模式会生成语音文件。需预先配置 GEMINI_API_KEY,并依赖 google-genai、numpy、soundfile、librosa 与 FFmpeg。

分类:知识
alimostafaradwan
alimostafaradwan
热度 45.39
最近更新 2026-05-17 12:32:15

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add alimostafaradwan/gemini-assistant
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
gemini-assistant
description
General-purpose AI assistant using Gemini API with voice and text support. Use when you need a smart AI assistant that can answer questions, have conversations, or help with general tasks using Google's Gemini models with audio/text capabilities.
metadata
{"openclaw":{"emoji":"🤖"}}

Gemini Assistant

A general-purpose AI assistant powered by Google's Gemini API. Supports both text and voice interactions.

Usage

Text Mode

cd ~/.openclaw/agents/kashif/skills/gemini-assistant && python3 handler.py "Your question or message"

Voice Mode

cd ~/.openclaw/agents/kashif/skills/gemini-assistant && python3 handler.py --audio /path/to/audio.ogg "optional context"

Response Format

The handler returns a JSON response:

{
  "message": "[[audio_as_voice]]\nMEDIA:/tmp/gemini_voice_xxx.ogg",
  "text": "Text response from Gemini"
}

Configuration

Set your Gemini API key:

export GEMINI_API_KEY="your-api-key-here"

Or create a .env file in the skill directory:

GEMINI_API_KEY=your-api-key-here

Model Options

The default model is gemini-2.5-flash-native-audio-preview-12-2025 for audio support.

To use a different model, edit handler.py:

MODEL = "gemini-2.0-flash-exp"  # For text-only

Requirements

  • google-genai>=1.0.0
  • numpy>=1.24.0
  • soundfile>=0.12.0
  • librosa>=0.10.0 (for audio input)
  • FFmpeg (for audio conversion)

Features

  • 🎙️ Voice input/output support
  • 💬 Text conversations
  • 🔧 Configurable system instructions
  • ⚡ Fast responses with Gemini Flash