Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

rig钻机

Agent Skill

rig 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

816

周安装

33

GitHub Stars

6,939

下载量

256
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rig(钻机)
来源仓库:https://github.com/0xplaygrounds/rig
仓库路径:skills/rig
安装命令:
npx skills add https://github.com/0xplaygrounds/rig --skill rig
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/0xplaygrounds/rig --skill rig

简介

rig 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 它可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装方式:github,使用 npx skills add 命令添加指定仓库的 skill。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • rig 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Building with Rig

Rig is a Rust library for building LLM-powered applications with a provider-agnostic API. All patterns use the builder pattern and async/await via tokio.

Quick Start

use rig::completion::Prompt;
use rig::providers::openai;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let client = openai::Client::from_env();

    let agent = client
        .agent(openai::GPT_4O)
        .preamble("You are a helpful assistant.")
        .build();

    let response = agent.prompt("Hello!").await?;
    println!("{}", response);
    Ok(())
}

Core Patterns

1. Simple Agent

let agent = client.agent(openai::GPT_4O)
    .preamble("System prompt")
    .temperature(0.7)
    .max_tokens(2000)
    .build();

let response = agent.prompt("Your question").await?;

2. Agent with Tools

Define a tool by implementing the Tool trait, then attach it:

let agent = client.agent(openai::GPT_4O)
    .preamble("You can use tools.")
    .tool(MyTool)
    .build();

See references/tools.md for the full Tool trait signature.

3. RAG (Retrieval-Augmented Generation)

let embedding_model = client.embedding_model(openai::TEXT_EMBEDDING_ADA_002);
let index = vector_store.index(embedding_model);

let agent = client.agent(openai::GPT_4O)
    .preamble("Answer using the provided context.")
    .dynamic_context(5, index)  // top-5 similar docs per query
    .build();

See references/rag.md for vector store setup and the Embed derive macro.

4. Streaming

use futures::StreamExt;
use rig::streaming::StreamedAssistantContent;
use rig::agent::prompt_request::streaming::MultiTurnStreamItem;

let mut stream = agent.stream_prompt("Tell me a story").await?;

while let Some(chunk) = stream.next().await {
    match chunk? {
        MultiTurnStreamItem::StreamAssistantItem(
            StreamedAssistantContent::Text(text)
        ) => print!("{}", text.text),
        MultiTurnStreamItem::FinalResponse(resp) => {
            println!("\n{}", resp.response());
        }
        _ => {}
    }
}

5. Structured Extraction

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, JsonSchema)]
struct Person {
    pub name: Option<String>,
    pub age: Option<u8>,
}

let extractor = client.extractor::<Person>(openai::GPT_4O).build();
let person = extractor.extract("John is 30 years old.").await?;

6. Chat with History

use rig::completion::Chat;

let history = vec![
    Message::from("Hi, I'm Alice."),
    // ...previous messages
];
let response = agent.chat("What's my name?", history).await?;

Agent Builder Methods

MethodDescription
.preamble(str)Set system prompt
.context(str)Add static context document
.dynamic_context(n, index)Add RAG with top-n retrieval
.tool(impl Tool)Attach a callable tool
.tools(Vec<Box<dyn ToolDyn>>)Attach multiple tools
.temperature(f64)Set temperature (0.0-1.0)
.max_tokens(u64)Set max output tokens
.additional_params(json!{...})Provider-specific params
.tool_choice(ToolChoice)Control tool usage
.build()Build the agent

Available Providers

Create a client with ProviderName::Client::from_env() or ProviderName::Client::new("key").

ProviderModuleExample Model Constant
OpenAIopenaiGPT_4O, GPT_4O_MINI
AnthropicanthropicCLAUDE_4_OPUS, CLAUDE_4_SONNET
CoherecohereCOMMAND_R_PLUS
MistralmistralMISTRAL_LARGE
Geminigeminimodel string
Groqgroqmodel string
Ollamaollamamodel string
DeepSeekdeepseekmodel string
xAIxaimodel string
Togethertogethermodel string
Perplexityperplexitymodel string
OpenRouteropenroutermodel string
HuggingFacehuggingfacemodel string
Azureazuredeployment string
Hyperbolichyperbolicmodel string
Galadrielgaladrielmodel string
Moonshotmoonshotmodel string
Miramiramodel string
Voyage AIvoyageaiembeddings only

Vector Store Crates

BackendCrate
In-memoryrig-core (built-in)
MongoDBrig-mongodb
LanceDBrig-lancedb
Qdrantrig-qdrant
SQLiterig-sqlite
Neo4jrig-neo4j
Milvusrig-milvus
SurrealDBrig-surrealdb

Root facade usage:

rig = { version = "...", features = ["lancedb", "fastembed"] }

Feature-gated integration modules are re-exported from the root crate, for example rig::lancedb and rig::fastembed.

Key Rules

  • All async code runs on tokio.
  • Use WasmCompatSend / WasmCompatSync instead of raw Send / Sync for WASM compatibility.
  • Use proper error types with thiserror — never Result<(), String>.
  • Avoid .unwrap() — use ? operator.

Further Reference

Detailed API documentation (available when installed via Claude Code skills):

  • tools — Tool trait, ToolDefinition, ToolEmbedding, attachment patterns
  • rag — Vector stores, Embed derive, EmbeddingsBuilder, search requests
  • providers — Provider-specific initialization, model constants, env vars
  • patterns — Multi-agent, hooks, streaming details, chaining, extraction

For the full reference, see the Rig examples at examples/ or https://docs.rig.rs

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.06%
按下载量换算95

Claude

29.51%
按下载量换算76

Cursor

15.96%
按下载量换算41

Gemini CLI

9.75%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills