Skip to content

Commit f9664e3

Browse files
authored
Add new support for Workers AI API endpoint (#249)
This adds support for the execute model endpoint, as described here: https://developers.cloudflare.com/api/resources/ai/methods/run/ This also adds an optional feature `ndarray` that can deserialize embeddings directly into an `ndarray::ArrayD`.
1 parent 5ee7358 commit f9664e3

File tree

4 files changed

+617
-0
lines changed

4 files changed

+617
-0
lines changed

cloudflare/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ default = ["default-tls"]
1414
blocking = ["reqwest/blocking"]
1515
default-tls = ["reqwest/default-tls"]
1616
rustls-tls = ["reqwest/rustls-tls"]
17+
ndarray = ["dep:ndarray"]
1718
spec = []
1819

1920
[dependencies]
@@ -25,6 +26,7 @@ chrono = { version = "0.4", default-features = false, features = [
2526
] }
2627
http = "1"
2728
mockito = { version = "0.31", optional = true }
29+
ndarray = { version = "0.16", optional = true, features = ["serde"] }
2830
percent-encoding = "2.1.0"
2931
reqwest = { version = "0.12.12", default-features = false, features = ["json"] }
3032
serde = { version = "1.0", features = ["derive"] }

0 commit comments

Comments
 (0)