docs.rig.rs examples out of sync with rig-core 0.36.0 (from_env Result + cli_chatbot usage)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 75/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- rust
- Domain
- documentation
Research direction
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.
Written by the indexing model from the issue text.
Description
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:
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<T, E>, 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:
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:
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?
- Dominant language
- MDX
- Stars
- 21
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 0xPlaygrounds/rig-docs
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
0xPlaygrounds/rig-docs#91 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
0xPlaygrounds/rig-docs#90 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
0xPlaygrounds/rig-docs#88 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
0xPlaygrounds/rig-docs#85 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
0xPlaygrounds/rig-docs#82 · 1 comment ·
All issues in 0xPlaygrounds/rig-docs
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100