diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf3409ff..7c4e2a7d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -55,6 +55,8 @@ jobs: - name: Run clippy action uses: clechasseur/rs-clippy-check@v3 + with: + args: --all-features test: name: stable / test @@ -79,4 +81,25 @@ jobs: uses: actions-rs/cargo@v1 with: command: nextest - args: run --all-features \ No newline at end of file + args: run --all-features + + doc: + name: stable / doc + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust stable + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rust-docs + + # Required to compile rig-lancedb + - name: Install Protoc + uses: arduino/setup-protoc@v3 + + - name: Run cargo doc + run: cargo doc --no-deps --all-features + env: + RUSTDOCFLAGS: -D warnings \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 76f72265..75f67709 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -218,7 +218,7 @@ dependencies = [ "arrow-schema", "chrono", "half", - "indexmap 2.2.6", + "indexmap 2.6.0", "lexical-core", "num", "serde", @@ -260,7 +260,7 @@ version = "52.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e972cd1ff4a4ccd22f86d3e53e835c2ed92e0eea6a3e8eadb72b4f1ac802cf8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -340,18 +340,18 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -377,15 +377,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.6" +version = "1.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848d7b9b605720989929279fa644ce8f244d0ce3146fcca5b70e4eb7b3c020fc" +checksum = "7198e6f03240fdceba36656d8be440297b6b82270325908c7381f37d826a74f6" dependencies = [ "aws-credential-types", "aws-runtime", @@ -400,7 +400,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "hex", "http 0.2.12", "ring", @@ -438,7 +438,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "http 0.2.12", "http-body 0.4.6", "once_cell", @@ -450,9 +450,9 @@ dependencies = [ [[package]] name = "aws-sdk-dynamodb" -version = "1.45.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f3d9e807092149e3df266e3f4d9760dac439b90f82d8438e5b2c0bbe62007f" +checksum = "ab0ade000608877169533a54326badd6b5a707d2faf876cfc3976a7f9d7e5329" dependencies = [ "aws-credential-types", "aws-runtime", @@ -464,7 +464,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "http 0.2.12", "once_cell", "regex-lite", @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.42.0" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27bf24cd0d389daa923e974b0e7c38daf308fc21e963c049f57980235017175e" +checksum = "e33ae899566f3d395cbf42858e433930682cc9c1889fa89318896082fef45efb" dependencies = [ "aws-credential-types", "aws-runtime", @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.43.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43b3220f1c46ac0e9dcc0a97d94b93305dacb36d1dd393996300c6b9b74364" +checksum = "f39c09e199ebd96b9f860b0fce4b6625f211e064ad7c8693b72ecf7ef03881e0" dependencies = [ "aws-credential-types", "aws-runtime", @@ -517,9 +517,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.42.0" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c46924fb1add65bba55636e12812cae2febf68c0f37361766f627ddcca91ce" +checksum = "3d95f93a98130389eb6233b9d615249e543f6c24a68ca1f109af9ca5164a8765" dependencies = [ "aws-credential-types", "aws-runtime", @@ -622,13 +622,13 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -657,9 +657,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.6" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03701449087215b5369c7ea17fef0dd5d24cb93439ec5af0c7615f58c3f22605" +checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" dependencies = [ "base64-simd", "bytes", @@ -700,23 +700,23 @@ dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "tracing", ] [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -755,9 +755,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitpacking" @@ -791,15 +791,15 @@ dependencies = [ [[package]] name = "bson" -version = "2.10.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d43b38e074cc0de2957f10947e376a1d88b9c4dbab340b590800cc1b2e066b2" +checksum = "068208f2b6fcfa27a7f1ee37488d2bb8ba2640f68f5475d08e1d9130696aba59" dependencies = [ "ahash", "base64 0.13.1", "bitvec", "hex", - "indexmap 2.2.6", + "indexmap 2.6.0", "js-sys", "once_cell", "rand", @@ -836,9 +836,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "bytes-utils" @@ -883,13 +883,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -916,7 +916,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -999,15 +999,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1146,7 +1146,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1168,7 +1168,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1221,7 +1221,7 @@ dependencies = [ "glob", "half", "hashbrown 0.14.5", - "indexmap 2.2.6", + "indexmap 2.6.0", "itertools 0.12.1", "log", "num_cpus", @@ -1381,7 +1381,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.14.5", - "indexmap 2.2.6", + "indexmap 2.6.0", "itertools 0.12.1", "log", "paste", @@ -1410,7 +1410,7 @@ dependencies = [ "half", "hashbrown 0.14.5", "hex", - "indexmap 2.2.6", + "indexmap 2.6.0", "itertools 0.12.1", "log", "paste", @@ -1456,7 +1456,7 @@ dependencies = [ "futures", "half", "hashbrown 0.14.5", - "indexmap 2.2.6", + "indexmap 2.6.0", "itertools 0.12.1", "log", "once_cell", @@ -1526,15 +1526,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 1.0.109", + "rustc_version 0.4.1", + "syn 2.0.79", ] [[package]] @@ -1673,15 +1673,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "finl_unicode" -version = "1.2.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fixedbitset" @@ -1696,7 +1690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8add37afff2d4ffa83bc748a70b4b1370984f6980768554182424ef71447c35f" dependencies = [ "bitflags 1.3.2", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -1705,6 +1699,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1735,7 +1735,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.37", "windows-sys 0.52.0", ] @@ -1756,9 +1756,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1771,9 +1771,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1781,15 +1781,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1798,9 +1798,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1819,32 +1819,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1883,9 +1883,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -1905,7 +1905,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1924,7 +1924,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1958,6 +1958,17 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "heck" version = "0.4.1" @@ -2066,9 +2077,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2084,9 +2095,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -2134,7 +2145,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.30", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -2152,7 +2163,7 @@ dependencies = [ "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -2167,7 +2178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", @@ -2175,9 +2186,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -2188,7 +2199,6 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", - "tower", "tower-service", "tracing", ] @@ -2204,9 +2214,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2265,15 +2275,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "instant" version = "0.1.13" @@ -2306,14 +2322,14 @@ dependencies = [ "socket2 0.5.7", "widestring", "windows-sys 0.48.0", - "winreg 0.50.0", + "winreg", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itertools" @@ -2350,9 +2366,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2776,7 +2792,7 @@ dependencies = [ "regex", "serde", "serde_json", - "serde_with 3.9.0", + "serde_with 3.11.0", "snafu", "tokio", "url", @@ -2784,9 +2800,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "levenshtein_automata" @@ -2860,9 +2876,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libm" @@ -2876,7 +2892,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -2910,17 +2926,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -2984,9 +3000,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -3011,11 +3027,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -3054,7 +3070,7 @@ dependencies = [ "once_cell", "parking_lot", "quanta", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "scheduled-thread-pool", "skeptic", "smallvec", @@ -3125,11 +3141,10 @@ checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -3253,9 +3268,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -3279,9 +3294,9 @@ dependencies = [ "percent-encoding", "quick-xml", "rand", - "reqwest 0.12.5", + "reqwest 0.12.8", "ring", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "snafu", @@ -3293,9 +3308,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oneshot" @@ -3309,7 +3324,7 @@ version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -3326,7 +3341,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3355,9 +3370,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" +checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" dependencies = [ "num-traits", ] @@ -3391,9 +3406,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -3409,7 +3424,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3461,7 +3476,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.6.0", ] [[package]] @@ -3504,22 +3519,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3536,9 +3551,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polling" @@ -3564,9 +3579,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" @@ -3575,14 +3593,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -3614,7 +3632,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.77", + "syn 2.0.79", "tempfile", ] @@ -3628,7 +3646,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3646,7 +3664,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "unicase", ] @@ -3675,9 +3693,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-xml" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", "serde", @@ -3694,7 +3712,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.13", + "rustls 0.23.14", "socket2 0.5.7", "thiserror", "tokio", @@ -3711,7 +3729,7 @@ dependencies = [ "rand", "ring", "rustc-hash 2.0.0", - "rustls 0.23.13", + "rustls 0.23.14", "slab", "thiserror", "tinyvec", @@ -3720,22 +3738,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2 0.5.7", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3823,11 +3841,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3843,9 +3861,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -3855,9 +3873,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -3872,9 +3890,9 @@ checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" @@ -3890,7 +3908,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-tls", "ipnet", "js-sys", @@ -3913,14 +3931,14 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64 0.22.1", "bytes", @@ -3941,9 +3959,9 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.13", - "rustls-native-certs 0.7.3", - "rustls-pemfile 2.1.3", + "rustls 0.23.14", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", @@ -3958,7 +3976,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -3979,6 +3997,7 @@ dependencies = [ "futures", "ordered-float", "reqwest 0.11.27", + "rig-derive", "schemars", "serde", "serde_json", @@ -3988,6 +4007,16 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "rig-derive" +version = "0.1.0" +dependencies = [ + "indoc", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "rig-lancedb" version = "0.1.0" @@ -4080,9 +4109,9 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", ] @@ -4113,11 +4142,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -4138,9 +4167,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", "ring", @@ -4162,19 +4191,6 @@ dependencies = [ "security-framework", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.1.3", - "rustls-pki-types", - "schannel", - "security-framework", -] - [[package]] name = "rustls-native-certs" version = "0.8.0" @@ -4182,7 +4198,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -4199,19 +4215,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -4257,11 +4272,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4275,9 +4290,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0218ceea14babe24a4a5836f86ade86c1effbc198164e619194cb5069187e29" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "schemars_derive", @@ -4287,14 +4302,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed5a1ccce8ff962e31a165d41f6e2a2dd1245099dc4d594f5574a86cd90f4d3" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4315,11 +4330,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -4328,9 +4343,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4371,9 +4386,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -4386,7 +4401,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4397,7 +4412,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4406,7 +4421,7 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "itoa", "memchr", "ryu", @@ -4437,19 +4452,19 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", - "serde_with_macros 3.9.0", + "serde_with_macros 3.11.0", "time", ] @@ -4467,14 +4482,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4517,6 +4532,12 @@ dependencies = [ "dirs", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -4637,7 +4658,7 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4666,13 +4687,13 @@ checksum = "e51f1e89f093f99e7432c491c382b88a6860a5adbe6bf02574bf0a08efff1978" [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -4706,14 +4727,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -4728,9 +4749,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -4748,6 +4769,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" @@ -4931,34 +4955,35 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", - "windows-sys 0.52.0", + "fastrand 2.1.1", + "once_cell", + "rustix 0.38.37", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5013,9 +5038,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -5052,7 +5077,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5081,7 +5106,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] @@ -5099,9 +5124,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -5111,32 +5136,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5157,7 +5161,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5197,9 +5201,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" [[package]] name = "trust-dns-proto" @@ -5290,25 +5294,31 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -5317,9 +5327,9 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "untrusted" @@ -5329,9 +5339,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -5352,9 +5362,9 @@ checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" [[package]] name = "uuid" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", "serde", @@ -5374,9 +5384,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vsimd" @@ -5417,34 +5427,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5454,9 +5465,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5464,28 +5475,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" dependencies = [ "futures-util", "js-sys", @@ -5496,9 +5507,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5538,7 +5549,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5553,7 +5564,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -5571,7 +5612,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -5591,18 +5641,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -5613,9 +5663,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -5625,9 +5675,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -5637,15 +5687,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -5655,9 +5705,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -5667,9 +5717,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5679,9 +5729,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5691,9 +5741,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -5705,16 +5755,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wyz" version = "0.5.1" @@ -5732,22 +5772,23 @@ checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 33e2782f..faafb5f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] resolver = "2" members = [ - "rig-core", "rig-lancedb", + "rig-core", "rig-core/rig-core-derive", "rig-mongodb", + "rig-lancedb" ] diff --git a/rig-core/Cargo.toml b/rig-core/Cargo.toml index f0b2182b..bc65409a 100644 --- a/rig-core/Cargo.toml +++ b/rig-core/Cargo.toml @@ -23,8 +23,16 @@ futures = "0.3.29" ordered-float = "4.2.0" schemars = "0.8.16" thiserror = "1.0.61" +rig-derive = { path = "./rig-core-derive", optional = true } [dev-dependencies] anyhow = "1.0.75" tokio = { version = "1.34.0", features = ["full"] } tracing-subscriber = "0.3.18" + +[features] +derive = ["dep:rig-derive"] + +[[test]] +name = "embeddable_macro" +required-features = ["derive"] \ No newline at end of file diff --git a/rig-core/examples/calculator_chatbot.rs b/rig-core/examples/calculator_chatbot.rs index fb168a08..8b622482 100644 --- a/rig-core/examples/calculator_chatbot.rs +++ b/rig-core/examples/calculator_chatbot.rs @@ -2,7 +2,8 @@ use anyhow::Result; use rig::{ cli_chatbot::cli_chatbot, completion::ToolDefinition, - embeddings::{DocumentEmbeddings, EmbeddingsBuilder}, + embeddings::builder::DocumentEmbeddings, + embeddings::EmbeddingsBuilder, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, tool::{Tool, ToolEmbedding, ToolSet}, vector_store::in_memory_store::InMemoryVectorStore, diff --git a/rig-core/examples/rag.rs b/rig-core/examples/rag.rs index b4dee8a5..674d028c 100644 --- a/rig-core/examples/rag.rs +++ b/rig-core/examples/rag.rs @@ -2,7 +2,8 @@ use std::env; use rig::{ completion::Prompt, - embeddings::{DocumentEmbeddings, EmbeddingsBuilder}, + embeddings::builder::DocumentEmbeddings, + embeddings::EmbeddingsBuilder, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, vector_store::in_memory_store::InMemoryVectorStore, }; diff --git a/rig-core/examples/rag_dynamic_tools.rs b/rig-core/examples/rag_dynamic_tools.rs index cdf6b65e..5476eb80 100644 --- a/rig-core/examples/rag_dynamic_tools.rs +++ b/rig-core/examples/rag_dynamic_tools.rs @@ -1,7 +1,8 @@ use anyhow::Result; use rig::{ completion::{Prompt, ToolDefinition}, - embeddings::{DocumentEmbeddings, EmbeddingsBuilder}, + embeddings::builder::DocumentEmbeddings, + embeddings::EmbeddingsBuilder, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, tool::{Tool, ToolEmbedding, ToolSet}, vector_store::in_memory_store::InMemoryVectorStore, diff --git a/rig-core/examples/vector_search.rs b/rig-core/examples/vector_search.rs index 45110606..feadbfb4 100644 --- a/rig-core/examples/vector_search.rs +++ b/rig-core/examples/vector_search.rs @@ -1,7 +1,8 @@ use std::env; use rig::{ - embeddings::{DocumentEmbeddings, EmbeddingsBuilder}, + embeddings::builder::DocumentEmbeddings, + embeddings::EmbeddingsBuilder, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, vector_store::{in_memory_store::InMemoryVectorStore, VectorStoreIndex}, }; diff --git a/rig-core/examples/vector_search_cohere.rs b/rig-core/examples/vector_search_cohere.rs index 1e0180d3..6b93bcdd 100644 --- a/rig-core/examples/vector_search_cohere.rs +++ b/rig-core/examples/vector_search_cohere.rs @@ -1,7 +1,8 @@ use std::env; use rig::{ - embeddings::{DocumentEmbeddings, EmbeddingsBuilder}, + embeddings::builder::DocumentEmbeddings, + embeddings::EmbeddingsBuilder, providers::cohere::{Client, EMBED_ENGLISH_V3}, vector_store::{in_memory_store::InMemoryVectorStore, VectorStoreIndex}, }; diff --git a/rig-core/rig-core-derive/Cargo.toml b/rig-core/rig-core-derive/Cargo.toml new file mode 100644 index 00000000..1ab5e5ac --- /dev/null +++ b/rig-core/rig-core-derive/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "rig-derive" +version = "0.1.0" +edition = "2021" + +[dependencies] +indoc = "2.0.5" +proc-macro2 = { version = "1.0.87", features = ["proc-macro"] } +quote = "1.0.37" +syn = { version = "2.0.79", features = ["full"]} + +[lib] +proc-macro = true diff --git a/rig-core/rig-core-derive/src/basic.rs b/rig-core/rig-core-derive/src/basic.rs new file mode 100644 index 00000000..86bb13ad --- /dev/null +++ b/rig-core/rig-core-derive/src/basic.rs @@ -0,0 +1,25 @@ +use syn::{parse_quote, Attribute, DataStruct, Meta}; + +use crate::EMBED; + +/// Finds and returns fields with simple #[embed] attribute tags only. +pub(crate) fn basic_embed_fields(data_struct: &DataStruct) -> impl Iterator { + data_struct.fields.iter().filter(|field| { + field.attrs.iter().any(|attribute| match attribute { + Attribute { + meta: Meta::Path(path), + .. + } => path.is_ident(EMBED), + _ => false, + }) + }) +} + +/// Adds bounds to where clause that force all fields tagged with #[embed] to implement the Embeddable trait. +pub(crate) fn add_struct_bounds(generics: &mut syn::Generics, field_type: &syn::Type) { + let where_clause = generics.make_where_clause(); + + where_clause.predicates.push(parse_quote! { + #field_type: Embeddable + }); +} diff --git a/rig-core/rig-core-derive/src/custom.rs b/rig-core/rig-core-derive/src/custom.rs new file mode 100644 index 00000000..f29ed20e --- /dev/null +++ b/rig-core/rig-core-derive/src/custom.rs @@ -0,0 +1,123 @@ +use quote::ToTokens; +use syn::{meta::ParseNestedMeta, ExprPath}; + +use crate::EMBED; + +const EMBED_WITH: &str = "embed_with"; + +/// Finds and returns fields with #[embed(embed_with = "...")] attribute tags only. +/// Also returns the "..." part of the tag (ie. the custom function). +pub(crate) fn custom_embed_fields( + data_struct: &syn::DataStruct, +) -> syn::Result> { + data_struct + .fields + .iter() + .filter_map(|field| { + field + .attrs + .iter() + .filter_map(|attribute| match attribute.is_custom() { + Ok(true) => match attribute.expand_tag() { + Ok(path) => Some(Ok((field, path))), + Err(e) => Some(Err(e)), + }, + Ok(false) => None, + Err(e) => Some(Err(e)), + }) + .next() + }) + .collect::, _>>() +} + +trait CustomAttributeParser { + // Determine if field is tagged with an #[embed(embed_with = "...")] attribute. + fn is_custom(&self) -> syn::Result; + + // Get the "..." part of the #[embed(embed_with = "...")] attribute. + // Ex: If attribute is tagged with #[embed(embed_with = "my_embed")], returns "my_embed". + fn expand_tag(&self) -> syn::Result; +} + +impl CustomAttributeParser for syn::Attribute { + fn is_custom(&self) -> syn::Result { + // Check that the attribute is a list. + match &self.meta { + syn::Meta::List(meta) => { + if meta.tokens.is_empty() { + return Ok(false); + } + } + _ => return Ok(false), + }; + + // Check the first attribute tag (the first "embed") + if !self.path().is_ident(EMBED) { + return Ok(false); + } + + self.parse_nested_meta(|meta| { + // Parse the meta attribute as an expression. Need this to compile. + meta.value()?.parse::()?; + + if meta.path.is_ident(EMBED_WITH) { + Ok(()) + } else { + let path = meta.path.to_token_stream().to_string().replace(' ', ""); + Err(syn::Error::new_spanned( + meta.path, + format_args!("unknown embedding field attribute `{}`", path), + )) + } + })?; + + Ok(true) + } + + fn expand_tag(&self) -> syn::Result { + fn function_path(meta: &ParseNestedMeta<'_>) -> syn::Result { + // #[embed(embed_with = "...")] + let expr = meta.value()?.parse::().unwrap(); + let mut value = &expr; + while let syn::Expr::Group(e) = value { + value = &e.expr; + } + let string = if let syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Str(lit_str), + .. + }) = value + { + let suffix = lit_str.suffix(); + if !suffix.is_empty() { + return Err(syn::Error::new_spanned( + lit_str, + format!("unexpected suffix `{}` on string literal", suffix), + )); + } + lit_str.clone() + } else { + return Err(syn::Error::new_spanned( + value, + format!( + "expected {} attribute to be a string: `{} = \"...\"`", + EMBED_WITH, EMBED_WITH + ), + )); + }; + + string.parse() + } + + let mut custom_func_path = None; + + self.parse_nested_meta(|meta| match function_path(&meta) { + Ok(path) => { + custom_func_path = Some(path); + Ok(()) + } + Err(e) => Err(e), + })?; + + Ok(custom_func_path.unwrap()) + } +} diff --git a/rig-core/rig-core-derive/src/embeddable.rs b/rig-core/rig-core-derive/src/embeddable.rs new file mode 100644 index 00000000..8336c9e0 --- /dev/null +++ b/rig-core/rig-core-derive/src/embeddable.rs @@ -0,0 +1,133 @@ +use proc_macro2::TokenStream; +use quote::quote; +use syn::DataStruct; + +use crate::{ + basic::{add_struct_bounds, basic_embed_fields}, + custom::custom_embed_fields, +}; + +pub(crate) fn expand_derive_embedding(input: &mut syn::DeriveInput) -> syn::Result { + let name = &input.ident; + let data = &input.data; + let generics = &mut input.generics; + + let target_stream = match data { + syn::Data::Struct(data_struct) => { + let (basic_targets, basic_target_size) = data_struct.basic(generics); + let (custom_targets, custom_target_size) = data_struct.custom()?; + + // If there are no fields tagged with #[embed] or #[embed(embed_with = "...")], return an empty TokenStream. + // ie. do not implement Embeddable trait for the struct. + if basic_target_size + custom_target_size == 0 { + return Err(syn::Error::new_spanned( + name, + "Add at least one field tagged with #[embed] or #[embed(embed_with = \"...\")].", + )); + } + + quote! { + let mut embed_targets = #basic_targets; + embed_targets.extend(#custom_targets) + } + } + _ => { + return Err(syn::Error::new_spanned( + input, + "Embeddable derive macro should only be used on structs", + )) + } + }; + + let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); + + let gen = quote! { + // Note: Embeddable trait is imported with the macro. + + impl #impl_generics Embeddable for #name #ty_generics #where_clause { + type Error = rig::embeddings::embeddable::EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + #target_stream; + + rig::OneOrMany::merge( + embed_targets.into_iter() + .collect::, _>>()? + ).map_err(rig::embeddings::embeddable::EmbeddableError::new) + } + } + }; + + Ok(gen) +} + +trait StructParser { + // Handles fields tagged with #[embed] + fn basic(&self, generics: &mut syn::Generics) -> (TokenStream, usize); + + // Handles fields tagged with #[embed(embed_with = "...")] + fn custom(&self) -> syn::Result<(TokenStream, usize)>; +} + +impl StructParser for DataStruct { + fn basic(&self, generics: &mut syn::Generics) -> (TokenStream, usize) { + let embed_targets = basic_embed_fields(self) + // Iterate over every field tagged with #[embed] + .map(|field| { + add_struct_bounds(generics, &field.ty); + + let field_name = &field.ident; + + quote! { + self.#field_name + } + }) + .collect::>(); + + if !embed_targets.is_empty() { + ( + quote! { + vec![#(#embed_targets.embeddable()),*] + }, + embed_targets.len(), + ) + } else { + ( + quote! { + vec![] + }, + 0, + ) + } + } + + fn custom(&self) -> syn::Result<(TokenStream, usize)> { + let embed_targets = custom_embed_fields(self)? + // Iterate over every field tagged with #[embed(embed_with = "...")] + .into_iter() + .map(|(field, custom_func_path)| { + let field_name = &field.ident; + + quote! { + #custom_func_path(self.#field_name.clone()) + } + }) + .collect::>(); + + Ok(if !embed_targets.is_empty() { + ( + quote! { + vec![#(#embed_targets),*] + }, + embed_targets.len(), + ) + } else { + ( + quote! { + vec![] + }, + 0, + ) + }) + } +} diff --git a/rig-core/rig-core-derive/src/lib.rs b/rig-core/rig-core-derive/src/lib.rs new file mode 100644 index 00000000..d28a0d78 --- /dev/null +++ b/rig-core/rig-core-derive/src/lib.rs @@ -0,0 +1,21 @@ +extern crate proc_macro; +use proc_macro::TokenStream; +use syn::{parse_macro_input, DeriveInput}; + +mod basic; +mod custom; +mod embeddable; + +pub(crate) const EMBED: &str = "embed"; + +// https://doc.rust-lang.org/book/ch19-06-macros.html#how-to-write-a-custom-derive-macro +// https://doc.rust-lang.org/reference/procedural-macros.html + +#[proc_macro_derive(Embeddable, attributes(embed))] +pub fn derive_embedding_trait(item: TokenStream) -> TokenStream { + let mut input = parse_macro_input!(item as DeriveInput); + + embeddable::expand_derive_embedding(&mut input) + .unwrap_or_else(syn::Error::into_compile_error) + .into() +} diff --git a/rig-core/src/completion.rs b/rig-core/src/completion.rs index 4383e561..4f868786 100644 --- a/rig-core/src/completion.rs +++ b/rig-core/src/completion.rs @@ -439,14 +439,14 @@ impl CompletionRequestBuilder { } /// Sets the max tokens for the completion request. - /// Only required for: [ Anthropic ] + /// Note: This is required if using Anthropic pub fn max_tokens(mut self, max_tokens: u64) -> Self { self.max_tokens = Some(max_tokens); self } /// Sets the max tokens for the completion request. - /// Only required for: [ Anthropic ] + /// Note: This is required if using Anthropic pub fn max_tokens_opt(mut self, max_tokens: Option) -> Self { self.max_tokens = max_tokens; self diff --git a/rig-core/src/embeddings.rs b/rig-core/src/embeddings/builder.rs similarity index 70% rename from rig-core/src/embeddings.rs rename to rig-core/src/embeddings/builder.rs index e805d6d3..46eef092 100644 --- a/rig-core/src/embeddings.rs +++ b/rig-core/src/embeddings/builder.rs @@ -1,20 +1,7 @@ -//! This module provides functionality for working with embeddings and embedding models. -//! Embeddings are numerical representations of documents or other objects, typically used in -//! natural language processing (NLP) tasks such as text classification, information retrieval, -//! and document similarity. -//! -//! The module defines the [EmbeddingModel] trait, which represents an embedding model that can -//! generate embeddings for documents. It also provides an implementation of the [EmbeddingsBuilder] +//! The module provides an implementation of the [EmbeddingsBuilder] //! struct, which allows users to build collections of document embeddings using different embedding //! models and document sources. //! -//! The module also defines the [Embedding] struct, which represents a single document embedding, -//! and the [DocumentEmbeddings] struct, which represents a document along with its associated -//! embeddings. These structs are used to store and manipulate collections of document embeddings. -//! -//! Finally, the module defines the [EmbeddingError] enum, which represents various errors that -//! can occur during embedding generation or processing. -//! //! # Example //! ```rust //! use rig::providers::openai::{Client, self}; @@ -43,95 +30,10 @@ use std::{cmp::max, collections::HashMap}; use futures::{stream, StreamExt, TryStreamExt}; use serde::{Deserialize, Serialize}; -use crate::tool::{ToolEmbedding, ToolSet, ToolType}; - -#[derive(Debug, thiserror::Error)] -pub enum EmbeddingError { - /// Http error (e.g.: connection error, timeout, etc.) - #[error("HttpError: {0}")] - HttpError(#[from] reqwest::Error), - - /// Json error (e.g.: serialization, deserialization) - #[error("JsonError: {0}")] - JsonError(#[from] serde_json::Error), - - /// Error processing the document for embedding - #[error("DocumentError: {0}")] - DocumentError(String), - - /// Error parsing the completion response - #[error("ResponseError: {0}")] - ResponseError(String), - - /// Error returned by the embedding model provider - #[error("ProviderError: {0}")] - ProviderError(String), -} - -/// Trait for embedding models that can generate embeddings for documents. -pub trait EmbeddingModel: Clone + Sync + Send { - /// The maximum number of documents that can be embedded in a single request. - const MAX_DOCUMENTS: usize; - - /// The number of dimensions in the embedding vector. - fn ndims(&self) -> usize; - - /// Embed a single document - fn embed_document( - &self, - document: &str, - ) -> impl std::future::Future> + Send - where - Self: Sync, - { - async { - Ok(self - .embed_documents(vec![document.to_string()]) - .await? - .first() - .cloned() - .expect("One embedding should be present")) - } - } - - /// Embed multiple documents in a single request - fn embed_documents( - &self, - documents: Vec, - ) -> impl std::future::Future, EmbeddingError>> + Send; -} - -/// Struct that holds a single document and its embedding. -#[derive(Clone, Default, Deserialize, Serialize)] -pub struct Embedding { - /// The document that was embedded - pub document: String, - /// The embedding vector - pub vec: Vec, -} - -impl PartialEq for Embedding { - fn eq(&self, other: &Self) -> bool { - self.document == other.document - } -} - -impl Eq for Embedding {} - -impl Embedding { - pub fn distance(&self, other: &Self) -> f64 { - let dot_product: f64 = self - .vec - .iter() - .zip(other.vec.iter()) - .map(|(x, y)| x * y) - .sum(); - - let product_of_lengths = (self.vec.len() * other.vec.len()) as f64; - - dot_product / product_of_lengths - } -} +use crate::{ + embeddings::{Embedding, EmbeddingError, EmbeddingModel}, + tool::{ToolEmbedding, ToolSet, ToolType}, +}; /// Struct that holds a document and its embeddings. /// diff --git a/rig-core/src/embeddings/embeddable.rs b/rig-core/src/embeddings/embeddable.rs new file mode 100644 index 00000000..f5a69fd6 --- /dev/null +++ b/rig-core/src/embeddings/embeddable.rs @@ -0,0 +1,160 @@ +//! The module defines the [Embeddable] trait, which must be implemented for types that can be embedded. +//! # Example +//! ```rust +//! use std::env; +//! +//! use serde::{Deserialize, Serialize}; +//! use rig::OneOrMany; +//! +//! struct FakeDefinition { +//! id: String, +//! word: String, +//! definition: String, +//! } +//! +//! let fake_definition = FakeDefinition { +//! id: "doc1".to_string(), +//! word: "hello".to_string(), +//! definition: "used as a greeting or to begin a conversation".to_string() +//! }; +//! +//! impl Embeddable for FakeDefinition { +//! type Error = anyhow::Error; +//! +//! fn embeddable(&self) -> Result, Self::Error> { +//! // Embeddigns only need to be generated for `definition` field. +//! // Select it from the struct and return it as a single item. +//! Ok(OneOrMany::one(self.definition.clone())) +//! } +//! } +//! ``` + +use crate::one_or_many::OneOrMany; + +/// Error type used for when the `embeddable` method fails. +/// Used by default implementations of `Embeddable` for common types. +#[derive(Debug, thiserror::Error)] +#[error("{0}")] +pub struct EmbeddableError(#[from] Box); + +impl EmbeddableError { + pub fn new(error: E) -> Self { + EmbeddableError(Box::new(error)) + } +} + +/// Trait for types that can be embedded. +/// The `embeddable` method returns a `OneOrMany` which contains strings for which embeddings will be generated by the embeddings builder. +/// If there is an error generating the list of strings, the method should return an error that implements `std::error::Error`. +pub trait Embeddable { + type Error: std::error::Error + Sync + Send + 'static; + + fn embeddable(&self) -> Result, Self::Error>; +} + +// ================================================================ +// Implementations of Embeddable for common types +// ================================================================ +impl Embeddable for String { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.clone())) + } +} + +impl Embeddable for i8 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for i16 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for i32 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for i64 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for i128 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for f32 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for f64 { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for bool { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for char { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one(self.to_string())) + } +} + +impl Embeddable for serde_json::Value { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + Ok(OneOrMany::one( + serde_json::to_string(self).map_err(EmbeddableError::new)?, + )) + } +} + +impl Embeddable for Vec { + type Error = EmbeddableError; + + fn embeddable(&self) -> Result, Self::Error> { + let items = self + .iter() + .map(|item| item.embeddable()) + .collect::, _>>() + .map_err(EmbeddableError::new)?; + + OneOrMany::merge(items).map_err(EmbeddableError::new) + } +} diff --git a/rig-core/src/embeddings/embedding.rs b/rig-core/src/embeddings/embedding.rs new file mode 100644 index 00000000..735284a8 --- /dev/null +++ b/rig-core/src/embeddings/embedding.rs @@ -0,0 +1,99 @@ +//! The module defines the [EmbeddingModel] trait, which represents an embedding model that can +//! generate embeddings for documents. It also provides an implementation of the [crate::embeddings::EmbeddingsBuilder] +//! struct, which allows users to build collections of document embeddings using different embedding +//! models and document sources. +//! +//! The module also defines the [Embedding] struct, which represents a single document embedding. +//! +//! Finally, the module defines the [EmbeddingError] enum, which represents various errors that +//! can occur during embedding generation or processing. + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, thiserror::Error)] +pub enum EmbeddingError { + /// Http error (e.g.: connection error, timeout, etc.) + #[error("HttpError: {0}")] + HttpError(#[from] reqwest::Error), + + /// Json error (e.g.: serialization, deserialization) + #[error("JsonError: {0}")] + JsonError(#[from] serde_json::Error), + + /// Error processing the document for embedding + #[error("DocumentError: {0}")] + DocumentError(String), + + /// Error parsing the completion response + #[error("ResponseError: {0}")] + ResponseError(String), + + /// Error returned by the embedding model provider + #[error("ProviderError: {0}")] + ProviderError(String), +} + +/// Trait for embedding models that can generate embeddings for documents. +pub trait EmbeddingModel: Clone + Sync + Send { + /// The maximum number of documents that can be embedded in a single request. + const MAX_DOCUMENTS: usize; + + /// The number of dimensions in the embedding vector. + fn ndims(&self) -> usize; + + /// Embed a single document + fn embed_document( + &self, + document: &str, + ) -> impl std::future::Future> + Send + where + Self: Sync, + { + async { + Ok(self + .embed_documents(vec![document.to_string()]) + .await? + .first() + .cloned() + .expect("One embedding should be present")) + } + } + + /// Embed multiple documents in a single request + fn embed_documents( + &self, + documents: Vec, + ) -> impl std::future::Future, EmbeddingError>> + Send; +} + +/// Struct that holds a single document and its embedding. +#[derive(Clone, Default, Deserialize, Serialize, Debug)] +pub struct Embedding { + /// The document that was embedded. Used for debugging. + pub document: String, + /// The embedding vector + pub vec: Vec, +} + +impl PartialEq for Embedding { + fn eq(&self, other: &Self) -> bool { + self.document == other.document + } +} + +impl Eq for Embedding {} + +impl Embedding { + pub fn distance(&self, other: &Self) -> f64 { + let dot_product: f64 = self + .vec + .iter() + .zip(other.vec.iter()) + .map(|(x, y)| x * y) + .sum(); + + let product_of_lengths = (self.vec.len() * other.vec.len()) as f64; + + dot_product / product_of_lengths + } +} diff --git a/rig-core/src/embeddings/mod.rs b/rig-core/src/embeddings/mod.rs new file mode 100644 index 00000000..a9eda7c3 --- /dev/null +++ b/rig-core/src/embeddings/mod.rs @@ -0,0 +1,12 @@ +//! This module provides functionality for working with embeddings. +//! Embeddings are numerical representations of documents or other objects, typically used in +//! natural language processing (NLP) tasks such as text classification, information retrieval, +//! and document similarity. + +pub mod builder; +pub mod embeddable; +pub mod embedding; + +pub use builder::EmbeddingsBuilder; +pub use embeddable::Embeddable; +pub use embedding::{Embedding, EmbeddingError, EmbeddingModel}; diff --git a/rig-core/src/lib.rs b/rig-core/src/lib.rs index 86c25209..07c59f96 100644 --- a/rig-core/src/lib.rs +++ b/rig-core/src/lib.rs @@ -52,9 +52,9 @@ //! //! ## Vector stores and indexes //! Rig provides a common interface for working with vector stores and indexes. Specifically, the library -//! provides the [VectorStore](crate::vector_store::VectorStore) and [VectorStoreIndex](crate::vector_store::VectorStoreIndex) -//! traits, which can be implemented to define vector stores and indices respectively. -//! Those can then be used as the knowledgebase for a [RagAgent](crate::rag::RagAgent), or +//! provides the [VectorStoreIndex](crate::vector_store::VectorStoreIndex) +//! trait, which can be implemented to define vector stores and indices respectively. +//! Those can then be used as the knowledgebase for a RAG enabled [Agent](crate::agent::Agent), or //! as a source of context documents in a custom architecture that use multiple LLMs or agents. //! //! # Integrations @@ -72,6 +72,14 @@ pub mod completion; pub mod embeddings; pub mod extractor; pub mod json_utils; +pub mod one_or_many; pub mod providers; pub mod tool; pub mod vector_store; + +// Re-export commonly used types and traits +pub use embeddings::embeddable::Embeddable; +pub use one_or_many::OneOrMany; + +#[cfg(feature = "derive")] +pub use rig_derive::Embeddable; diff --git a/rig-core/src/one_or_many.rs b/rig-core/src/one_or_many.rs new file mode 100644 index 00000000..87435537 --- /dev/null +++ b/rig-core/src/one_or_many.rs @@ -0,0 +1,272 @@ +/// Struct containing either a single item or a list of items of type T. +/// If a single item is present, `first` will contain it and `rest` will be empty. +/// If multiple items are present, `first` will contain the first item and `rest` will contain the rest. +/// IMPORTANT: this struct cannot be created with an empty vector. +/// OneOrMany objects can only be created using OneOrMany::from() or OneOrMany::try_from(). +#[derive(PartialEq, Eq, Debug, Clone)] +pub struct OneOrMany { + /// First item in the list. + first: T, + /// Rest of the items in the list. + rest: Vec, +} + +/// Error type for when trying to create a OneOrMany object with an empty vector. +#[derive(Debug, thiserror::Error)] +#[error("Cannot create OneOrMany with an empty vector.")] +pub struct EmptyListError; + +impl OneOrMany { + /// Get the first item in the list. + pub fn first(&self) -> T { + self.first.clone() + } + + /// Get the rest of the items in the list (excluding the first one). + pub fn rest(&self) -> Vec { + self.rest.clone() + } + + /// Create a OneOrMany object with a single item of any type. + pub fn one(item: T) -> Self { + OneOrMany { + first: item, + rest: vec![], + } + } + + /// Create a OneOrMany object with a vector of items of any type. + pub fn many(items: Vec) -> Result { + let mut iter = items.into_iter(); + Ok(OneOrMany { + first: match iter.next() { + Some(item) => item, + None => return Err(EmptyListError), + }, + rest: iter.collect(), + }) + } + + /// Merge a list of OneOrMany items into a single OneOrMany item. + pub fn merge(one_or_many_items: Vec>) -> Result { + let items = one_or_many_items + .into_iter() + .flat_map(|one_or_many| one_or_many.into_iter()) + .collect::>(); + + OneOrMany::many(items) + } + + pub fn iter(&self) -> Iter { + Iter { + first: Some(&self.first), + rest: self.rest.iter(), + } + } + + pub fn iter_mut(&mut self) -> IterMut<'_, T> { + IterMut { + first: Some(&mut self.first), + rest: self.rest.iter_mut(), + } + } +} + +// ================================================================ +// Implementations of Iterator for OneOrMany +// - OneOrMany::iter() -> iterate over references of T objects +// - OneOrMany::into_iter() -> iterate over owned T objects +// - OneOrMany::iter_mut() -> iterate over mutable references of T objects +// ================================================================ + +/// Struct returned by call to `OneOrMany::iter()`. +pub struct Iter<'a, T> { + // References. + first: Option<&'a T>, + rest: std::slice::Iter<'a, T>, +} + +/// Implement `Iterator` for `Iter`. +/// The Item type of the `Iterator` trait is a reference of `T`. +impl<'a, T> Iterator for Iter<'a, T> { + type Item = &'a T; + + fn next(&mut self) -> Option { + if let Some(first) = self.first.take() { + Some(first) + } else { + self.rest.next() + } + } +} + +/// Struct returned by call to `OneOrMany::into_iter()`. +pub struct IntoIter { + // Owned. + first: Option, + rest: std::vec::IntoIter, +} + +/// Implement `Iterator` for `IntoIter`. +impl IntoIterator for OneOrMany { + type Item = T; + type IntoIter = IntoIter; + + fn into_iter(self) -> Self::IntoIter { + IntoIter { + first: Some(self.first), + rest: self.rest.into_iter(), + } + } +} + +/// Implement `Iterator` for `IntoIter`. +/// The Item type of the `Iterator` trait is an owned `T`. +impl Iterator for IntoIter { + type Item = T; + + fn next(&mut self) -> Option { + if let Some(first) = self.first.take() { + Some(first) + } else { + self.rest.next() + } + } +} + +/// Struct returned by call to `OneOrMany::iter_mut()`. +pub struct IterMut<'a, T> { + // Mutable references. + first: Option<&'a mut T>, + rest: std::slice::IterMut<'a, T>, +} + +// Implement `Iterator` for `IterMut`. +// The Item type of the `Iterator` trait is a mutable reference of `OneOrMany`. +impl<'a, T> Iterator for IterMut<'a, T> { + type Item = &'a mut T; + + fn next(&mut self) -> Option { + if let Some(first) = self.first.take() { + Some(first) + } else { + self.rest.next() + } + } +} + +#[cfg(test)] +mod test { + use super::OneOrMany; + + #[test] + fn test_single() { + let one_or_many = OneOrMany::one("hello".to_string()); + + assert_eq!(one_or_many.iter().count(), 1); + + one_or_many.iter().for_each(|i| { + assert_eq!(i, "hello"); + }); + } + + #[test] + fn test() { + let one_or_many = OneOrMany::many(vec!["hello".to_string(), "word".to_string()]).unwrap(); + + assert_eq!(one_or_many.iter().count(), 2); + + one_or_many.iter().enumerate().for_each(|(i, item)| { + if i == 0 { + assert_eq!(item, "hello"); + } + if i == 1 { + assert_eq!(item, "word"); + } + }); + } + + #[test] + fn test_one_or_many_into_iter_single() { + let one_or_many = OneOrMany::one("hello".to_string()); + + assert_eq!(one_or_many.clone().into_iter().count(), 1); + + one_or_many.into_iter().for_each(|i| { + assert_eq!(i, "hello".to_string()); + }); + } + + #[test] + fn test_one_or_many_into_iter() { + let one_or_many = OneOrMany::many(vec!["hello".to_string(), "word".to_string()]).unwrap(); + + assert_eq!(one_or_many.clone().into_iter().count(), 2); + + one_or_many.into_iter().enumerate().for_each(|(i, item)| { + if i == 0 { + assert_eq!(item, "hello".to_string()); + } + if i == 1 { + assert_eq!(item, "word".to_string()); + } + }); + } + + #[test] + fn test_one_or_many_merge() { + let one_or_many_1 = OneOrMany::many(vec!["hello".to_string(), "word".to_string()]).unwrap(); + + let one_or_many_2 = OneOrMany::one("sup".to_string()); + + let merged = OneOrMany::merge(vec![one_or_many_1, one_or_many_2]).unwrap(); + + assert_eq!(merged.iter().count(), 3); + + merged.iter().enumerate().for_each(|(i, item)| { + if i == 0 { + assert_eq!(item, "hello"); + } + if i == 1 { + assert_eq!(item, "word"); + } + if i == 2 { + assert_eq!(item, "sup"); + } + }); + } + + #[test] + fn test_mut_single() { + let mut one_or_many = OneOrMany::one("hello".to_string()); + + assert_eq!(one_or_many.iter_mut().count(), 1); + + one_or_many.iter_mut().for_each(|i| { + assert_eq!(i, "hello"); + }); + } + + #[test] + fn test_mut() { + let mut one_or_many = + OneOrMany::many(vec!["hello".to_string(), "word".to_string()]).unwrap(); + + assert_eq!(one_or_many.iter_mut().count(), 2); + + one_or_many.iter_mut().enumerate().for_each(|(i, item)| { + if i == 0 { + item.push_str(" world"); + assert_eq!(item, "hello world"); + } + if i == 1 { + assert_eq!(item, "word"); + } + }); + } + + #[test] + fn test_one_or_many_error() { + assert!(OneOrMany::::many(vec![]).is_err()) + } +} diff --git a/rig-core/src/providers/openai.rs b/rig-core/src/providers/openai.rs index 8262e6ce..c9ba9afa 100644 --- a/rig-core/src/providers/openai.rs +++ b/rig-core/src/providers/openai.rs @@ -11,7 +11,7 @@ use crate::{ agent::AgentBuilder, completion::{self, CompletionError, CompletionRequest}, - embeddings::{self, EmbeddingError}, + embeddings::{self, EmbeddingError, EmbeddingsBuilder}, extractor::ExtractorBuilder, json_utils, }; @@ -121,8 +121,8 @@ impl Client { /// .await /// .expect("Failed to embed documents"); /// ``` - pub fn embeddings(&self, model: &str) -> embeddings::EmbeddingsBuilder { - embeddings::EmbeddingsBuilder::new(self.embedding_model(model)) + pub fn embeddings(&self, model: &str) -> EmbeddingsBuilder { + EmbeddingsBuilder::new(self.embedding_model(model)) } /// Create a completion model with the given name. diff --git a/rig-core/src/vector_store/in_memory_store.rs b/rig-core/src/vector_store/in_memory_store.rs index ec497ac4..bfe2bd29 100644 --- a/rig-core/src/vector_store/in_memory_store.rs +++ b/rig-core/src/vector_store/in_memory_store.rs @@ -189,7 +189,7 @@ impl Vec mod tests { use std::cmp::Reverse; - use crate::embeddings::Embedding; + use crate::embeddings::embedding::Embedding; use super::{InMemoryVectorStore, RankingItem}; diff --git a/rig-core/tests/embeddable_macro.rs b/rig-core/tests/embeddable_macro.rs new file mode 100644 index 00000000..cbc76c80 --- /dev/null +++ b/rig-core/tests/embeddable_macro.rs @@ -0,0 +1,186 @@ +use rig::embeddings::embeddable::EmbeddableError; +use rig::{Embeddable, OneOrMany}; +use serde::Serialize; + +fn serialize(definition: Definition) -> Result, EmbeddableError> { + Ok(OneOrMany::one( + serde_json::to_string(&definition).map_err(EmbeddableError::new)?, + )) +} + +#[derive(Embeddable)] +struct FakeDefinition { + id: String, + word: String, + #[embed(embed_with = "serialize")] + definition: Definition, +} + +#[derive(Serialize, Clone)] +struct Definition { + word: String, + link: String, + speech: String, +} + +#[test] +fn test_custom_embed() { + let fake_definition = FakeDefinition { + id: "doc1".to_string(), + word: "house".to_string(), + definition: Definition { + speech: "noun".to_string(), + word: "a building in which people live; residence for human beings.".to_string(), + link: "https://www.dictionary.com/browse/house".to_string(), + }, + }; + + println!( + "FakeDefinition: {}, {}", + fake_definition.id, fake_definition.word + ); + + assert_eq!( + fake_definition.embeddable().unwrap(), + OneOrMany::one( + "{\"word\":\"a building in which people live; residence for human beings.\",\"link\":\"https://www.dictionary.com/browse/house\",\"speech\":\"noun\"}".to_string() + ) + + ) +} + +#[derive(Embeddable)] +struct FakeDefinition2 { + id: String, + #[embed] + word: String, + #[embed(embed_with = "serialize")] + definition: Definition, +} + +#[test] +fn test_custom_and_basic_embed() { + let fake_definition = FakeDefinition2 { + id: "doc1".to_string(), + word: "house".to_string(), + definition: Definition { + speech: "noun".to_string(), + word: "a building in which people live; residence for human beings.".to_string(), + link: "https://www.dictionary.com/browse/house".to_string(), + }, + }; + + println!( + "FakeDefinition: {}, {}", + fake_definition.id, fake_definition.word + ); + + assert_eq!( + fake_definition.embeddable().unwrap().first(), + "house".to_string() + ); + + assert_eq!( + fake_definition.embeddable().unwrap().rest(), + vec!["{\"word\":\"a building in which people live; residence for human beings.\",\"link\":\"https://www.dictionary.com/browse/house\",\"speech\":\"noun\"}".to_string()] + ) +} + +#[derive(Embeddable)] +struct FakeDefinition3 { + id: String, + word: String, + #[embed] + definition: String, +} + +#[test] +fn test_single_embed() { + let definition = "a building in which people live; residence for human beings.".to_string(); + + let fake_definition = FakeDefinition3 { + id: "doc1".to_string(), + word: "house".to_string(), + definition: definition.clone(), + }; + println!( + "FakeDefinition3: {}, {}", + fake_definition.id, fake_definition.word + ); + + assert_eq!( + fake_definition.embeddable().unwrap(), + OneOrMany::one(definition) + ) +} + +#[derive(Embeddable)] +struct Company { + id: String, + company: String, + #[embed] + employee_ages: Vec, +} + +#[test] +fn test_multiple_embed_strings() { + let company = Company { + id: "doc1".to_string(), + company: "Google".to_string(), + employee_ages: vec![25, 30, 35, 40], + }; + + println!("Company: {}, {}", company.id, company.company); + + let result = company.embeddable().unwrap(); + + assert_eq!( + result, + OneOrMany::many(vec![ + "25".to_string(), + "30".to_string(), + "35".to_string(), + "40".to_string() + ]) + .unwrap() + ); + + assert_eq!(result.first(), "25".to_string()); + + assert_eq!( + result.rest(), + vec!["30".to_string(), "35".to_string(), "40".to_string()] + ) +} + +#[derive(Embeddable)] +struct Company2 { + id: String, + #[embed] + company: String, + #[embed] + employee_ages: Vec, +} + +#[test] +fn test_multiple_embed_tags() { + let company = Company2 { + id: "doc1".to_string(), + company: "Google".to_string(), + employee_ages: vec![25, 30, 35, 40], + }; + + println!("Company: {}", company.id); + + assert_eq!( + company.embeddable().unwrap(), + OneOrMany::many(vec![ + "Google".to_string(), + "25".to_string(), + "30".to_string(), + "35".to_string(), + "40".to_string() + ]) + .unwrap() + ); +} diff --git a/rig-lancedb/examples/fixtures/lib.rs b/rig-lancedb/examples/fixtures/lib.rs index 9a91432e..d95a42e4 100644 --- a/rig-lancedb/examples/fixtures/lib.rs +++ b/rig-lancedb/examples/fixtures/lib.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use arrow_array::{types::Float64Type, ArrayRef, FixedSizeListArray, RecordBatch, StringArray}; use lancedb::arrow::arrow_schema::{DataType, Field, Fields, Schema}; -use rig::embeddings::DocumentEmbeddings; +use rig::embeddings::builder::DocumentEmbeddings; // Schema of table in LanceDB. pub fn schema(dims: usize) -> Schema { diff --git a/rig-lancedb/examples/vector_search_local_ann.rs b/rig-lancedb/examples/vector_search_local_ann.rs index 3ecd6b23..6466c2b9 100644 --- a/rig-lancedb/examples/vector_search_local_ann.rs +++ b/rig-lancedb/examples/vector_search_local_ann.rs @@ -3,10 +3,10 @@ use std::{env, sync::Arc}; use arrow_array::RecordBatchIterator; use fixture::{as_record_batch, schema}; use lancedb::index::vector::IvfPqIndexBuilder; -use rig::vector_store::VectorStoreIndex; use rig::{ embeddings::{EmbeddingModel, EmbeddingsBuilder}, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, + vector_store::VectorStoreIndex, }; use rig_lancedb::{LanceDbVectorStore, SearchParams}; use serde::Deserialize; diff --git a/rig-lancedb/src/lib.rs b/rig-lancedb/src/lib.rs index 1e8b344a..edcc51e5 100644 --- a/rig-lancedb/src/lib.rs +++ b/rig-lancedb/src/lib.rs @@ -3,7 +3,7 @@ use lancedb::{ DistanceType, }; use rig::{ - embeddings::EmbeddingModel, + embeddings::embedding::EmbeddingModel, vector_store::{VectorStoreError, VectorStoreIndex}, }; use serde::Deserialize; diff --git a/rig-mongodb/examples/vector_search_mongodb.rs b/rig-mongodb/examples/vector_search_mongodb.rs index 0d31aaa2..caba89d8 100644 --- a/rig-mongodb/examples/vector_search_mongodb.rs +++ b/rig-mongodb/examples/vector_search_mongodb.rs @@ -2,7 +2,8 @@ use mongodb::{options::ClientOptions, Client as MongoClient, Collection}; use std::env; use rig::{ - embeddings::{DocumentEmbeddings, EmbeddingsBuilder}, + embeddings::builder::DocumentEmbeddings, + embeddings::EmbeddingsBuilder, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, vector_store::VectorStoreIndex, }; diff --git a/rig-mongodb/src/lib.rs b/rig-mongodb/src/lib.rs index 30dd9e95..c3973092 100644 --- a/rig-mongodb/src/lib.rs +++ b/rig-mongodb/src/lib.rs @@ -2,7 +2,8 @@ use futures::StreamExt; use mongodb::bson::{self, doc}; use rig::{ - embeddings::{DocumentEmbeddings, Embedding, EmbeddingModel}, + embeddings::builder::DocumentEmbeddings, + embeddings::{Embedding, EmbeddingModel}, vector_store::{VectorStoreError, VectorStoreIndex}, }; use serde::Deserialize;