0xPlaygrounds / 0xPlaygrounds/rig-docs

docs.rig.rs examples out of sync with rig-core 0.36.0 (from_env Result + cli_chatbot usage)

オープン 初心者向け
#87 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
MDX
スター
20
フォーク
24
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi! I just started experimenting with Rig and ran into a couple docs examples that do not compile for me.

I am using `rig-core = 0.36.0`.

## 1) Quickstart example: `Client::from_env()` result is not handled

Page: `https://docs.rig.rs/docs/quickstart/getting_started`

Current snippet:

```rust
use rig::client::{CompletionClient, ProviderClient};
use rig::completion::Prompt;
use rig::providers::openai;

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

// Create agent with a single context prompt
let comedian_agent = client
.agent("gpt-5.2")
.preamble("You are a comedian here to entertain the user using humour and jokes.")
.build();

// Prompt the agent and print the response
let response = comedian_agent.prompt("Entertain me!").await?;

println!("{response}");

Ok(())
}
```

`Client::from_env()` returns `Result`, so this would need a `?` to propagate the error up or explicit error handling.

## 2) CLI chatbot example uses old API shape

Page: `https://docs.rig.rs/docs/extensions/cli_chatbot`

Current snippet:

```rust
use rig::{cli_chatbot, providers::openai};

let agent = openai.agent("gpt-4")
.preamble("You are a helpful assistant.")
.build();

cli_chatbot(agent).await?;
```

To my knowledge, `cli_chatbot` is a module, not a callable function in `rig-core 0.36.0`.
Suggested fix is builder-based:

```rust
use rig::integrations::cli_chatbot::ChatBotBuilder;

// ...
let chatbot = ChatBotBuilder::new().agent(agent).build();
chatbot.run().await?;
```

If this looks right, I’m happy to open a PR with these fixes. Should I go ahead?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue points to two specific documentation pages on docs.rig.rs. The first is the quickstart guide where `Client::from_env()` needs error handling. The second is the CLI chatbot extension page where the API usage is outdated. Check the current rig-core 0.36.0 source to confirm the correct API, then update the MDX files in the documentation repository accordingly. Verify the changes by building the docs locally.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
75/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。