← 返回 Skills 市场
guoxh

Gemini Citation

作者 guoxh · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
216
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install gemini-citation
功能描述
Conduct evidence-based research with exact, accurate APA citations using the Gemini API's 'scientific citation' (Google Search grounding) feature. Use when X...
使用说明 (SKILL.md)

Gemini Citation

Overview

This skill leverages the Gemini API's Google Search Grounding feature to return heavily factual, exact evidence directly tied to search results, along with properly formatted APA inline and trailing citations. It guarantees that generated facts are grounded in live web references rather than model hallucinations.

Quick Start

You can use the provided script to query the Gemini API with search grounding enabled.

1. Requirements

Ensure the GEMINI_API_KEY is set in your environment and the google-genai package is installed:

export GEMINI_API_KEY="your-api-key"
pip install google-genai

2. Running a Research Query

Execute the gemini_cite.py script with your research topic. The script automatically forces the Gemini API to use Google Search Grounding and requests strict APA formatting.

python scripts/gemini_cite.py "Recent breakthroughs in solid-state battery technology"

To see structured JSON output containing the exact source titles and URIs used by the model:

python scripts/gemini_cite.py "Recent breakthroughs in solid-state battery technology" --format json

How It Works

  1. Google Search Grounding: The API call is configured with tools=[{"google_search": {}}]. This forces the model to fetch live information before generating a response.
  2. Strict APA Instructions: The script's prompt injects an explicit requirement to use "Author, Year" inline citations and to list all references in proper APA format at the end.
  3. Grounding Metadata Verification: The script extracts the grounding_chunks from the Gemini API response metadata and displays the exact source URLs and titles that the model used, ensuring that you have an auditable list of sources alongside the generated APA citations.

When to Use

  • Literature Reviews: When Xiaoyan is tasked with gathering current state-of-the-art information on a technical or scientific topic.
  • Fact-Checking: When you need exact evidence and verifiable URLs rather than general knowledge.
  • Academic Writing: When strict APA formatting and inline citations are a requirement for the final output.

Resources

scripts/

  • gemini_cite.py: A Python CLI tool that handles the Gemini API call, enables Google Search grounding, enforces APA citations, and parses the grounding metadata to output verifiable source links.

Advanced Usage

If you prefer to write your own API scripts, the core pattern for enabling exact citations with google-genai is:

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model='gemini-2.5-pro',
    contents='Your research query here...',
    config=types.GenerateContentConfig(
        tools=[{"google_search": {}}]
    )
)

# Access sources
for chunk in response.candidates[0].grounding_metadata.grounding_chunks:
    print(chunk.web.title, chunk.web.uri)
安全使用建议
This skill appears to do what it claims: it calls Google's Gemini (via the google-genai SDK) with search grounding and extracts grounding metadata to show source URLs and produce APA citations. Before installing or running it, protect your GEMINI_API_KEY like any secret (do not paste it into untrusted pages), be aware that queries go to Google's API (may incur cost and send your prompts), and verify you trust the skill author if you plan to use a long-lived key. Also review returned source URLs yourself — the tool surfaces them, but you should validate sources for academic or sensitive work.
功能分析
Type: OpenClaw Skill Name: gemini-citation Version: 1.0.2 The gemini-citation skill is a legitimate research tool designed to provide evidence-based answers using the Gemini API's Google Search grounding feature. The Python script (scripts/gemini_cite.py) correctly implements the official google-genai library, handles API keys via environment variables, and focuses solely on generating APA-cited content and displaying source metadata. No indicators of data exfiltration, malicious execution, or harmful prompt injection were found.
能力评估
Purpose & Capability
Name/description ask for Gemini search-grounded citations; the skill only requires python3 and GEMINI_API_KEY and includes a script that calls the google-genai client with tools=[{"google_search":{}}], which matches the stated purpose.
Instruction Scope
SKILL.md instructs installing google-genai, setting GEMINI_API_KEY, and running the included CLI script. The instructions do not ask the agent to read unrelated files, access other env vars, or transmit data to unexpected endpoints.
Install Mechanism
No automated install spec is provided (instruction-only). The user is told to pip install google-genai; no downloads from untrusted URLs or archive extraction are present.
Credentials
Only GEMINI_API_KEY is required and is the primary credential. No other secrets or unrelated environment variables are requested or accessed by the script.
Persistence & Privilege
The skill is not always-on and does not modify other skills or system-wide settings. It runs as a user-invoked CLI and does not request elevated persistence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gemini-citation
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gemini-citation 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Removed suspicious docstring and _meta.json
v1.0.1
Added docstring, shebang, and version flag. Clarified safe open-source research utility.
v1.0.0
Initial release: Research assistant skill with Google Search Grounding and APA citations.
元数据
Slug gemini-citation
版本 1.0.2
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 3
常见问题

Gemini Citation 是什么?

Conduct evidence-based research with exact, accurate APA citations using the Gemini API's 'scientific citation' (Google Search grounding) feature. Use when X... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 216 次。

如何安装 Gemini Citation?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gemini-citation」即可一键安装,无需额外配置。

Gemini Citation 是免费的吗?

是的,Gemini Citation 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gemini Citation 支持哪些平台?

Gemini Citation 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gemini Citation?

由 guoxh(@guoxh)开发并维护,当前版本 v1.0.2。

💬 留言讨论