"docs/api/vscode:/vscode.git/clone" did not exist on "617d55c04e72be51d8b4cc4a90d8b136db27da3b"
Unverified Commit 82eae1fd authored by Paul Hendricks's avatar Paul Hendricks Committed by GitHub
Browse files

refactor: Upgrade async-openai (#1693)

parent 0b47f897
...@@ -199,10 +199,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a" ...@@ -199,10 +199,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
[[package]] [[package]]
name = "async-openai" name = "async-openai"
version = "0.27.2" version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d126927c78e1562d7e8473008ac8b082318c04d69e3a83e3495a563f8b84a66" checksum = "31acf814d6b499e33ec894bb0fd7ddaf2665b44fbdd42b858d736449271fde0c"
dependencies = [ dependencies = [
"async-openai-macros",
"backoff", "backoff",
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
...@@ -222,6 +223,17 @@ dependencies = [ ...@@ -222,6 +223,17 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "async-openai-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0289cba6d5143bfe8251d57b4a8cac036adf158525a76533a7082ba65ec76398"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]] [[package]]
name = "async-stream" name = "async-stream"
version = "0.3.6" version = "0.3.6"
......
...@@ -46,6 +46,7 @@ dynamo-tokens = { path = "lib/tokens", version = "0.3.1" } ...@@ -46,6 +46,7 @@ dynamo-tokens = { path = "lib/tokens", version = "0.3.1" }
# External dependencies # External dependencies
anyhow = { version = "1" } anyhow = { version = "1" }
async-nats = { version = "0.40", features = ["service"] } async-nats = { version = "0.40", features = ["service"] }
async-openai = { version = "0.29.0" }
async-stream = { version = "0.3" } async-stream = { version = "0.3" }
async-trait = { version = "0.1" } async-trait = { version = "0.1" }
async_zmq = { version = "0.4.0" } async_zmq = { version = "0.4.0" }
......
...@@ -45,7 +45,7 @@ tracing = { workspace = true } ...@@ -45,7 +45,7 @@ tracing = { workspace = true }
tracing-subscriber = { workspace = true } tracing-subscriber = { workspace = true }
uuid = { workspace = true } uuid = { workspace = true }
async-openai = { version = "0.27.2" } async-openai = { workspace = true }
clap = { version = "4.5", features = ["derive", "env"] } clap = { version = "4.5", features = ["derive", "env"] }
dialoguer = { version = "0.11", default-features = false, features = ["editor", "history"] } dialoguer = { version = "0.11", default-features = false, features = ["editor", "history"] }
futures-util = { version = "0.3" } futures-util = { version = "0.3" }
......
...@@ -180,10 +180,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a" ...@@ -180,10 +180,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
[[package]] [[package]]
name = "async-openai" name = "async-openai"
version = "0.27.2" version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d126927c78e1562d7e8473008ac8b082318c04d69e3a83e3495a563f8b84a66" checksum = "31acf814d6b499e33ec894bb0fd7ddaf2665b44fbdd42b858d736449271fde0c"
dependencies = [ dependencies = [
"async-openai-macros",
"backoff", "backoff",
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
...@@ -203,6 +204,17 @@ dependencies = [ ...@@ -203,6 +204,17 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "async-openai-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0289cba6d5143bfe8251d57b4a8cac036adf158525a76533a7082ba65ec76398"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]] [[package]]
name = "async-stream" name = "async-stream"
version = "0.3.6" version = "0.3.6"
......
...@@ -44,7 +44,7 @@ dynamo-runtime = { path = "../../runtime" } ...@@ -44,7 +44,7 @@ dynamo-runtime = { path = "../../runtime" }
anyhow = { version = "1" } anyhow = { version = "1" }
async-stream = { version = "0.3" } async-stream = { version = "0.3" }
async-trait = { version = "0.1" } async-trait = { version = "0.1" }
async-openai = "0.27.2" async-openai = { version = "0.29.0" }
futures = { version = "0.3" } futures = { version = "0.3" }
once_cell = { version = "1.20.3" } once_cell = { version = "1.20.3" }
serde = { version = "1" } serde = { version = "1" }
......
...@@ -34,7 +34,7 @@ dynamo-runtime = { workspace = true } ...@@ -34,7 +34,7 @@ dynamo-runtime = { workspace = true }
dynamo-llm = { workspace = true } dynamo-llm = { workspace = true }
anyhow = { workspace = true } anyhow = { workspace = true }
async-openai = "0.27.2" async-openai = { workspace = true }
async-stream = { workspace = true } async-stream = { workspace = true }
async-trait = { workspace = true } async-trait = { workspace = true }
candle-core = { version = "0.8.0" } candle-core = { version = "0.8.0" }
......
...@@ -71,7 +71,7 @@ uuid = { workspace = true } ...@@ -71,7 +71,7 @@ uuid = { workspace = true }
xxhash-rust = { workspace = true } xxhash-rust = { workspace = true }
akin = "0.4.0" akin = "0.4.0"
async-openai = "0.27.2" async-openai = { workspace = true }
blake3 = "1" blake3 = "1"
bytemuck = "1.22" bytemuck = "1.22"
candle-core = { version = "0.8.0" } candle-core = { version = "0.8.0" }
......
...@@ -98,15 +98,12 @@ impl OAIChatLikeRequest for NvCreateCompletionRequest { ...@@ -98,15 +98,12 @@ impl OAIChatLikeRequest for NvCreateCompletionRequest {
fn extract_tokens(&self) -> Option<TokenInput> { fn extract_tokens(&self) -> Option<TokenInput> {
match &self.inner.prompt { match &self.inner.prompt {
async_openai::types::Prompt::IntegerArray(tokens) => Some(TokenInput::Single( async_openai::types::Prompt::IntegerArray(tokens) => {
tokens.iter().map(|&t| t as u32).collect(), Some(TokenInput::Single(tokens.clone()))
)), }
async_openai::types::Prompt::ArrayOfIntegerArray(arrays) => Some(TokenInput::Batch( async_openai::types::Prompt::ArrayOfIntegerArray(arrays) => {
arrays Some(TokenInput::Batch(arrays.clone()))
.iter() }
.map(|arr| arr.iter().map(|&t| t as u32).collect())
.collect(),
)),
_ => None, _ => None,
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment