diff --git a/.cargo/config.toml b/.cargo/config.toml index a480ecf..6b8b460 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,6 @@ [build] -target="wasm32-wasi" +target = "wasm32-wasi" +rustflags = ["--cfg", "wasmedge", "--cfg", "tokio_unstable"] [target.wasm32-wasi] -runner="wasmedge" +runner = "wasmedge" diff --git a/Cargo.toml b/Cargo.toml index 9e9d0b7..7d69c3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,17 +9,28 @@ readme = "README.md" keywords = ["qdrant", "llm", "LlamaEdge", "wasmedge", "ai"] edition = "2021" +[patch.crates-io] +socket2 = { git = "https://github.com/second-state/socket2.git", branch = "v0.5.x" } +reqwest = { git = "https://github.com/second-state/wasi_reqwest.git", branch = "0.11.x" } +hyper = { git = "https://github.com/second-state/wasi_hyper.git", branch = "v0.14.x" } +tokio = { git = "https://github.com/second-state/wasi_tokio.git", branch = "v1.36.x" } + + [lib] name = "qdrant" path = "src/lib.rs" [dependencies] +reqwest = { version = "0.11", default-features = false, features = [ + "json", + "rustls-tls", +], git = "https://github.com/second-state/wasi_reqwest.git", branch = "0.11.x" } + +tokio = { version = "1", features = [ + "full", +], git = "https://github.com/second-state/wasi_tokio.git", branch = "v1.36.x" } + serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -http = "0.2" +http = "1.1" anyhow = "1.0" -reqwest_wasi = { version = "0.11", features = ["json"] } -tokio_wasi = { version = "1.21", features = ["rt", "macros", "net", "time"] } - -[features] -wasmedge-tls = ["reqwest_wasi/wasmedge-tls"] diff --git a/examples/.cargo/config.toml b/examples/.cargo/config.toml new file mode 100644 index 0000000..6b8b460 --- /dev/null +++ b/examples/.cargo/config.toml @@ -0,0 +1,6 @@ +[build] +target = "wasm32-wasi" +rustflags = ["--cfg", "wasmedge", "--cfg", "tokio_unstable"] + +[target.wasm32-wasi] +runner = "wasmedge" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 1083187..8b3b191 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -3,11 +3,24 @@ name = "qdrant_examples" version = "0.1.0" edition = "2021" +[patch.crates-io] +socket2 = { git = "https://github.com/second-state/socket2.git", branch = "v0.5.x" } +reqwest = { git = "https://github.com/second-state/wasi_reqwest.git", branch = "0.11.x" } +hyper = { git = "https://github.com/second-state/wasi_hyper.git", branch = "v0.14.x" } +tokio = { git = "https://github.com/second-state/wasi_tokio.git", branch = "v1.36.x" } + [dependencies] anyhow = "1.0" serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } url = "2.3" -tokio_wasi = { version = "1", features = ["io-util", "fs", "net", "time", "rt", "macros"] } +tokio = { version = "1", features = [ + "io-util", + "fs", + "net", + "time", + "rt", + "macros", +] } # qdrant_rest_client = "0.0.1" -qdrant_rest_client = { git = "https://github.com/second-state/qdrant-rest-client/" } +qdrant_rest_client = { path = ".." }