Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
437 lines (424 loc) · 18.1 KB
/
Copy pathCargo.toml
File metadata and controls
437 lines (424 loc) · 18.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
[package]
name = "rig"
version.workspace = true
edition = { workspace = true }
license = "MIT"
readme = "README.md"
description = "An opinionated library for building LLM powered applications."
repository = "https://github.com/0xPlaygrounds/rig"
# Examples now live in their own packages under `examples/*`; don't auto-discover
# them as examples of this crate.
autoexamples = false
# This package's own `src/` is ~12 KiB of re-exports, but the manifest sits at the
# repo root, so every sibling path is swept into the published tarball, including
# the 1,100+ provider cassettes. They grew the crate from 6.66 MiB at 0.39.0 to
# 9.51 MiB today, against a crates.io upload limit of 10 MiB: the next release was
# on track to be rejected outright. That limit is enforced server-side, so no
# amount of `cargo publish --dry-run` surfaces it. Excluding the cassettes drops
# the tarball to 3.33 MiB. They are replay fixtures the test binaries read at
# runtime from `CARGO_MANIFEST_DIR`, never embedded with `include_*!`, so nothing
# in the package needs them to compile.
exclude = ["tests/cassettes/**"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[workspace]
resolver = "3"
members = [
"crates/*",
"examples/*",
"xtask",
]
# The root manifest is itself the `rig` facade package, so without an
# explicit `default-members` a bare `cargo nextest run` resolved to the
# facade alone and every `crates/*` unit test ran only where a CI step named
# its package (#2258: ~1,200 rig-core lib unit tests executed in no step).
# The default set is the facade plus the crates whose unit tests must always
# run; the service-backed vector-store integrations and examples stay
# opt-in.
# rig-derive is deliberately absent: a proc-macro crate's test binary links
# libstd dynamically, which breaks under toolchains installed without the
# dylib component. Absent from the default set is not absent from CI — its
# own suite (trybuild cases and the dependency-rename fixtures) runs in the
# `stable / test rig-derive` job, which names `-p rig-derive` explicitly, and
# the macro-hygiene consumer runs in the `test guards` job's
# `cargo test -p rig-core --test macro_hygiene` step. Both are required for
# this exclusion to stay honest: until the first existed, every test in
# rig-derive ran nowhere.
default-members = [
".",
"crates/rig-core",
"crates/rig-agent",
"crates/rig-reqwest",
"crates/rig-tungstenite",
"crates/rig-bedrock",
"crates/rig-candle",
"crates/rig-gemini-grpc",
]
exclude = [
"archived",
# Data/infra dirs under examples/ that are not Cargo packages.
"examples/documents",
"examples/otel",
# Its own workspace: `serenity` is the only published Discord client and
# pins a `rustls` major with four unpatched `rustls-webpki` advisories.
# Excluding it keeps that subtree out of the workspace lockfile.
"examples/discord_bot",
]
[workspace.lints.clippy]
dbg_macro = "forbid"
await_holding_lock = "deny"
await_holding_refcell_ref = "deny"
expect_used = "deny"
expect_fun_call = "deny"
indexing_slicing = "deny"
panic = "deny"
panic_in_result_fn = "deny"
todo = "forbid"
unimplemented = "forbid"
unreachable = "deny"
unwrap_used = "deny"
[profile.release]
lto = true
opt-level = "s"
[workspace.package]
version = "0.42.0"
edition = "2024"
[workspace.dependencies]
# Every requirement below is a FLOOR, not a pin: `tokio = "1"` means `^1`,
# and a downstream resolves anywhere inside that range — usually to whatever
# its own lockfile already holds. So each floor is the lowest version rig's
# own code needs, to the best it can be verified: a bare major (or `0.minor`)
# where rig uses only long-stable API, and `major.minor[.patch]` only where a
# feature or API rig relies on first appeared (each such floor says which).
# Do not raise a floor because a newer release exists — Dependabot is
# configured (`versioning-strategy: increase-if-necessary`) to move only
# `Cargo.lock` for in-range releases, and every rig release used to ship the
# raised floors, forcing downstream users to `cargo update` a dozen crates
# just to take a point release (#2195). Raise a floor when rig starts using
# an API the old floor lacks, and say so in the changelog.
# `scripts/check-dependency-floors.py` (CI: nightly.yaml `dependency-floors`)
# downgrades every direct dependency to its floor and builds the workspace,
# so a floor that has silently rotted fails there rather than downstream.
#
# The `rig` facade is the workspace-root package; examples depend on it via
# `rig.workspace = true` (add per-example features at the use site).
rig = { path = ".", version = "0.42.0" }
rig-agent = { path = "crates/rig-agent", version = "0.42.0" }
rig-reqwest = { path = "crates/rig-reqwest", version = "0.42.0" }
rig-rmcp = { path = "crates/rig-rmcp", version = "0.42.0" }
rig-core = { path = "crates/rig-core", version = "0.42.0" }
anyhow = "1"
arrow-array = "58"
as-any = "0.3"
assert_fs = "1"
async-stream = "0.3"
axum = "0.8"
aws-config = { version = "1", default-features = false }
# 1.124: `OutputConfig`/`ServiceTier`/citations types rig-bedrock maps.
aws-sdk-bedrockruntime = { version = "1.124", default-features = false }
aws-smithy-eventstream = "0.60"
aws-smithy-runtime-api = "1"
aws-smithy-types = "1"
base64 = "0.22"
bytes = "1"
candle-core = "0.11"
candle-nn = "0.11"
candle-transformers = "0.11"
chrono = "0.4"
convert_case = "0.11"
dotenvy = "0.15"
epub = "2"
ethers = "2"
# 0.2.3: `EventStream::set_last_event_id`.
eventsource-stream = "0.2.3"
# 4.5: the `hf-hub-*` feature split rig-fastembed forwards.
fastembed = { version = "4.5", default-features = false }
fastrand = "2"
futures = "0.3"
# Runtime-agnostic executor used by the `agent_no_tokio` example.
bevy_tasks = { version = "0.19", features = ["multi_threaded"] }
futures-timer = "3"
glob = "0.3"
google-cloud-auth = "1"
# 1.7: `ThinkingLevel`, `ImageConfig`, `FunctionResponse{Blob,FileData}`.
google-cloud-aiplatform-v1 = { version = "1.7", default-features = false, features = [
"prediction-service",
] }
http = "1"
# 0.8.2: `Recording::export_async` (cassette harness).
httpmock = "0.8.2"
# 0.1.2: the `service` feature.
hyper-util = "0.1.2"
indexmap = "2"
indoc = "2"
lancedb = { version = "0.30", default-features = false }
log = "0.4"
lopdf = { version = "0.44", default-features = false, features = ["rayon"] }
mime = "0.3"
mime_guess = "2"
# 3.2: 3.0/3.1 no longer build against their own `^3` macro crate.
mongodb = "3.2"
neo4rs = "0.8"
opentelemetry = "0.32"
opentelemetry-otlp = "0.32"
opentelemetry_sdk = "0.32"
ordered-float = "5"
# 0.4.2: the first release whose `sqlx` feature accepts sqlx 0.9.
pgvector = "0.4.2"
pin-project-lite = "0.2"
proc-macro2 = "1"
# 1.10: the `Qdrant` client, `Payload`, and the query/upsert builders.
qdrant-client = { version = "1.10", default-features = false, features = [
"serde",
] }
quick-xml = "0.41"
quote = "1"
rayon = "1"
redis = "1"
reqwest = { version = "0.13", default-features = false }
reqwest-middleware = { version = "0.5", default-features = false }
reqwest-retry = "0.9"
rmcp = "2"
url = "2"
rusqlite = "0.32"
scylla = "1"
schemars = "1"
serde = "1"
serde_yaml = "0.9"
# 1.0.54: the `float_roundtrip` feature.
serde_json = "1.0.54"
safetensors = "0.8"
sha2 = "0.10"
serde_path_to_error = "0.1"
sqlite-vec = "0.1"
sqlx = "0.9"
# 3.2: 3.0/3.1 no longer build against `surrealdb-core ^3` as published.
surrealdb = "3.2"
syn = "2"
term_size = "0.3"
testcontainers = "0.27"
textwrap = "0.16"
thiserror = "2"
tokio = "1"
tokio-rusqlite = { version = "0.6", default-features = false }
tokio-test = "0.4"
tokio-stream = "0.1"
tokio-tungstenite = { version = "0.29", default-features = false }
tokenizers = { version = "0.22", default-features = false }
tonic = "0.14"
tonic-build = "0.14"
tonic-prost = "0.14"
tonic-prost-build = "0.14"
prost = "0.14"
tracing = "0.1"
# 0.2.5: `Instrumented<S>: Stream` under `futures-03` for futures 0.3 stable.
tracing-futures = "0.2.5"
tracing-opentelemetry = "0.33"
tracing-subscriber = "0.3"
uuid = "1"
wasm-bindgen-futures = "0.4"
wasm-bindgen = "0.2"
web-time = "1"
zerocopy = "0.8"
[workspace.metadata.cargo-autoinherit]
# Skip cargo-autoinherit for these packages
exclude-members = ["crates/rig-core", "crates/rig-derive"]
[lints]
workspace = true
[dependencies]
rig-core = { path = "crates/rig-core", version = "0.42.0", default-features = false }
rig-reqwest = { path = "crates/rig-reqwest", version = "0.42.0", optional = true, default-features = false }
rig-agent = { path = "crates/rig-agent", version = "0.42.0", optional = true, default-features = false }
rig-rmcp = { path = "crates/rig-rmcp", version = "0.42.0", optional = true }
rig-blockrun = { path = "crates/rig-blockrun", version = "0.42.0", optional = true, default-features = false }
rig-bedrock = { path = "crates/rig-bedrock", version = "0.42.0", optional = true, default-features = false }
rig-candle = { path = "crates/rig-candle", version = "0.42.0", optional = true, default-features = false }
rig-fastembed = { path = "crates/rig-fastembed", version = "0.42.0", optional = true, default-features = false }
rig-gemini-grpc = { path = "crates/rig-gemini-grpc", version = "0.42.0", optional = true, default-features = false }
rig-helixdb = { path = "crates/rig-helixdb", version = "0.42.0", optional = true, default-features = false }
rig-lancedb = { path = "crates/rig-lancedb", version = "0.42.0", optional = true, default-features = false }
lancedb = { workspace = true, optional = true }
rig-memory = { path = "crates/rig-memory", version = "0.42.0", optional = true, default-features = false }
rig-derive = { path = "crates/rig-derive", version = "0.42.0", optional = true }
rig-milvus = { path = "crates/rig-milvus", version = "0.42.0", optional = true, default-features = false }
rig-mongodb = { path = "crates/rig-mongodb", version = "0.42.0", optional = true, default-features = false }
rig-neo4j = { path = "crates/rig-neo4j", version = "0.42.0", optional = true, default-features = false }
rig-postgres = { path = "crates/rig-postgres", version = "0.42.0", optional = true, default-features = false }
rig-qdrant = { path = "crates/rig-qdrant", version = "0.42.0", optional = true, default-features = false }
rig-s3vectors = { path = "crates/rig-s3vectors", version = "0.42.0", optional = true, default-features = false }
rig-scylladb = { path = "crates/rig-scylladb", version = "0.42.0", optional = true, default-features = false }
rig-sqlite = { path = "crates/rig-sqlite", version = "0.42.0", optional = true, default-features = false }
rig-surrealdb = { path = "crates/rig-surrealdb", version = "0.42.0", optional = true, default-features = false }
rig-vectorize = { path = "crates/rig-vectorize", version = "0.42.0", optional = true, default-features = false }
rig-vertexai = { path = "crates/rig-vertexai", version = "0.42.0", optional = true, default-features = false }
# The bundled websocket backend is native-only (tungstenite needs a tokio
# reactor and raises a `compile_error!` on wasm), so it is scoped to non-wasm
# targets. That is what lets `websocket` mean "the protocol, plus the bundled
# backend where one exists": on wasm the feature still enables
# `rig-core/websocket`, so `rig::ws_client` is reachable and a browser backend
# can be implemented against it — which is the escape hatch the backend's own
# wasm error message prescribes. Wiring the dependency unconditionally would
# make that hatch unreachable through the facade.
#
# Not `default-features = false`, unlike the other optional companions: the
# backend's own `default = ["rustls"]` is what guarantees that enabling
# `websocket` always yields a socket that can do `wss://`. Turning defaults off
# here would let `--no-default-features --features websocket` compile a
# TLS-less backend that fails every handshake at runtime.
[target.'cfg(not(target_family = "wasm"))'.dependencies]
rig-tungstenite = { path = "crates/rig-tungstenite", version = "0.42.0", optional = true }
[dev-dependencies]
anyhow = { workspace = true }
arrow-array = { workspace = true }
assert_fs = { workspace = true }
async-stream = { workspace = true }
aws-config = { workspace = true }
aws-sdk-bedrockruntime = { workspace = true }
aws-smithy-eventstream = { workspace = true }
aws-smithy-runtime-api = { workspace = true }
aws-smithy-types = { workspace = true }
rig-core = { path = "crates/rig-core", version = "0.42.0", default-features = false, features = [
"test-utils",
] }
rig-agent = { path = "crates/rig-agent", version = "0.42.0", default-features = false, features = [
"test-utils",
] }
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tokio-test = { workspace = true }
redis = { workspace = true, features = ["tokio-comp", "aio", "vector-sets"] }
serde_path_to_error = { workspace = true }
base64 = { workspace = true }
bytes = { workspace = true }
futures = { workspace = true }
httpmock = { workspace = true, features = ["record", "proxy"] }
mongodb = { workspace = true }
neo4rs = { workspace = true }
qdrant-client = { workspace = true }
reqwest-retry = { workspace = true }
reqwest = { workspace = true, features = ["json", "stream"] }
reqwest-middleware = { workspace = true, features = [
"json",
"multipart",
"charset",
"http2",
"rustls",
] }
schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] }
sha2 = { workspace = true }
# float_roundtrip keeps cassette scrubbing idempotent on float-heavy bodies
# (e.g. embedding vectors): without it, parse→print can oscillate between two
# representations of the same decimal and the recorded YAML never stabilizes.
serde_json = { workspace = true, features = ["float_roundtrip"] }
serde_yaml = { workspace = true }
syn = { workspace = true, features = ["full", "visit"] }
rusqlite = { workspace = true, features = ["bundled"] }
sqlite-vec = { workspace = true }
sqlx = { workspace = true, features = ["runtime-tokio", "postgres", "uuid", "json"] }
testcontainers = { workspace = true }
thiserror = { workspace = true }
tokio-rusqlite = { workspace = true, features = ["bundled"] }
hyper-util = { workspace = true, features = ["service", "server"] }
rmcp = { workspace = true, features = [
"client",
"macros",
"reqwest",
"transport-streamable-http-client",
"transport-streamable-http-client-reqwest",
"transport-streamable-http-server-session",
"transport-streamable-http-server",
"transport-worker",
] }
axum = { workspace = true }
opentelemetry = { workspace = true }
opentelemetry_sdk = { workspace = true, features = ["rt-tokio"] }
opentelemetry-otlp = { workspace = true }
tracing = { workspace = true }
tracing-opentelemetry = { workspace = true }
url = { workspace = true }
[features]
default = ["rig-core/default", "reqwest", "agent", "derive", "rustls"]
agent = ["dep:rig-agent"]
test-utils = ["rig-core/test-utils", "rig-agent?/test-utils"]
# Internal: opt in to the slow nested-`cargo check` facade build tests
# (`tests/tool_facade_features.rs`). Not in `default`; `--all-features` (CI's
# lane) enables it so the guard still runs, while ad-hoc `cargo test` skips it.
facade-build-tests = []
bedrock = ["dep:rig-bedrock"]
blockrun = ["dep:rig-blockrun"]
candle = ["dep:rig-candle"]
fastembed = [
"dep:rig-fastembed",
"rig-fastembed/hf-hub",
"rig-fastembed/ort-download-binaries",
]
fastembed-hf-hub = ["dep:rig-fastembed", "rig-fastembed/hf-hub"]
fastembed-ort-download-binaries = ["dep:rig-fastembed", "rig-fastembed/ort-download-binaries"]
gemini-grpc = ["dep:rig-gemini-grpc"]
helixdb = ["dep:rig-helixdb"]
lancedb = ["dep:rig-lancedb", "dep:lancedb"]
memory = ["dep:rig-memory"]
milvus = ["dep:rig-milvus"]
mongodb = ["dep:rig-mongodb"]
neo4j = ["dep:rig-neo4j"]
postgres = ["dep:rig-postgres"]
qdrant = ["dep:rig-qdrant"]
s3vectors = ["dep:rig-s3vectors"]
scylladb = ["dep:rig-scylladb"]
sqlite = ["dep:rig-sqlite"]
surrealdb = ["dep:rig-surrealdb"]
vectorize = ["dep:rig-vectorize"]
vertexai = ["dep:rig-vertexai"]
audio = ["rig-core/audio", "rig-agent?/audio", "rig-reqwest?/audio"]
image = ["rig-core/image", "rig-agent?/image", "rig-reqwest?/image"]
derive = ["dep:rig-derive", "rig-core/derive", "rig-agent?/derive"]
pdf = ["rig-core/pdf"]
epub = ["rig-core/epub"]
rayon = ["rig-core/rayon"]
rmcp = ["dep:rig-rmcp"]
socks = ["reqwest", "rig-reqwest/socks"]
reqwest = ["dep:rig-reqwest"]
# The bundled websocket backend (`rig-tungstenite`) and the provider websocket
# sessions it drives. Independent of the HTTP transport axis: a session borrows
# the provider client for its request mapping, so `reqwest` comes along for the
# client, not for the socket.
#
# `websocket` is the API gate — it is what `pub use rig_tungstenite` and the
# prelude re-export are cfg'd on — and each of the three spellings is usable on
# its own. `rig-tungstenite`'s own `default = ["rustls"]` applies (see its
# dependency line), so `websocket` always has a working TLS stack; the
# `websocket-*-tls` spellings add the workspace-wide TLS feature on top, which
# is also what wires the backend up for `native-tls`.
#
# Additive features cannot express "replace rustls with native-tls": a
# native-tls-ONLY socket means depending on `rig-tungstenite` directly with
# `default-features = false, features = ["native-tls"]`. Through the facade,
# `websocket-native-tls` gets you a working native-tls socket with rustls also
# compiled in. That trade is deliberate — a build that silently cannot speak
# `wss://` is worse than one that compiles a TLS stack it does not use.
websocket = ["reqwest", "dep:rig-tungstenite", "rig-core/websocket"]
# `dep:rig-tungstenite` above resolves to nothing on wasm, where the dependency
# is not in the graph: the feature degrades to the protocol alone.
websocket-rustls = ["websocket", "rustls"]
websocket-native-tls = ["websocket", "native-tls"]
rustls = [
"rig-reqwest?/rustls",
"rig-tungstenite?/rustls",
"rig-fastembed?/hf-hub-rustls-tls",
"rig-helixdb?/rustls",
"rig-lancedb?/rig-rustls",
"rig-milvus?/rustls",
]
native-tls = [
"rig-reqwest?/native-tls",
"rig-tungstenite?/native-tls",
"rig-fastembed?/hf-hub-native-tls",
"rig-helixdb?/native-tls",
"rig-lancedb?/rig-native-tls",
"rig-milvus?/native-tls",
]
reqwest-middleware = ["reqwest", "rig-reqwest/reqwest-middleware"]
reqwest-middleware-rustls = ["reqwest", "rig-reqwest/reqwest-middleware-rustls"]
reqwest-middleware-native-tls = ["reqwest", "rig-reqwest/reqwest-middleware-native-tls"]