rig-core 0.42.0

An opinionated library for building LLM powered applications.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "rig-core"
version = "0.42.0"
build = false
exclude = [
    "tests/macro_hygiene.rs",
    "tests/fixtures/telemetry_macro_consumer",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "An opinionated library for building LLM powered applications."
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPlaygrounds/rig"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
audio = []
default = [
    "reqwest",
    "derive",
    "rustls",
]
derive = ["dep:rig-derive"]
epub = [
    "dep:epub",
    "dep:quick-xml",
]
image = []
native-tls = [
    "reqwest/native-tls",
    "tokio-tungstenite?/native-tls",
]
pdf = ["dep:lopdf"]
rayon = ["dep:rayon"]
reqwest = [
    "reqwest/charset",
    "reqwest/http2",
    "reqwest/system-proxy",
]
reqwest-middleware = ["reqwest-middleware-rustls"]
reqwest-middleware-native-tls = [
    "dep:reqwest-middleware",
    "native-tls",
]
reqwest-middleware-rustls = [
    "dep:reqwest-middleware",
    "rustls",
    "reqwest-middleware/rustls",
]
rustls = [
    "reqwest/rustls",
    "tokio-tungstenite?/rustls-tls-webpki-roots",
]
socks = ["reqwest/socks"]
test-utils = []
websocket = ["websocket-rustls"]
websocket-native-tls = [
    "dep:tokio-tungstenite",
    "tokio-tungstenite/connect",
    "native-tls",
]
websocket-rustls = [
    "dep:tokio-tungstenite",
    "tokio-tungstenite/connect",
    "rustls",
]

[lib]
name = "rig_core"
path = "src/lib.rs"
doctest = true

[[example]]
name = "cohere_image_embeddings"
path = "examples/cohere_image_embeddings.rs"

[[test]]
name = "driver_adoption"
path = "tests/driver_adoption.rs"

[[test]]
name = "identity_leak"
path = "tests/identity_leak.rs"

[[test]]
name = "model_listing_warnings"
path = "tests/model_listing_warnings.rs"

[[test]]
name = "streaming_conformance_websocket"
path = "tests/streaming_conformance_websocket.rs"

[dependencies.as-any]
version = "0.3"

[dependencies.async-stream]
version = "0.3"

[dependencies.base64]
version = "0.22"

[dependencies.bytes]
version = "1"

[dependencies.epub]
version = "2"
optional = true

[dependencies.eventsource-stream]
version = "0.2.3"

[dependencies.fastrand]
version = "2"

[dependencies.futures]
version = "0.3"

[dependencies.futures-timer]
version = "3"

[dependencies.glob]
version = "0.3"

[dependencies.http]
version = "1"

[dependencies.indexmap]
version = "2"

[dependencies.lopdf]
version = "0.44"
features = ["rayon"]
optional = true
default-features = false

[dependencies.mime]
version = "0.3"

[dependencies.mime_guess]
version = "2"

[dependencies.ordered-float]
version = "5"

[dependencies.pin-project-lite]
version = "0.2"

[dependencies.quick-xml]
version = "0.41"
optional = true

[dependencies.rayon]
version = "1"
optional = true

[dependencies.reqwest]
version = "0.13"
features = [
    "json",
    "stream",
    "multipart",
]
default-features = false

[dependencies.reqwest-middleware]
version = "0.5"
features = [
    "json",
    "multipart",
    "charset",
    "http2",
]
optional = true
default-features = false

[dependencies.rig-derive]
version = "0.42.0"
optional = true

[dependencies.schemars]
version = "1"

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1.0.54"

[dependencies.sha2]
version = "0.10"

[dependencies.thiserror]
version = "2"

[dependencies.tokio]
version = "1"
features = [
    "rt",
    "sync",
]

[dependencies.tracing]
version = "0.1"

[dependencies.tracing-futures]
version = "0.2.5"
features = ["futures-03"]

[dependencies.url]
version = "2"

[dev-dependencies.anyhow]
version = "1"

[dev-dependencies.assert_fs]
version = "1"

[dev-dependencies.base64]
version = "0.22"

[dev-dependencies.futures]
version = "0.3"

[dev-dependencies.opentelemetry]
version = "0.32"

[dev-dependencies.opentelemetry-otlp]
version = "0.32"

[dev-dependencies.opentelemetry_sdk]
version = "0.32"
features = ["rt-tokio"]

[dev-dependencies.proptest]
version = "1"

[dev-dependencies.redis]
version = "1"
features = [
    "tokio-comp",
    "aio",
    "vector-sets",
]

[dev-dependencies.reqwest-middleware]
version = "0.5"
features = [
    "json",
    "multipart",
    "charset",
    "http2",
    "rustls",
]
default-features = false

[dev-dependencies.reqwest-retry]
version = "0.9"

[dev-dependencies.serde_path_to_error]
version = "0.1"

[dev-dependencies.tokio]
version = "1"
features = ["full"]

[dev-dependencies.tokio-test]
version = "0.4"

[dev-dependencies.tokio-tungstenite]
version = "0.29"
features = ["handshake"]
default-features = false

[dev-dependencies.tracing-opentelemetry]
version = "0.33"

[dev-dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]

[dev-dependencies.trybuild]
version = "1.0.111"

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.futures-timer]
version = "3"
features = ["wasm-bindgen"]

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.lopdf]
version = "0.44"
features = [
    "rayon",
    "wasm_js",
]
optional = true
default-features = false

[target.'cfg(not(target_family = "wasm"))'.dependencies.tokio-tungstenite]
version = "0.29"
optional = true
default-features = false

[lints.clippy]
await_holding_lock = "deny"
await_holding_refcell_ref = "deny"
dbg_macro = "forbid"
expect_fun_call = "deny"
expect_used = "deny"
indexing_slicing = "deny"
panic = "deny"
panic_in_result_fn = "deny"
todo = "forbid"
unimplemented = "forbid"
unreachable = "deny"
unwrap_used = "deny"