fix(rig-reqwest): default-transport constructors return an error instead of panicking when the client cannot be built (#2471)
- fix(rig-reqwest): default-transport constructors return an error instead of panicking
from_env,new,from_valandbuildpromise a Result but built the bundled transport throughReqwestClient::default(), i.e.reqwest::Client::new(), which panics when the client cannot be built (no CA store on the host, for one). Build through the builder, map the failure intoProviderClientError::Http, and flatten reqwest’s source chain into the message so the reason is printed, not just “builder error”.Test: a Linux-only binary empties the CA store via SSL_CERT_FILE/SSL_CERT_DIR and asserts every constructor returns the Http error naming it.
- test(rig-reqwest): no panic! in the no-CA-store test; gate it to the rustls-only build
CI’s test-guards job runs –all-features, which enables native-tls too; reqwest then defaults to OpenSSL, which does not read the CA store at build time, so the constructors succeed and there is no failure to observe. The test is now cfg’d to rustls-without-native-tls (the default feature set, exercised by the test job) and its expectations are plain assert!s, as clippy::panic demands.
Co-authored-by: gold-silver-copper stepanbokovikov@gmail.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
📑 Docs • 🌐 Website • 🤝 Contribute • ✍🏽 Blogs •
✨ If you would like to help spread the word about Rig, please consider starring the repo!
Table of contents
What is Rig?
Rig is a Rust library for building scalable, modular, and ergonomic LLM-powered applications.
More information about this crate can be found in the official and crate API reference documentation.
Features
wasm32-unknown-unknown) support for the portable core and classic runtime — see target support for the full matrix (WASI is not supported;rig-rmcp/MCP is native-only)Runtime choices
Rig separates portable provider/backend contracts from agent orchestration:
rig-corecontains provider-neutral messages, completion models, portable tools, memory and vector-store contracts, and built-in provider mappings.rig-agentcontains the classic builder, prompt/streaming traits, typed hooks, contextual tools, extraction, and the serializableAgentRunstate machine. It remains enabled by default.The root
rigfacade re-exports both at their familiar paths, so most code depends only onrig.Who is using Rig?
Below is a non-exhaustive list of companies and people who are using Rig:
proteinpaint, a genomics visualisation tool.rigfor simplifying LLM calls and implementing the model picker.For a curated list of Rig projects, libraries, tools, articles, and production users, check out awesome-rig.
Are you also using Rig? Open an issue to have your name added!
Get Started
Use the root
rigfacade when you want feature-gated access to companion crates, or userig-coredirectly when you only need the core provider abstractions.Simple example
Note using
#[tokio::main]requires you enable tokio’smacrosandrt-multi-threadfeatures or justfullto enable all features (cargo add tokio --features macros,rt-multi-thread).You can find more examples in each crate’s
examplesdirectory (for example,examples). Provider-specific integration coverage lives undertests/providers, with cassette-backed tests that replay offline by default and live-only tests kept separate when real provider APIs are still required. Seetests/README.mdfor test target, replay, record, and cassette safety commands. More detailed use case walkthroughs are regularly published on our Dev.to Blog and added to Rig’s official documentation at rig.rs/docs.Supported Integrations
The root
rigfacade exposes companion crates behind one feature per integration:rig-bedrockbedrockrig::bedrockrig-s3vectorss3vectorsrig::s3vectorsrig-candlecandlerig::candlerig-vectorizevectorizerig::vectorizerig-fastembedfastembedrig::fastembedrig-gemini-grpcgemini-grpcrig::gemini_grpcrig-vertexaivertexairig::vertexairig-helixdbhelixdbrig::helixdbrig-lancedblancedbrig::lancedbrig-memorymemoryrig::memoryrig-milvusmilvusrig::milvusrig-mongodbmongodbrig::mongodbrig-neo4jneo4jrig::neo4jrig-postgrespostgresrig::postgresrig-qdrantqdrantrig::qdrantrig-scylladbscylladbrig::scylladbrig-sqlitesqliterig::sqliterig-surrealdbsurrealdbrig::surrealdbrig::memoryis available without thememoryfeature; it contains the core conversation memory traits and in-memory backend re-exported fromrig-core. Enablingfeatures = ["memory"]adds reusable history-shaping policy types from therig-memorycompanion crate to the same module.We also have some other associated crates that have additional functionality you may find helpful when using Rig:
rig-onchain-kit- the Rig Onchain Kit. Intended to make interactions between Solana/EVM and Rig much easier to implement.