From 71b8229d97b94dff8a4bf16d77df3960ecc139a7 Mon Sep 17 00:00:00 2001 From: Emily Yu Date: Thu, 18 Jul 2024 17:13:32 -0400 Subject: [PATCH 1/6] restructure --- Cargo.lock | 296 +++++++++--------- Cargo.toml | 33 +- pinecone_sdk/Cargo.lock | 7 - pinecone_sdk/Cargo.toml | 26 -- {pinecone_sdk/src => src}/config.rs | 0 {pinecone_sdk/src => src}/lib.rs | 0 {pinecone_sdk/src => src}/pinecone/control.rs | 0 {pinecone_sdk/src => src}/pinecone/data.rs | 2 +- {pinecone_sdk/src => src}/pinecone/mod.rs | 3 +- {pinecone_sdk/src => src}/utils/errors.rs | 0 {pinecone_sdk/src => src}/utils/mod.rs | 0 {pinecone_sdk/src => src}/utils/user_agent.rs | 0 .../tests => tests}/integration_test.rs | 0 13 files changed, 176 insertions(+), 191 deletions(-) delete mode 100644 pinecone_sdk/Cargo.lock delete mode 100644 pinecone_sdk/Cargo.toml rename {pinecone_sdk/src => src}/config.rs (100%) rename {pinecone_sdk/src => src}/lib.rs (100%) rename {pinecone_sdk/src => src}/pinecone/control.rs (100%) rename {pinecone_sdk/src => src}/pinecone/data.rs (99%) rename {pinecone_sdk/src => src}/pinecone/mod.rs (99%) rename {pinecone_sdk/src => src}/utils/errors.rs (100%) rename {pinecone_sdk/src => src}/utils/mod.rs (100%) rename {pinecone_sdk/src => src}/utils/user_agent.rs (100%) rename {pinecone_sdk/tests => tests}/integration_test.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index c889daf..20fa7c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ "async-task", "concurrent-queue", @@ -199,9 +199,9 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" +checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ "async-io 2.3.3", "async-lock 3.4.0", @@ -262,7 +262,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -273,13 +273,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -307,7 +307,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.29", + "hyper 0.14.30", "itoa", "matchit", "memchr", @@ -341,9 +341,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -400,9 +400,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 = "blocking" @@ -425,15 +425,15 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cc" -version = "1.0.98" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" [[package]] name = "cfg-if" @@ -685,7 +685,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -846,9 +846,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -856,22 +856,22 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -894,7 +894,7 @@ dependencies = [ "crossbeam-utils", "form_urlencoded", "futures-util", - "hyper 0.14.29", + "hyper 0.14.30", "lazy_static", "levenshtein", "log", @@ -909,9 +909,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -933,16 +933,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", "futures-util", "h2 0.4.5", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", @@ -959,9 +959,9 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", - "rustls 0.23.10", + "rustls 0.23.11", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -974,7 +974,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.29", + "hyper 0.14.30", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -988,7 +988,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "native-tls", "tokio", @@ -998,16 +998,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -1147,9 +1147,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" @@ -1169,7 +1169,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", ] @@ -1197,9 +1197,9 @@ 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" dependencies = [ "value-bag", ] @@ -1212,9 +1212,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[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 = "mime" @@ -1224,9 +1224,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1234,9 +1234,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -1293,9 +1293,9 @@ dependencies = [ [[package]] name = "object" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -1323,7 +1323,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -1340,7 +1340,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -1387,7 +1387,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1438,7 +1438,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -1454,7 +1454,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pinecone_sdk" +name = "pinecone-sdk" version = "0.1.0" dependencies = [ "httpmock", @@ -1540,14 +1540,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1579,7 +1579,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.66", + "syn 2.0.71", "tempfile", ] @@ -1593,7 +1593,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -1646,11 +1646,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -1666,9 +1666,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -1678,9 +1678,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1689,9 +1689,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -1706,9 +1706,9 @@ dependencies = [ "futures-util", "h2 0.4.5", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-rustls", "hyper-tls", "hyper-util", @@ -1778,7 +1778,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -1801,9 +1801,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ "once_cell", "rustls-pki-types", @@ -1814,9 +1814,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -1843,9 +1843,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring", "rustls-pki-types", @@ -1890,11 +1890,11 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[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", @@ -1903,9 +1903,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -1913,29 +1913,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -2002,23 +2002,23 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snafu" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418b8136fec49956eba89be7da2847ec1909df92a9ae4178b5ff0ff092c8d95e" +checksum = "2b835cb902660db3415a672d862905e791e54d306c6e8189168c7f3d9ae1c79d" dependencies = [ "snafu-derive", ] [[package]] name = "snafu-derive" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4812a669da00d17d8266a0439eddcacbc88b17f732f927e52eeb9d196f7fb5" +checksum = "38d1e02fca405f6280643174a50c942219f0bbf4dbf7d480f1dd864d6f211ae5" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2062,9 +2062,9 @@ dependencies = [ [[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" @@ -2079,9 +2079,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -2155,22 +2155,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2184,9 +2184,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", ] @@ -2199,9 +2199,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -2234,7 +2234,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2264,7 +2264,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls 0.23.11", "rustls-pki-types", "tokio", ] @@ -2307,7 +2307,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.29", + "hyper 0.14.30", "hyper-timeout", "percent-encoding", "pin-project", @@ -2334,7 +2334,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2388,7 +2388,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2450,9 +2450,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", @@ -2461,9 +2461,9 @@ dependencies = [ [[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", @@ -2539,7 +2539,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -2573,7 +2573,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2640,7 +2640,7 @@ 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]] @@ -2660,18 +2660,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]] @@ -2682,9 +2682,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" @@ -2694,9 +2694,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" @@ -2706,15 +2706,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" @@ -2724,9 +2724,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" @@ -2736,9 +2736,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" @@ -2748,9 +2748,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" @@ -2760,9 +2760,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" diff --git a/Cargo.toml b/Cargo.toml index dc62ba5..dd55388 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,26 @@ -[workspace] -members = [ - "openapi", - "pinecone_sdk" -] -exclude = [ - "codegen" -] +[package] +name = "pinecone-sdk" +version = "0.1.0" +edition = "2021" +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +openapi = { path = "./openapi" } +tokio = { version = "1", features = ["full"] } +regex = "1.10.4" +serde_json = "1.0.117" +snafu = "0.8.3" +rand = "0.8.5" +tonic = { version = "0.11.0", features = ["tls", "transport", "tls-roots"] } +prost = "0.12.6" +prost-types = "0.12.6" +reqwest = "0.12.5" +once_cell = "1.19.0" + +[dev-dependencies] +temp-env = "0.3.6" +httpmock = "0.7.0-rc.1" + +[build-dependencies] +tonic-build = "0.11.0" diff --git a/pinecone_sdk/Cargo.lock b/pinecone_sdk/Cargo.lock deleted file mode 100644 index 017f597..0000000 --- a/pinecone_sdk/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "pinecone_sdk" -version = "0.1.0" diff --git a/pinecone_sdk/Cargo.toml b/pinecone_sdk/Cargo.toml deleted file mode 100644 index 9c2c892..0000000 --- a/pinecone_sdk/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "pinecone_sdk" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -openapi = { path = "../openapi" } -tokio = { version = "1", features = ["full"] } -regex = "1.10.4" -serde_json = "1.0.117" -snafu = "0.8.3" -rand = "0.8.5" -tonic = { version = "0.11.0", features = ["tls", "transport", "tls-roots"] } -prost = "0.12.6" -prost-types = "0.12.6" -reqwest = "0.12.5" -once_cell = "1.19.0" - -[dev-dependencies] -temp-env = "0.3.6" -httpmock = "0.7.0-rc.1" - -[build-dependencies] -tonic-build = "0.11.0" diff --git a/pinecone_sdk/src/config.rs b/src/config.rs similarity index 100% rename from pinecone_sdk/src/config.rs rename to src/config.rs diff --git a/pinecone_sdk/src/lib.rs b/src/lib.rs similarity index 100% rename from pinecone_sdk/src/lib.rs rename to src/lib.rs diff --git a/pinecone_sdk/src/pinecone/control.rs b/src/pinecone/control.rs similarity index 100% rename from pinecone_sdk/src/pinecone/control.rs rename to src/pinecone/control.rs diff --git a/pinecone_sdk/src/pinecone/data.rs b/src/pinecone/data.rs similarity index 99% rename from pinecone_sdk/src/pinecone/data.rs rename to src/pinecone/data.rs index cd0e382..f55909f 100644 --- a/pinecone_sdk/src/pinecone/data.rs +++ b/src/pinecone/data.rs @@ -15,7 +15,7 @@ pub use prost_types::{value::Kind, Struct as Metadata, Value}; /// Generated protobuf module for data plane. pub mod pb { - include!("../../../protos/_.rs"); + include!("../../protos/_.rs"); } #[derive(Debug, Clone)] diff --git a/pinecone_sdk/src/pinecone/mod.rs b/src/pinecone/mod.rs similarity index 99% rename from pinecone_sdk/src/pinecone/mod.rs rename to src/pinecone/mod.rs index 826d261..4633847 100644 --- a/pinecone_sdk/src/pinecone/mod.rs +++ b/src/pinecone/mod.rs @@ -62,7 +62,8 @@ impl PineconeClient { None => match std::env::var("PINECONE_API_KEY") { Ok(key) => key, Err(_) => { - let message = "API key is not provided as an argument nor as an environment variable"; + let message = + "API key is not provided as an argument nor as an environment variable"; return Err(PineconeError::APIKeyMissingError { message: message.to_string(), }); diff --git a/pinecone_sdk/src/utils/errors.rs b/src/utils/errors.rs similarity index 100% rename from pinecone_sdk/src/utils/errors.rs rename to src/utils/errors.rs diff --git a/pinecone_sdk/src/utils/mod.rs b/src/utils/mod.rs similarity index 100% rename from pinecone_sdk/src/utils/mod.rs rename to src/utils/mod.rs diff --git a/pinecone_sdk/src/utils/user_agent.rs b/src/utils/user_agent.rs similarity index 100% rename from pinecone_sdk/src/utils/user_agent.rs rename to src/utils/user_agent.rs diff --git a/pinecone_sdk/tests/integration_test.rs b/tests/integration_test.rs similarity index 100% rename from pinecone_sdk/tests/integration_test.rs rename to tests/integration_test.rs From e202e572fc19c3e37c8d55ca979d4a29f1187b64 Mon Sep 17 00:00:00 2001 From: Emily Yu Date: Mon, 22 Jul 2024 10:15:49 -0400 Subject: [PATCH 2/6] Move many files --- .gitignore | 2 + Cargo.lock | 15 +- Cargo.toml | 10 +- codegen/apis | 2 +- codegen/build-oas.sh | 30 +- justfile | 1 - openapi/.gitignore | 3 - openapi/.openapi-generator-ignore | 23 -- openapi/.openapi-generator/FILES | 59 ---- openapi/.openapi-generator/VERSION | 1 - openapi/.travis.yml | 1 - openapi/Cargo.toml | 14 - openapi/docs/CollectionList.md | 11 - openapi/docs/CollectionModel.md | 16 - openapi/docs/ConfigureIndexRequest.md | 11 - openapi/docs/ConfigureIndexRequestSpec.md | 11 - openapi/docs/ConfigureIndexRequestSpecPod.md | 12 - openapi/docs/CreateCollectionRequest.md | 12 - openapi/docs/CreateIndexRequest.md | 14 - openapi/docs/EmbedRequest.md | 13 - openapi/docs/EmbedRequestInputsInner.md | 11 - openapi/docs/EmbedRequestParameters.md | 12 - openapi/docs/Embedding.md | 11 - openapi/docs/EmbeddingsList.md | 13 - openapi/docs/EmbeddingsListUsage.md | 11 - openapi/docs/IndexList.md | 11 - openapi/docs/IndexModel.md | 16 - openapi/docs/IndexModelSpec.md | 12 - openapi/docs/IndexModelStatus.md | 12 - openapi/docs/IndexSpec.md | 12 - openapi/docs/InferenceApi.md | 39 --- openapi/docs/ListIndexes401Response.md | 12 - openapi/docs/ListIndexes401ResponseError.md | 13 - openapi/docs/ManageIndexesApi.md | 282 ------------------ openapi/docs/PodSpec.md | 17 -- openapi/docs/PodSpecMetadataConfig.md | 11 - openapi/docs/ServerlessSpec.md | 12 - openapi/git_push.sh | 57 ---- src/lib.rs | 2 + {openapi => src/openapi}/README.md | 0 .../src => src/openapi}/apis/configuration.rs | 0 .../src => src/openapi}/apis/inference_api.rs | 2 +- .../openapi}/apis/manage_indexes_api.rs | 12 +- {openapi/src => src/openapi}/apis/mod.rs | 0 openapi/src/lib.rs => src/openapi/mod.rs | 0 .../openapi}/models/collection_list.rs | 2 +- .../openapi}/models/collection_model.rs | 2 +- .../models/configure_index_request.rs | 2 +- .../models/configure_index_request_spec.rs | 2 +- .../configure_index_request_spec_pod.rs | 2 +- .../models/create_collection_request.rs | 2 +- .../openapi}/models/create_index_request.rs | 2 +- .../openapi}/models/embed_request.rs | 2 +- .../models/embed_request_inputs_inner.rs | 2 +- .../models/embed_request_parameters.rs | 2 +- .../src => src/openapi}/models/embedding.rs | 2 +- .../openapi}/models/embeddings_list.rs | 2 +- .../openapi}/models/embeddings_list_usage.rs | 2 +- .../src => src/openapi}/models/index_list.rs | 2 +- .../src => src/openapi}/models/index_model.rs | 2 +- .../openapi}/models/index_model_spec.rs | 2 +- .../openapi}/models/index_model_status.rs | 2 +- .../src => src/openapi}/models/index_spec.rs | 2 +- .../models/list_indexes_401_response.rs | 2 +- .../models/list_indexes_401_response_error.rs | 2 +- {openapi/src => src/openapi}/models/mod.rs | 0 .../src => src/openapi}/models/pod_spec.rs | 2 +- .../models/pod_spec_metadata_config.rs | 2 +- .../openapi}/models/serverless_spec.rs | 2 +- src/pinecone/control.rs | 18 +- src/pinecone/data.rs | 2 +- src/pinecone/mod.rs | 4 +- {protos => src/protos}/_.rs | 0 {protos => src/protos}/google.api.rs | 0 src/utils/errors.rs | 40 +-- tests/integration_test.rs | 4 +- 76 files changed, 109 insertions(+), 846 deletions(-) delete mode 100644 openapi/.gitignore delete mode 100644 openapi/.openapi-generator-ignore delete mode 100644 openapi/.openapi-generator/FILES delete mode 100644 openapi/.openapi-generator/VERSION delete mode 100644 openapi/.travis.yml delete mode 100644 openapi/Cargo.toml delete mode 100644 openapi/docs/CollectionList.md delete mode 100644 openapi/docs/CollectionModel.md delete mode 100644 openapi/docs/ConfigureIndexRequest.md delete mode 100644 openapi/docs/ConfigureIndexRequestSpec.md delete mode 100644 openapi/docs/ConfigureIndexRequestSpecPod.md delete mode 100644 openapi/docs/CreateCollectionRequest.md delete mode 100644 openapi/docs/CreateIndexRequest.md delete mode 100644 openapi/docs/EmbedRequest.md delete mode 100644 openapi/docs/EmbedRequestInputsInner.md delete mode 100644 openapi/docs/EmbedRequestParameters.md delete mode 100644 openapi/docs/Embedding.md delete mode 100644 openapi/docs/EmbeddingsList.md delete mode 100644 openapi/docs/EmbeddingsListUsage.md delete mode 100644 openapi/docs/IndexList.md delete mode 100644 openapi/docs/IndexModel.md delete mode 100644 openapi/docs/IndexModelSpec.md delete mode 100644 openapi/docs/IndexModelStatus.md delete mode 100644 openapi/docs/IndexSpec.md delete mode 100644 openapi/docs/InferenceApi.md delete mode 100644 openapi/docs/ListIndexes401Response.md delete mode 100644 openapi/docs/ListIndexes401ResponseError.md delete mode 100644 openapi/docs/ManageIndexesApi.md delete mode 100644 openapi/docs/PodSpec.md delete mode 100644 openapi/docs/PodSpecMetadataConfig.md delete mode 100644 openapi/docs/ServerlessSpec.md delete mode 100644 openapi/git_push.sh rename {openapi => src/openapi}/README.md (100%) rename {openapi/src => src/openapi}/apis/configuration.rs (100%) rename {openapi/src => src/openapi}/apis/inference_api.rs (98%) rename {openapi/src => src/openapi}/apis/manage_indexes_api.rs (98%) rename {openapi/src => src/openapi}/apis/mod.rs (100%) rename openapi/src/lib.rs => src/openapi/mod.rs (100%) rename {openapi/src => src/openapi}/models/collection_list.rs (96%) rename {openapi/src => src/openapi}/models/collection_model.rs (98%) rename {openapi/src => src/openapi}/models/configure_index_request.rs (96%) rename {openapi/src => src/openapi}/models/configure_index_request_spec.rs (96%) rename {openapi/src => src/openapi}/models/configure_index_request_spec_pod.rs (97%) rename {openapi/src => src/openapi}/models/create_collection_request.rs (97%) rename {openapi/src => src/openapi}/models/create_index_request.rs (98%) rename {openapi/src => src/openapi}/models/embed_request.rs (97%) rename {openapi/src => src/openapi}/models/embed_request_inputs_inner.rs (96%) rename {openapi/src => src/openapi}/models/embed_request_parameters.rs (97%) rename {openapi/src => src/openapi}/models/embedding.rs (96%) rename {openapi/src => src/openapi}/models/embeddings_list.rs (97%) rename {openapi/src => src/openapi}/models/embeddings_list_usage.rs (96%) rename {openapi/src => src/openapi}/models/index_list.rs (96%) rename {openapi/src => src/openapi}/models/index_model.rs (98%) rename {openapi/src => src/openapi}/models/index_model_spec.rs (96%) rename {openapi/src => src/openapi}/models/index_model_status.rs (97%) rename {openapi/src => src/openapi}/models/index_spec.rs (98%) rename {openapi/src => src/openapi}/models/list_indexes_401_response.rs (97%) rename {openapi/src => src/openapi}/models/list_indexes_401_response_error.rs (98%) rename {openapi/src => src/openapi}/models/mod.rs (100%) rename {openapi/src => src/openapi}/models/pod_spec.rs (98%) rename {openapi/src => src/openapi}/models/pod_spec_metadata_config.rs (98%) rename {openapi/src => src/openapi}/models/serverless_spec.rs (98%) rename {protos => src/protos}/_.rs (100%) rename {protos => src/protos}/google.api.rs (100%) diff --git a/.gitignore b/.gitignore index 315766a..80d467e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ outer-protos/thirdparty/** **/.env **/.swp +.openapi-crate/ + # IDE, editor, and OS-specific files .idea/ diff --git a/Cargo.lock b/Cargo.lock index 20fa7c4..4905286 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1306,17 +1306,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openapi" -version = "0.0.1" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "url", - "uuid", -] - [[package]] name = "openssl" version = "0.10.64" @@ -1459,18 +1448,20 @@ version = "0.1.0" dependencies = [ "httpmock", "once_cell", - "openapi", "prost", "prost-types", "rand", "regex", "reqwest", + "serde", "serde_json", "snafu", "temp-env", "tokio", "tonic", "tonic-build", + "url", + "uuid", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index dd55388..b3e6ded 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -openapi = { path = "./openapi" } tokio = { version = "1", features = ["full"] } regex = "1.10.4" serde_json = "1.0.117" @@ -15,9 +14,16 @@ rand = "0.8.5" tonic = { version = "0.11.0", features = ["tls", "transport", "tls-roots"] } prost = "0.12.6" prost-types = "0.12.6" -reqwest = "0.12.5" +# reqwest = "0.12.5" once_cell = "1.19.0" +# openapi +serde = { version = "^1.0", features = ["derive"] } +# serde_json = "^1.0" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } + [dev-dependencies] temp-env = "0.3.6" httpmock = "0.7.0-rc.1" diff --git a/codegen/apis b/codegen/apis index d1c2230..4de4456 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit d1c223060d97cf253acfba5004667d4b89bcc382 +Subproject commit 4de44568f98556d29e8044c8146b572d2396cb05 diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index eed04b9..79fa309 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -1,13 +1,37 @@ #!/bin/bash -pushd codegen/apis +SCRIPT_DIR=$(dirname "$(realpath "$0")") +PROJECT_DIR=$(realpath "$SCRIPT_DIR/..") + +pushd $PROJECT_DIR/codegen/apis just build popd -outdir="openapi" +tempdir=".openapi-crate" +outdir="src/openapi" docker run --rm -v $(pwd):/workspace openapitools/openapi-generator-cli:v7.6.0 generate \ --input-spec /workspace/codegen/apis/_build/2024-07/control_2024-07.oas.yaml \ --generator-name rust \ - --output /workspace/$outdir \ + --output /workspace/$tempdir \ --additional-properties "packageVersion=0.0.1" + +# copy source files from the crate to the module (outdir) +echo "Copying source files from $tempdir to $outdir" +pushd $PROJECT_DIR + # copy the readme to the outdir + cp $tempdir/README.md $outdir/README.md + + # copy everything in src to the outdir + cp -r $tempdir/src/* $outdir + + # rename the lib.rs file to mod.rs + mv $outdir/lib.rs $outdir/mod.rs + + # in each source file, replace "crate::" with "crate::openapi::" + for f in $(find $outdir -type f); do + sed -i "" 's/crate::/crate::openapi::/g' $f + done +popd + +echo "All done!" diff --git a/justfile b/justfile index 61639ef..4ec2751 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,5 @@ build-openapi: ./codegen/build-oas.sh - cargo build -p openapi build-proto: ./codegen/build-proto.sh diff --git a/openapi/.gitignore b/openapi/.gitignore deleted file mode 100644 index 6aa1064..0000000 --- a/openapi/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/openapi/.openapi-generator-ignore b/openapi/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/openapi/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/openapi/.openapi-generator/FILES b/openapi/.openapi-generator/FILES deleted file mode 100644 index 9d7b57e..0000000 --- a/openapi/.openapi-generator/FILES +++ /dev/null @@ -1,59 +0,0 @@ -.gitignore -.travis.yml -Cargo.toml -README.md -docs/CollectionList.md -docs/CollectionModel.md -docs/ConfigureIndexRequest.md -docs/ConfigureIndexRequestSpec.md -docs/ConfigureIndexRequestSpecPod.md -docs/CreateCollectionRequest.md -docs/CreateIndexRequest.md -docs/EmbedRequest.md -docs/EmbedRequestInputsInner.md -docs/EmbedRequestParameters.md -docs/Embedding.md -docs/EmbeddingsList.md -docs/EmbeddingsListUsage.md -docs/IndexList.md -docs/IndexModel.md -docs/IndexModelSpec.md -docs/IndexModelStatus.md -docs/IndexSpec.md -docs/InferenceApi.md -docs/ListIndexes401Response.md -docs/ListIndexes401ResponseError.md -docs/ManageIndexesApi.md -docs/PodSpec.md -docs/PodSpecMetadataConfig.md -docs/ServerlessSpec.md -git_push.sh -src/apis/configuration.rs -src/apis/inference_api.rs -src/apis/manage_indexes_api.rs -src/apis/mod.rs -src/lib.rs -src/models/collection_list.rs -src/models/collection_model.rs -src/models/configure_index_request.rs -src/models/configure_index_request_spec.rs -src/models/configure_index_request_spec_pod.rs -src/models/create_collection_request.rs -src/models/create_index_request.rs -src/models/embed_request.rs -src/models/embed_request_inputs_inner.rs -src/models/embed_request_parameters.rs -src/models/embedding.rs -src/models/embeddings_list.rs -src/models/embeddings_list_usage.rs -src/models/index_list.rs -src/models/index_model.rs -src/models/index_model_spec.rs -src/models/index_model_status.rs -src/models/index_spec.rs -src/models/list_indexes_401_response.rs -src/models/list_indexes_401_response_error.rs -src/models/mod.rs -src/models/pod_spec.rs -src/models/pod_spec_metadata_config.rs -src/models/serverless_spec.rs diff --git a/openapi/.openapi-generator/VERSION b/openapi/.openapi-generator/VERSION deleted file mode 100644 index 93c8dda..0000000 --- a/openapi/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.6.0 diff --git a/openapi/.travis.yml b/openapi/.travis.yml deleted file mode 100644 index 22761ba..0000000 --- a/openapi/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/openapi/Cargo.toml b/openapi/Cargo.toml deleted file mode 100644 index 8d44b35..0000000 --- a/openapi/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "openapi" -version = "0.0.1" -authors = ["support@pinecone.io"] -description = "Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors." -license = "Apache 2.0" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/openapi/docs/CollectionList.md b/openapi/docs/CollectionList.md deleted file mode 100644 index 35b6583..0000000 --- a/openapi/docs/CollectionList.md +++ /dev/null @@ -1,11 +0,0 @@ -# CollectionList - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**collections** | Option<[**Vec**](CollectionModel.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/CollectionModel.md b/openapi/docs/CollectionModel.md deleted file mode 100644 index 658fad0..0000000 --- a/openapi/docs/CollectionModel.md +++ /dev/null @@ -1,16 +0,0 @@ -# CollectionModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the collection. | -**size** | Option<**i64**> | The size of the collection in bytes. | [optional] -**status** | **String** | The status of the collection. | -**dimension** | Option<**i32**> | The dimension of the vectors stored in each record held in the collection. | [optional] -**vector_count** | Option<**i32**> | The number of records stored in the collection. | [optional] -**environment** | **String** | The environment where the collection is hosted. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/ConfigureIndexRequest.md b/openapi/docs/ConfigureIndexRequest.md deleted file mode 100644 index d3c46e6..0000000 --- a/openapi/docs/ConfigureIndexRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# ConfigureIndexRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**spec** | [**models::ConfigureIndexRequestSpec**](ConfigureIndexRequest_spec.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/ConfigureIndexRequestSpec.md b/openapi/docs/ConfigureIndexRequestSpec.md deleted file mode 100644 index 5fc184c..0000000 --- a/openapi/docs/ConfigureIndexRequestSpec.md +++ /dev/null @@ -1,11 +0,0 @@ -# ConfigureIndexRequestSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pod** | [**models::ConfigureIndexRequestSpecPod**](ConfigureIndexRequest_spec_pod.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/ConfigureIndexRequestSpecPod.md b/openapi/docs/ConfigureIndexRequestSpecPod.md deleted file mode 100644 index 3abf152..0000000 --- a/openapi/docs/ConfigureIndexRequestSpecPod.md +++ /dev/null @@ -1,12 +0,0 @@ -# ConfigureIndexRequestSpecPod - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**replicas** | Option<**i32**> | The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change. | [optional][default to 1] -**pod_type** | Option<**String**> | The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`. | [optional][default to p1.x1] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/CreateCollectionRequest.md b/openapi/docs/CreateCollectionRequest.md deleted file mode 100644 index c7a43fc..0000000 --- a/openapi/docs/CreateCollectionRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateCollectionRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the collection to be created. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. | -**source** | **String** | The name of the index to be used as the source for the collection. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/CreateIndexRequest.md b/openapi/docs/CreateIndexRequest.md deleted file mode 100644 index 665f78f..0000000 --- a/openapi/docs/CreateIndexRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# CreateIndexRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. | -**dimension** | **i32** | The dimensions of the vectors to be inserted in the index. | -**metric** | Option<**String**> | The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. | [optional][default to Cosine] -**spec** | Option<[**models::IndexSpec**](IndexSpec.md)> | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/EmbedRequest.md b/openapi/docs/EmbedRequest.md deleted file mode 100644 index fb46dd8..0000000 --- a/openapi/docs/EmbedRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# EmbedRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**model** | **String** | | -**parameters** | Option<[**models::EmbedRequestParameters**](EmbedRequest_parameters.md)> | | [optional] -**inputs** | [**Vec**](EmbedRequest_inputs_inner.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/EmbedRequestInputsInner.md b/openapi/docs/EmbedRequestInputsInner.md deleted file mode 100644 index 3cc3c20..0000000 --- a/openapi/docs/EmbedRequestInputsInner.md +++ /dev/null @@ -1,11 +0,0 @@ -# EmbedRequestInputsInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/EmbedRequestParameters.md b/openapi/docs/EmbedRequestParameters.md deleted file mode 100644 index 58e5a07..0000000 --- a/openapi/docs/EmbedRequestParameters.md +++ /dev/null @@ -1,12 +0,0 @@ -# EmbedRequestParameters - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**input_type** | Option<**String**> | Common property used to distinguish between types of data. | [optional] -**truncate** | Option<**String**> | How to handle inputs longer than those supported by the model. If NONE, when the input exceeds the maximum input token length an error will be returned. | [optional][default to END] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/Embedding.md b/openapi/docs/Embedding.md deleted file mode 100644 index f038cd5..0000000 --- a/openapi/docs/Embedding.md +++ /dev/null @@ -1,11 +0,0 @@ -# Embedding - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**values** | Option<**Vec**> | The embedding values. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/EmbeddingsList.md b/openapi/docs/EmbeddingsList.md deleted file mode 100644 index f621a52..0000000 --- a/openapi/docs/EmbeddingsList.md +++ /dev/null @@ -1,13 +0,0 @@ -# EmbeddingsList - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**model** | Option<**String**> | | [optional] -**data** | Option<[**Vec**](Embedding.md)> | | [optional] -**usage** | Option<[**models::EmbeddingsListUsage**](EmbeddingsList_usage.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/EmbeddingsListUsage.md b/openapi/docs/EmbeddingsListUsage.md deleted file mode 100644 index ae5009a..0000000 --- a/openapi/docs/EmbeddingsListUsage.md +++ /dev/null @@ -1,11 +0,0 @@ -# EmbeddingsListUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_tokens** | Option<**i32**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/IndexList.md b/openapi/docs/IndexList.md deleted file mode 100644 index 1e654c0..0000000 --- a/openapi/docs/IndexList.md +++ /dev/null @@ -1,11 +0,0 @@ -# IndexList - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**indexes** | Option<[**Vec**](IndexModel.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/IndexModel.md b/openapi/docs/IndexModel.md deleted file mode 100644 index 4a2e2fd..0000000 --- a/openapi/docs/IndexModel.md +++ /dev/null @@ -1,16 +0,0 @@ -# IndexModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. | -**dimension** | **i32** | The dimensions of the vectors to be inserted in the index. | -**metric** | **String** | The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. | [default to Cosine] -**host** | **String** | The URL address where the index is hosted. | -**spec** | [**models::IndexModelSpec**](IndexModel_spec.md) | | -**status** | [**models::IndexModelStatus**](IndexModel_status.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/IndexModelSpec.md b/openapi/docs/IndexModelSpec.md deleted file mode 100644 index e2d5ee9..0000000 --- a/openapi/docs/IndexModelSpec.md +++ /dev/null @@ -1,12 +0,0 @@ -# IndexModelSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pod** | Option<[**models::PodSpec**](PodSpec.md)> | | [optional] -**serverless** | Option<[**models::ServerlessSpec**](ServerlessSpec.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/IndexModelStatus.md b/openapi/docs/IndexModelStatus.md deleted file mode 100644 index bf71e38..0000000 --- a/openapi/docs/IndexModelStatus.md +++ /dev/null @@ -1,12 +0,0 @@ -# IndexModelStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ready** | **bool** | | -**state** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/IndexSpec.md b/openapi/docs/IndexSpec.md deleted file mode 100644 index b55efc5..0000000 --- a/openapi/docs/IndexSpec.md +++ /dev/null @@ -1,12 +0,0 @@ -# IndexSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**serverless** | Option<[**models::ServerlessSpec**](ServerlessSpec.md)> | | [optional] -**pod** | Option<[**models::PodSpec**](PodSpec.md)> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/InferenceApi.md b/openapi/docs/InferenceApi.md deleted file mode 100644 index 06e7bd1..0000000 --- a/openapi/docs/InferenceApi.md +++ /dev/null @@ -1,39 +0,0 @@ -# \InferenceApi - -All URIs are relative to *https://api.pinecone.io* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**embed**](InferenceApi.md#embed) | **POST** /embed | Embed data - - - -## embed - -> models::EmbeddingsList embed(embed_request) -Embed data - -Generate embeddings for input data - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**embed_request** | Option<[**EmbedRequest**](EmbedRequest.md)> | Generate embeddings for inputs | | - -### Return type - -[**models::EmbeddingsList**](EmbeddingsList.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/openapi/docs/ListIndexes401Response.md b/openapi/docs/ListIndexes401Response.md deleted file mode 100644 index 413b598..0000000 --- a/openapi/docs/ListIndexes401Response.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListIndexes401Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **i32** | The HTTP status code of the error. | -**error** | [**models::ListIndexes401ResponseError**](list_indexes_401_response_error.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/ListIndexes401ResponseError.md b/openapi/docs/ListIndexes401ResponseError.md deleted file mode 100644 index 2a37e8c..0000000 --- a/openapi/docs/ListIndexes401ResponseError.md +++ /dev/null @@ -1,13 +0,0 @@ -# ListIndexes401ResponseError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **String** | | -**message** | **String** | | -**details** | Option<[**serde_json::Value**](.md)> | Additional information about the error. This field is not guaranteed to be present. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/ManageIndexesApi.md b/openapi/docs/ManageIndexesApi.md deleted file mode 100644 index cb60256..0000000 --- a/openapi/docs/ManageIndexesApi.md +++ /dev/null @@ -1,282 +0,0 @@ -# \ManageIndexesApi - -All URIs are relative to *https://api.pinecone.io* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**configure_index**](ManageIndexesApi.md#configure_index) | **PATCH** /indexes/{index_name} | Configure an index -[**create_collection**](ManageIndexesApi.md#create_collection) | **POST** /collections | Create a collection -[**create_index**](ManageIndexesApi.md#create_index) | **POST** /indexes | Create an index -[**delete_collection**](ManageIndexesApi.md#delete_collection) | **DELETE** /collections/{collection_name} | Delete a collection -[**delete_index**](ManageIndexesApi.md#delete_index) | **DELETE** /indexes/{index_name} | Delete an index -[**describe_collection**](ManageIndexesApi.md#describe_collection) | **GET** /collections/{collection_name} | Describe a collection -[**describe_index**](ManageIndexesApi.md#describe_index) | **GET** /indexes/{index_name} | Describe an index -[**list_collections**](ManageIndexesApi.md#list_collections) | **GET** /collections | List collections -[**list_indexes**](ManageIndexesApi.md#list_indexes) | **GET** /indexes | List indexes - - - -## configure_index - -> models::IndexModel configure_index(index_name, configure_index_request) -Configure an index - -This operation specifies the pod type and number of replicas for an index. It applies to pod-based indexes only. Serverless indexes scale automatically based on usage. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**index_name** | **String** | The name of the index to configure. | [required] | -**configure_index_request** | [**ConfigureIndexRequest**](ConfigureIndexRequest.md) | The desired pod type and replica configuration for the index. | [required] | - -### Return type - -[**models::IndexModel**](IndexModel.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_collection - -> models::CollectionModel create_collection(create_collection_request) -Create a collection - -This operation creates a Pinecone collection. Serverless indexes do not support collections. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**create_collection_request** | [**CreateCollectionRequest**](CreateCollectionRequest.md) | The desired configuration for the collection. | [required] | - -### Return type - -[**models::CollectionModel**](CollectionModel.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## create_index - -> models::IndexModel create_index(create_index_request) -Create an index - -This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**create_index_request** | [**CreateIndexRequest**](CreateIndexRequest.md) | The desired configuration for the index. | [required] | - -### Return type - -[**models::IndexModel**](IndexModel.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_collection - -> delete_collection(collection_name) -Delete a collection - -This operation deletes an existing collection. Serverless indexes do not support collections. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**collection_name** | **String** | The name of the collection. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_index - -> delete_index(index_name) -Delete an index - -This operation deletes an existing index. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**index_name** | **String** | The name of the index to delete. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## describe_collection - -> models::CollectionModel describe_collection(collection_name) -Describe a collection - -This operation gets a description of a collection. Serverless indexes do not support collections. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**collection_name** | **String** | The name of the collection to be described. | [required] | - -### Return type - -[**models::CollectionModel**](CollectionModel.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## describe_index - -> models::IndexModel describe_index(index_name) -Describe an index - -Get a description of an index. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**index_name** | **String** | The name of the index to be described. | [required] | - -### Return type - -[**models::IndexModel**](IndexModel.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_collections - -> models::CollectionList list_collections() -List collections - -This operation returns a list of all collections in a project. Serverless indexes do not support collections. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::CollectionList**](CollectionList.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## list_indexes - -> models::IndexList list_indexes() -List indexes - -This operation returns a list of all indexes in a project. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::IndexList**](IndexList.md) - -### Authorization - -[ApiKeyAuth](../README.md#ApiKeyAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/openapi/docs/PodSpec.md b/openapi/docs/PodSpec.md deleted file mode 100644 index 146eda2..0000000 --- a/openapi/docs/PodSpec.md +++ /dev/null @@ -1,17 +0,0 @@ -# PodSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**environment** | **String** | The environment where the index is hosted. | -**replicas** | Option<**i32**> | The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change. | [optional][default to 1] -**shards** | Option<**i32**> | The number of shards. Shards split your data across multiple pods so you can fit more data into an index. | [optional][default to 1] -**pod_type** | **String** | The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`. | [default to p1.x1] -**pods** | **i32** | The number of pods to be used in the index. This should be equal to `shards` x `replicas`.' | [default to 1] -**metadata_config** | Option<[**models::PodSpecMetadataConfig**](PodSpec_metadata_config.md)> | | [optional] -**source_collection** | Option<**String**> | The name of the collection to be used as the source for the index. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/PodSpecMetadataConfig.md b/openapi/docs/PodSpecMetadataConfig.md deleted file mode 100644 index 7264cd1..0000000 --- a/openapi/docs/PodSpecMetadataConfig.md +++ /dev/null @@ -1,11 +0,0 @@ -# PodSpecMetadataConfig - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**indexed** | Option<**Vec**> | By default, all metadata is indexed; to change this behavior, use this property to specify an array of metadata fields that should be indexed. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/docs/ServerlessSpec.md b/openapi/docs/ServerlessSpec.md deleted file mode 100644 index 488cbfa..0000000 --- a/openapi/docs/ServerlessSpec.md +++ /dev/null @@ -1,12 +0,0 @@ -# ServerlessSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cloud** | **String** | The public cloud where you would like your index hosted. Serverless indexes can be hosted only in AWS at this time. | -**region** | **String** | The region where you would like your index to be created. Serverless indexes can be created only in the us-east-1,us-west-2, and eu-west-1 regions of AWS at this time. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/openapi/git_push.sh b/openapi/git_push.sh deleted file mode 100644 index f53a75d..0000000 --- a/openapi/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/src/lib.rs b/src/lib.rs index a743196..6d91150 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,3 +14,5 @@ pub mod pinecone; /// Utility modules. pub mod utils; + +pub mod openapi; diff --git a/openapi/README.md b/src/openapi/README.md similarity index 100% rename from openapi/README.md rename to src/openapi/README.md diff --git a/openapi/src/apis/configuration.rs b/src/openapi/apis/configuration.rs similarity index 100% rename from openapi/src/apis/configuration.rs rename to src/openapi/apis/configuration.rs diff --git a/openapi/src/apis/inference_api.rs b/src/openapi/apis/inference_api.rs similarity index 98% rename from openapi/src/apis/inference_api.rs rename to src/openapi/apis/inference_api.rs index 386b75d..c126fd4 100644 --- a/openapi/src/apis/inference_api.rs +++ b/src/openapi/apis/inference_api.rs @@ -11,7 +11,7 @@ use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; +use crate::openapi::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/openapi/src/apis/manage_indexes_api.rs b/src/openapi/apis/manage_indexes_api.rs similarity index 98% rename from openapi/src/apis/manage_indexes_api.rs rename to src/openapi/apis/manage_indexes_api.rs index d44fc2e..927aa03 100644 --- a/openapi/src/apis/manage_indexes_api.rs +++ b/src/openapi/apis/manage_indexes_api.rs @@ -11,7 +11,7 @@ use reqwest; use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; +use crate::openapi::{apis::ResponseContent, models}; use super::{Error, configuration}; @@ -121,7 +121,7 @@ pub async fn configure_index(configuration: &configuration::Configuration, index let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/indexes/{index_name}", local_var_configuration.base_path, index_name=crate::apis::urlencode(index_name)); + let local_var_uri_str = format!("{}/indexes/{index_name}", local_var_configuration.base_path, index_name=crate::openapi::apis::urlencode(index_name)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -232,7 +232,7 @@ pub async fn delete_collection(configuration: &configuration::Configuration, col let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/collections/{collection_name}", local_var_configuration.base_path, collection_name=crate::apis::urlencode(collection_name)); + let local_var_uri_str = format!("{}/collections/{collection_name}", local_var_configuration.base_path, collection_name=crate::openapi::apis::urlencode(collection_name)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -268,7 +268,7 @@ pub async fn delete_index(configuration: &configuration::Configuration, index_na let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/indexes/{index_name}", local_var_configuration.base_path, index_name=crate::apis::urlencode(index_name)); + let local_var_uri_str = format!("{}/indexes/{index_name}", local_var_configuration.base_path, index_name=crate::openapi::apis::urlencode(index_name)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -304,7 +304,7 @@ pub async fn describe_collection(configuration: &configuration::Configuration, c let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/collections/{collection_name}", local_var_configuration.base_path, collection_name=crate::apis::urlencode(collection_name)); + let local_var_uri_str = format!("{}/collections/{collection_name}", local_var_configuration.base_path, collection_name=crate::openapi::apis::urlencode(collection_name)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -340,7 +340,7 @@ pub async fn describe_index(configuration: &configuration::Configuration, index_ let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/indexes/{index_name}", local_var_configuration.base_path, index_name=crate::apis::urlencode(index_name)); + let local_var_uri_str = format!("{}/indexes/{index_name}", local_var_configuration.base_path, index_name=crate::openapi::apis::urlencode(index_name)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { diff --git a/openapi/src/apis/mod.rs b/src/openapi/apis/mod.rs similarity index 100% rename from openapi/src/apis/mod.rs rename to src/openapi/apis/mod.rs diff --git a/openapi/src/lib.rs b/src/openapi/mod.rs similarity index 100% rename from openapi/src/lib.rs rename to src/openapi/mod.rs diff --git a/openapi/src/models/collection_list.rs b/src/openapi/models/collection_list.rs similarity index 96% rename from openapi/src/models/collection_list.rs rename to src/openapi/models/collection_list.rs index 17ff5b1..14b421c 100644 --- a/openapi/src/models/collection_list.rs +++ b/src/openapi/models/collection_list.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// CollectionList : The list of collections that exist in the project. diff --git a/openapi/src/models/collection_model.rs b/src/openapi/models/collection_model.rs similarity index 98% rename from openapi/src/models/collection_model.rs rename to src/openapi/models/collection_model.rs index 5295920..7043f6a 100644 --- a/openapi/src/models/collection_model.rs +++ b/src/openapi/models/collection_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// CollectionModel : The CollectionModel describes the configuration and status of a Pinecone collection. diff --git a/openapi/src/models/configure_index_request.rs b/src/openapi/models/configure_index_request.rs similarity index 96% rename from openapi/src/models/configure_index_request.rs rename to src/openapi/models/configure_index_request.rs index 10fdcb2..ffc10de 100644 --- a/openapi/src/models/configure_index_request.rs +++ b/src/openapi/models/configure_index_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// ConfigureIndexRequest : Configuration used to scale an index. diff --git a/openapi/src/models/configure_index_request_spec.rs b/src/openapi/models/configure_index_request_spec.rs similarity index 96% rename from openapi/src/models/configure_index_request_spec.rs rename to src/openapi/models/configure_index_request_spec.rs index befbdd0..4566af6 100644 --- a/openapi/src/models/configure_index_request_spec.rs +++ b/src/openapi/models/configure_index_request_spec.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/openapi/src/models/configure_index_request_spec_pod.rs b/src/openapi/models/configure_index_request_spec_pod.rs similarity index 97% rename from openapi/src/models/configure_index_request_spec_pod.rs rename to src/openapi/models/configure_index_request_spec_pod.rs index 6f04df5..e583b06 100644 --- a/openapi/src/models/configure_index_request_spec_pod.rs +++ b/src/openapi/models/configure_index_request_spec_pod.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/openapi/src/models/create_collection_request.rs b/src/openapi/models/create_collection_request.rs similarity index 97% rename from openapi/src/models/create_collection_request.rs rename to src/openapi/models/create_collection_request.rs index 1c1d951..cbc7b7a 100644 --- a/openapi/src/models/create_collection_request.rs +++ b/src/openapi/models/create_collection_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// CreateCollectionRequest : The configuration needed to create a Pinecone collection. diff --git a/openapi/src/models/create_index_request.rs b/src/openapi/models/create_index_request.rs similarity index 98% rename from openapi/src/models/create_index_request.rs rename to src/openapi/models/create_index_request.rs index 2900c30..e1a88ed 100644 --- a/openapi/src/models/create_index_request.rs +++ b/src/openapi/models/create_index_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// CreateIndexRequest : The configuration needed to create a Pinecone index. diff --git a/openapi/src/models/embed_request.rs b/src/openapi/models/embed_request.rs similarity index 97% rename from openapi/src/models/embed_request.rs rename to src/openapi/models/embed_request.rs index e553fc8..a538ec3 100644 --- a/openapi/src/models/embed_request.rs +++ b/src/openapi/models/embed_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// EmbedRequest : Generate embeddings for inputs diff --git a/openapi/src/models/embed_request_inputs_inner.rs b/src/openapi/models/embed_request_inputs_inner.rs similarity index 96% rename from openapi/src/models/embed_request_inputs_inner.rs rename to src/openapi/models/embed_request_inputs_inner.rs index 463a191..90920e1 100644 --- a/openapi/src/models/embed_request_inputs_inner.rs +++ b/src/openapi/models/embed_request_inputs_inner.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/openapi/src/models/embed_request_parameters.rs b/src/openapi/models/embed_request_parameters.rs similarity index 97% rename from openapi/src/models/embed_request_parameters.rs rename to src/openapi/models/embed_request_parameters.rs index e1042a4..41d0a6e 100644 --- a/openapi/src/models/embed_request_parameters.rs +++ b/src/openapi/models/embed_request_parameters.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// EmbedRequestParameters : Model-specific parameters. diff --git a/openapi/src/models/embedding.rs b/src/openapi/models/embedding.rs similarity index 96% rename from openapi/src/models/embedding.rs rename to src/openapi/models/embedding.rs index 7094424..470b252 100644 --- a/openapi/src/models/embedding.rs +++ b/src/openapi/models/embedding.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// Embedding : Embedding of a single input diff --git a/openapi/src/models/embeddings_list.rs b/src/openapi/models/embeddings_list.rs similarity index 97% rename from openapi/src/models/embeddings_list.rs rename to src/openapi/models/embeddings_list.rs index a17cb8d..3393cfb 100644 --- a/openapi/src/models/embeddings_list.rs +++ b/src/openapi/models/embeddings_list.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// EmbeddingsList : Embeddings generated for the input diff --git a/openapi/src/models/embeddings_list_usage.rs b/src/openapi/models/embeddings_list_usage.rs similarity index 96% rename from openapi/src/models/embeddings_list_usage.rs rename to src/openapi/models/embeddings_list_usage.rs index 29a0584..8bae72f 100644 --- a/openapi/src/models/embeddings_list_usage.rs +++ b/src/openapi/models/embeddings_list_usage.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// EmbeddingsListUsage : Usage statistics for model inference including any instruction prefixes diff --git a/openapi/src/models/index_list.rs b/src/openapi/models/index_list.rs similarity index 96% rename from openapi/src/models/index_list.rs rename to src/openapi/models/index_list.rs index ca24b0c..5e6ddd8 100644 --- a/openapi/src/models/index_list.rs +++ b/src/openapi/models/index_list.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// IndexList : The list of indexes that exist in the project. diff --git a/openapi/src/models/index_model.rs b/src/openapi/models/index_model.rs similarity index 98% rename from openapi/src/models/index_model.rs rename to src/openapi/models/index_model.rs index 2693bf2..2b1f66a 100644 --- a/openapi/src/models/index_model.rs +++ b/src/openapi/models/index_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// IndexModel : The IndexModel describes the configuration and status of a Pinecone index. diff --git a/openapi/src/models/index_model_spec.rs b/src/openapi/models/index_model_spec.rs similarity index 96% rename from openapi/src/models/index_model_spec.rs rename to src/openapi/models/index_model_spec.rs index bc0241c..a69b786 100644 --- a/openapi/src/models/index_model_spec.rs +++ b/src/openapi/models/index_model_spec.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/openapi/src/models/index_model_status.rs b/src/openapi/models/index_model_status.rs similarity index 97% rename from openapi/src/models/index_model_status.rs rename to src/openapi/models/index_model_status.rs index a86b4a6..960c96c 100644 --- a/openapi/src/models/index_model_status.rs +++ b/src/openapi/models/index_model_status.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/openapi/src/models/index_spec.rs b/src/openapi/models/index_spec.rs similarity index 98% rename from openapi/src/models/index_spec.rs rename to src/openapi/models/index_spec.rs index eccfeb1..2e5dd0d 100644 --- a/openapi/src/models/index_spec.rs +++ b/src/openapi/models/index_spec.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// IndexSpec : The spec object defines how the index should be deployed. For serverless indexes, you define only the cloud and region where the index should be hosted. For pod-based indexes, you define the environment where the index should be hosted, the pod type and size to use, and other index characteristics. diff --git a/openapi/src/models/list_indexes_401_response.rs b/src/openapi/models/list_indexes_401_response.rs similarity index 97% rename from openapi/src/models/list_indexes_401_response.rs rename to src/openapi/models/list_indexes_401_response.rs index 18afeb0..fc93b4d 100644 --- a/openapi/src/models/list_indexes_401_response.rs +++ b/src/openapi/models/list_indexes_401_response.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// ListIndexes401Response : The response shape used for all error responses. diff --git a/openapi/src/models/list_indexes_401_response_error.rs b/src/openapi/models/list_indexes_401_response_error.rs similarity index 98% rename from openapi/src/models/list_indexes_401_response_error.rs rename to src/openapi/models/list_indexes_401_response_error.rs index 8bde255..8fe9bd3 100644 --- a/openapi/src/models/list_indexes_401_response_error.rs +++ b/src/openapi/models/list_indexes_401_response_error.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// ListIndexes401ResponseError : Detailed information about the error that occurred. diff --git a/openapi/src/models/mod.rs b/src/openapi/models/mod.rs similarity index 100% rename from openapi/src/models/mod.rs rename to src/openapi/models/mod.rs diff --git a/openapi/src/models/pod_spec.rs b/src/openapi/models/pod_spec.rs similarity index 98% rename from openapi/src/models/pod_spec.rs rename to src/openapi/models/pod_spec.rs index a9b775f..766b949 100644 --- a/openapi/src/models/pod_spec.rs +++ b/src/openapi/models/pod_spec.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// PodSpec : Configuration needed to deploy a pod-based index. diff --git a/openapi/src/models/pod_spec_metadata_config.rs b/src/openapi/models/pod_spec_metadata_config.rs similarity index 98% rename from openapi/src/models/pod_spec_metadata_config.rs rename to src/openapi/models/pod_spec_metadata_config.rs index ade8201..76c6bac 100644 --- a/openapi/src/models/pod_spec_metadata_config.rs +++ b/src/openapi/models/pod_spec_metadata_config.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// PodSpecMetadataConfig : Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. These configurations are only valid for use with pod-based indexes. diff --git a/openapi/src/models/serverless_spec.rs b/src/openapi/models/serverless_spec.rs similarity index 98% rename from openapi/src/models/serverless_spec.rs rename to src/openapi/models/serverless_spec.rs index 427e5c7..6b03453 100644 --- a/openapi/src/models/serverless_spec.rs +++ b/src/openapi/models/serverless_spec.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -use crate::models; +use crate::openapi::models; use serde::{Deserialize, Serialize}; /// ServerlessSpec : Configuration needed to deploy a serverless index. diff --git a/src/pinecone/control.rs b/src/pinecone/control.rs index 5c13567..12c86a0 100644 --- a/src/pinecone/control.rs +++ b/src/pinecone/control.rs @@ -1,15 +1,16 @@ use std::cmp::min; use std::time::Duration; +use crate::openapi::apis::manage_indexes_api; +use crate::openapi::models::CreateIndexRequest; use crate::pinecone::PineconeClient; use crate::utils::errors::PineconeError; -use openapi::apis::manage_indexes_api; -pub use openapi::models::create_index_request::Metric; -pub use openapi::models::serverless_spec::Cloud; -pub use openapi::models::{ - CollectionList, CollectionModel, ConfigureIndexRequest, ConfigureIndexRequestSpec, - ConfigureIndexRequestSpecPod, CreateCollectionRequest, CreateIndexRequest, IndexList, +pub use crate::openapi::models::create_index_request::Metric; +pub use crate::openapi::models::serverless_spec::Cloud; +pub use crate::openapi::models::{ + index_model::Metric as OpenApiMetric, CollectionList, CollectionModel, ConfigureIndexRequest, + ConfigureIndexRequestSpec, ConfigureIndexRequestSpecPod, CreateCollectionRequest, IndexList, IndexModel, IndexSpec, PodSpec, PodSpecMetadataConfig, ServerlessSpec, }; @@ -532,8 +533,11 @@ impl PineconeClient { #[cfg(test)] mod tests { use super::*; + use crate::openapi::{ + self, + models::{self, collection_model::Status, IndexList}, + }; use httpmock::prelude::*; - use openapi::models::{self, collection_model::Status, IndexList}; use tokio; #[tokio::test] diff --git a/src/pinecone/data.rs b/src/pinecone/data.rs index f55909f..c904b34 100644 --- a/src/pinecone/data.rs +++ b/src/pinecone/data.rs @@ -15,7 +15,7 @@ pub use prost_types::{value::Kind, Struct as Metadata, Value}; /// Generated protobuf module for data plane. pub mod pb { - include!("../../protos/_.rs"); + include!("../protos/_.rs"); } #[derive(Debug, Clone)] diff --git a/src/pinecone/mod.rs b/src/pinecone/mod.rs index 4633847..d156f8c 100644 --- a/src/pinecone/mod.rs +++ b/src/pinecone/mod.rs @@ -1,8 +1,8 @@ use crate::config::Config; +use crate::openapi::apis::configuration::ApiKey; +use crate::openapi::apis::configuration::Configuration; use crate::utils::errors::PineconeError; use crate::utils::user_agent::get_user_agent; -use openapi::apis::configuration::ApiKey; -use openapi::apis::configuration::Configuration; use serde_json; use std::collections::HashMap; diff --git a/protos/_.rs b/src/protos/_.rs similarity index 100% rename from protos/_.rs rename to src/protos/_.rs diff --git a/protos/google.api.rs b/src/protos/google.api.rs similarity index 100% rename from protos/google.api.rs rename to src/protos/google.api.rs diff --git a/src/utils/errors.rs b/src/utils/errors.rs index f987700..96ccafc 100644 --- a/src/utils/errors.rs +++ b/src/utils/errors.rs @@ -1,4 +1,4 @@ -use openapi::apis::{Error as OpenApiError, ResponseContent}; +use crate::openapi::apis::{Error as OpenApiError, ResponseContent}; use reqwest::{self, StatusCode}; @@ -198,61 +198,61 @@ impl std::fmt::Display for PineconeError { "Unknown response error: status: {}, message: {}", status, message ) - }, + } PineconeError::ResourceAlreadyExistsError { source } => { write!(f, "Resource already exists error: {}", source) - }, + } PineconeError::UnprocessableEntityError { source } => { write!(f, "Unprocessable entity error: {}", source) - }, + } PineconeError::PendingCollectionError { source } => { write!(f, "Pending collection error: {}", source) - }, + } PineconeError::InternalServerError { source } => { write!(f, "Internal server error: {}", source) - }, + } PineconeError::ReqwestError { source } => { write!(f, "Reqwest error: {}", source.to_string()) - }, + } PineconeError::SerdeError { source } => { write!(f, "Serde error: {}", source.to_string()) - }, + } PineconeError::IoError { message } => { write!(f, "IO error: {}", message) - }, + } PineconeError::BadRequestError { source } => { write!(f, "Bad request error: {}", source) - }, + } PineconeError::UnauthorizedError { source } => { write!(f, "Unauthorized error: status: {}", source) - }, + } PineconeError::PodQuotaExceededError { source } => { write!(f, "Pod quota exceeded error: {}", source) - }, + } PineconeError::CollectionsQuotaExceededError { source } => { write!(f, "Collections quota exceeded error: {}", source) - }, + } PineconeError::InvalidCloudError { source } => { write!(f, "Invalid cloud error: status: {}", source) - }, + } PineconeError::InvalidRegionError { source } => { write!(f, "Invalid region error: {}", source) - }, + } PineconeError::CollectionNotFoundError { source } => { write!(f, "Collection not found error: {}", source) - }, + } PineconeError::IndexNotFoundError { source } => { write!(f, "Index not found error: status: {}", source) - }, + } PineconeError::APIKeyMissingError { message } => { write!(f, "API key missing error: {}", message) - }, + } PineconeError::InvalidHeadersError { message } => { write!(f, "Invalid headers error: {}", message) - }, + } PineconeError::TimeoutError { message } => { write!(f, "Timeout error: {}", message) - }, + } PineconeError::ConnectionError { source } => { write!(f, "Connection error: {}", source) } diff --git a/tests/integration_test.rs b/tests/integration_test.rs index b7bc44b..d50c17b 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -1,5 +1,5 @@ -use openapi::models::index_model::Metric as OpenApiMetric; -use openapi::models::serverless_spec::Cloud as OpenApiCloud; +use pinecone_sdk::openapi::models::serverless_spec::Cloud as OpenApiCloud; +use pinecone_sdk::pinecone::control::OpenApiMetric; use pinecone_sdk::pinecone::control::{Cloud, Metric, WaitPolicy}; use pinecone_sdk::pinecone::data::{Kind, Metadata, SparseValues, Value, Vector}; use pinecone_sdk::pinecone::PineconeClient; From 20d6b2ccebc69741ce1caa9fb730b07720f3bf08 Mon Sep 17 00:00:00 2001 From: Emily Yu Date: Mon, 22 Jul 2024 10:25:48 -0400 Subject: [PATCH 3/6] Update proto output path --- codegen/build-proto.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codegen/build-proto.sh b/codegen/build-proto.sh index f07df0e..ff6c301 100755 --- a/codegen/build-proto.sh +++ b/codegen/build-proto.sh @@ -1,14 +1,14 @@ #!/bin/bash SCRIPT_DIR=$(dirname "$(realpath "$0")") -outdir="protos" +PROJECT_DIR=$(realpath "$SCRIPT_DIR/..") -OUT_DIR=$SCRIPT_DIR/../$outdir +outdir="src/protos" pushd $SCRIPT_DIR/apis just build popd pushd $SCRIPT_DIR/proto_build - cargo run -- $OUT_DIR + cargo run -- $PROJECT_DIR/$outdir popd From c6cc2df70d04ab5ea4813b255d79c62e3c6f40e2 Mon Sep 17 00:00:00 2001 From: Emily Yu Date: Mon, 22 Jul 2024 11:26:56 -0400 Subject: [PATCH 4/6] Turn proto into module and disable warnings for undocumented code in generated code --- codegen/build-oas.sh | 10 +++++++--- codegen/build-proto.sh | 8 ++++++++ src/lib.rs | 4 ++++ src/openapi/mod.rs | 1 + src/pinecone/data.rs | 40 ++++++++++++++++++------------------- src/protos/{_.rs => mod.rs} | 1 + 6 files changed, 40 insertions(+), 24 deletions(-) rename src/protos/{_.rs => mod.rs} (99%) diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 79fa309..ae6c93d 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -3,13 +3,13 @@ SCRIPT_DIR=$(dirname "$(realpath "$0")") PROJECT_DIR=$(realpath "$SCRIPT_DIR/..") +tempdir=".openapi-crate" +outdir="src/openapi" + pushd $PROJECT_DIR/codegen/apis just build popd -tempdir=".openapi-crate" -outdir="src/openapi" - docker run --rm -v $(pwd):/workspace openapitools/openapi-generator-cli:v7.6.0 generate \ --input-spec /workspace/codegen/apis/_build/2024-07/control_2024-07.oas.yaml \ --generator-name rust \ @@ -18,6 +18,7 @@ docker run --rm -v $(pwd):/workspace openapitools/openapi-generator-cli:v7.6.0 g # copy source files from the crate to the module (outdir) echo "Copying source files from $tempdir to $outdir" +mod_header=$'\n#![allow(missing_docs)]\n' pushd $PROJECT_DIR # copy the readme to the outdir cp $tempdir/README.md $outdir/README.md @@ -28,6 +29,9 @@ pushd $PROJECT_DIR # rename the lib.rs file to mod.rs mv $outdir/lib.rs $outdir/mod.rs + # add line at the top to disable warnings for undocumented code + sed -i "" "1 i\\$mod_header" $outdir/mod.rs + # in each source file, replace "crate::" with "crate::openapi::" for f in $(find $outdir -type f); do sed -i "" 's/crate::/crate::openapi::/g' $f diff --git a/codegen/build-proto.sh b/codegen/build-proto.sh index ff6c301..e2dc5a0 100755 --- a/codegen/build-proto.sh +++ b/codegen/build-proto.sh @@ -12,3 +12,11 @@ popd pushd $SCRIPT_DIR/proto_build cargo run -- $PROJECT_DIR/$outdir popd + +mod_header=$'\n#![allow(missing_docs)]\n' +pushd $PROJECT_DIR/$outdir + # rename _.rs to mod.rs + mv _.rs mod.rs + # add line at the top to disable warnings for undocumented code + sed -i "" "1 i\\$mod_header" mod.rs +popd diff --git a/src/lib.rs b/src/lib.rs index 6d91150..3587b01 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,4 +15,8 @@ pub mod pinecone; /// Utility modules. pub mod utils; +/// OpenAPI client for Pinecone. pub mod openapi; + +/// Protobuf client for Pinecone. +pub mod protos; diff --git a/src/openapi/mod.rs b/src/openapi/mod.rs index a1837b9..62e4891 100644 --- a/src/openapi/mod.rs +++ b/src/openapi/mod.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] diff --git a/src/pinecone/data.rs b/src/pinecone/data.rs index 0355de5..a34143d 100644 --- a/src/pinecone/data.rs +++ b/src/pinecone/data.rs @@ -1,24 +1,19 @@ use crate::pinecone::PineconeClient; +use crate::protos::vector_service_client::VectorServiceClient; use crate::utils::errors::PineconeError; use once_cell::sync::Lazy; -use pb::vector_service_client::VectorServiceClient; use tonic::metadata::{Ascii, MetadataValue as TonicMetadataVal}; use tonic::service::interceptor::InterceptedService; use tonic::service::Interceptor; use tonic::transport::Channel; use tonic::{Request, Status}; -pub use pb::{ - DescribeIndexStatsResponse, FetchResponse, ListResponse, QueryResponse, SparseValues, UpdateResponse, - UpsertResponse, Vector, +pub use crate::protos::{ + self, DescribeIndexStatsResponse, FetchResponse, ListResponse, QueryResponse, SparseValues, + UpdateResponse, UpsertResponse, Vector, }; pub use prost_types::{value::Kind, Struct as Metadata, Value}; -/// Generated protobuf module for data plane. -pub mod pb { - include!("../protos/_.rs"); -} - #[derive(Debug, Clone)] struct ApiKeyInterceptor { api_token: TonicMetadataVal, @@ -102,7 +97,7 @@ impl Index { vectors: &[Vector], namespace: &Namespace, ) -> Result { - let request = pb::UpsertRequest { + let request = protos::UpsertRequest { vectors: vectors.to_vec(), namespace: namespace.name.clone(), }; @@ -151,7 +146,7 @@ impl Index { limit: Option, pagination_token: Option, ) -> Result { - let request = pb::ListRequest { + let request = protos::ListRequest { namespace: namespace.name.clone(), prefix, limit, @@ -200,7 +195,7 @@ impl Index { &mut self, filter: Option, ) -> Result { - let request = pb::DescribeIndexStatsRequest { filter }; + let request = protos::DescribeIndexStatsRequest { filter }; let response = self .connection @@ -212,7 +207,10 @@ impl Index { Ok(response) } - async fn query(&mut self, request: pb::QueryRequest) -> Result { + async fn query( + &mut self, + request: protos::QueryRequest, + ) -> Result { let response = self .connection .query(request) @@ -260,7 +258,7 @@ impl Index { metadata: Option, namespace: &Namespace, ) -> Result { - let request = pb::UpdateRequest { + let request = protos::UpdateRequest { id, values, sparse_values, @@ -316,7 +314,7 @@ impl Index { include_values: Option, include_metadata: Option, ) -> Result { - let request = pb::QueryRequest { + let request = protos::QueryRequest { id, top_k, namespace: namespace.name.clone(), @@ -373,7 +371,7 @@ impl Index { include_values: Option, include_metadata: Option, ) -> Result { - let request = pb::QueryRequest { + let request = protos::QueryRequest { id: "".to_string(), top_k, namespace: namespace.name.clone(), @@ -419,7 +417,7 @@ impl Index { ids: &[String], namespace: &Namespace, ) -> Result<(), PineconeError> { - let request = pb::DeleteRequest { + let request = protos::DeleteRequest { ids: ids.to_vec(), delete_all: false, namespace: namespace.name.clone(), @@ -454,7 +452,7 @@ impl Index { /// # } /// ``` pub async fn delete_all(&mut self, namespace: &Namespace) -> Result<(), PineconeError> { - let request = pb::DeleteRequest { + let request = protos::DeleteRequest { ids: vec![], delete_all: true, namespace: namespace.name.clone(), @@ -498,7 +496,7 @@ impl Index { filter: Metadata, namespace: &Namespace, ) -> Result<(), PineconeError> { - let request = pb::DeleteRequest { + let request = protos::DeleteRequest { ids: vec![], delete_all: false, namespace: namespace.name.clone(), @@ -509,7 +507,7 @@ impl Index { } // Helper function to call delete operation - async fn delete(&mut self, request: pb::DeleteRequest) -> Result<(), PineconeError> { + async fn delete(&mut self, request: protos::DeleteRequest) -> Result<(), PineconeError> { let _ = self .connection .delete(request) @@ -552,7 +550,7 @@ impl Index { ids: &[String], namespace: &Namespace, ) -> Result { - let request = pb::FetchRequest { + let request = protos::FetchRequest { ids: ids.to_vec(), namespace: namespace.name.clone(), }; diff --git a/src/protos/_.rs b/src/protos/mod.rs similarity index 99% rename from src/protos/_.rs rename to src/protos/mod.rs index 7aa02b7..076d12d 100644 --- a/src/protos/_.rs +++ b/src/protos/mod.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] // This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] From ff41b56530e6daa1e38701561b8d36e270d19c2d Mon Sep 17 00:00:00 2001 From: Emily Yu Date: Fri, 26 Jul 2024 11:48:15 -0400 Subject: [PATCH 5/6] Remove config.rs file --- src/config.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/config.rs diff --git a/src/config.rs b/src/config.rs deleted file mode 100644 index 27cfe31..0000000 --- a/src/config.rs +++ /dev/null @@ -1,29 +0,0 @@ -use std::collections::HashMap; - -/// Configuration for the Pinecone SDK struct. -#[derive(Debug, Clone)] -pub struct Config { - /// The API key for your Pinecone project. You can find this in the [Pinecone console](https://app.pinecone.io). - pub api_key: String, - - /// Optional configuration field for specifying the controller host. - pub controller_url: String, - - /// Optional headers to be included in all requests. - pub additional_headers: HashMap, - - /// Optional sourceTag that is applied to the User-Agent header with all requests. - pub source_tag: Option, -} - -impl Config { - /// Builds a new Config struct. - pub fn new(api_key: String, source_tag: Option) -> Self { - Config { - api_key, - controller_url: "https://api.pinecone.io".to_string(), - additional_headers: HashMap::new(), - source_tag, - } - } -} From bab34f5392e1cc69967dd6bfec60ffcd9861034e Mon Sep 17 00:00:00 2001 From: Emily Yu Date: Mon, 29 Jul 2024 11:13:44 -0400 Subject: [PATCH 6/6] Remove pinecone_sdk folder --- pinecone_sdk/Cargo.toml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 pinecone_sdk/Cargo.toml diff --git a/pinecone_sdk/Cargo.toml b/pinecone_sdk/Cargo.toml deleted file mode 100644 index 407b1a7..0000000 --- a/pinecone_sdk/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "pinecone_sdk" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -openapi = { path = "../openapi" } -tokio = { version = "1", features = ["full"] } -regex = "1.10.4" -serde_json = "1.0.117" -snafu = "0.8.3" -rand = "0.8.5" -tonic = { version = "0.11.0", features = ["tls", "transport", "tls-roots"] } -prost = "0.12.6" -prost-types = "0.12.6" -reqwest = "0.12.5" -once_cell = "1.19.0" - -[dev-dependencies] -temp-env = "0.3.6" -httpmock = "0.7.0-rc.1" - -[build-dependencies] -tonic-build = "0.11.0"