- README.md: High-level usage and quick start.
- CONTRIBUTING.md: Canonical dev setup, test matrix, and contribution workflow.
- Cargo.toml: Dependencies, features, and lint configuration.
- examples/: Working code examples.
src/: Library source codelib.rs: Public API exports and crate-level documentationapi.rs: High-level functions (completion(),completion_stream())error.rs: Unified error types (OtariError)config.rs:Configstruct for client configurationclient/:Otariclient (connects to Otari gateway server viareqwest+ SSE)types/: Shared data types (messages, completions, tools, streaming chunks, batch, moderation, rerank)
tests/: Test suitestest_*.rs: Unit tests for each moduleintegration_*.rs: Integration tests (require a running gateway)
examples/: Runnable examples demonstrating usage
This repo uses cargo (Rust 1.83+). For the full command set, see CONTRIBUTING.md.
- Build:
cargo build --all-features - Run all checks:
cargo fmt --check && cargo clippy --all-features -- -D warnings - Unit tests:
cargo test --all-features - Run example:
cargo run --example gateway_completion - Build docs:
cargo doc --all-features --no-deps --open
- Rust indentation: 4 spaces (default)
- Formatting via
rustfmt(config inrustfmt.toml) - Linting via
clippywith pedantic + nursery lints enabled (seeCargo.toml[lints.clippy]) - Client code lives under
src/client/ - Public items require doc comments (
///) - Add code comments only where logic isn't self-evident; remove obvious comments before finishing
- Framework: Built-in Rust test framework +
tokio::testfor async - Add/adjust tests with every change (happy path + error cases)
- Integration tests should skip gracefully when the gateway is not available
- New code should have reasonable test coverage
- Commits: Use descriptive messages like
feat: add streaming support,fix: handle rate limit errors - PRs should follow the pull request template: clear description, linked issues, completed checklist
- Never commit secrets. Use environment variables or a local
.env(gitignored) for API keys. - Required env vars:
OTARI_API_KEY,OTARI_API_BASE