Skip to content

Commit 1d6947f

Browse files
committed
bump openai_dive
1 parent 23e9487 commit 1d6947f

File tree

8 files changed

+21
-8
lines changed

8 files changed

+21
-8
lines changed

Cargo.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shai-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
shai-core = { path = "../shai-core" }
99
shai-llm = { path = "../shai-llm" }
1010
shai-http = { path = "../shai-http" }
11-
openai_dive = { git = "https://github.com/Marlinski/openai-client", branch = "feature/streaming-api-response" }
11+
openai_dive = "1.3.1"
1212
chrono = "0.4"
1313
clap = { version = "4.0", features = ["derive"] }
1414
tempfile = "3.20.0"

shai-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ libc = "0.2"
2424
schemars = "1.0.1"
2525
shai-macros = { path = "../shai-macros" }
2626
shai-llm = { path = "../shai-llm" }
27-
openai_dive = { git = "https://github.com/Marlinski/openai-client", branch = "feature/streaming-api-response" }
27+
openai_dive = "1.3.1"
2828
regex = "1.0"
2929
walkdir = "2.4"
3030
chrono = { version = "0.4", features = ["serde"] }

shai-http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ thiserror = "2.0"
3232
anyhow = "1.0"
3333

3434
# OpenAI types
35-
openai_dive = { git = "https://github.com/Marlinski/openai-client", branch = "feature/streaming-api-response" }
35+
openai_dive = "1.3.1"
3636
chrono = { version = "0.4", features = ["serde"] }

shai-http/src/apis/openai/completion/handler.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ async fn handle_chat_completion_non_stream(
177177
logprobs: None,
178178
}],
179179
usage: Some(Usage {
180+
input_tokens: None,
181+
input_tokens_details: None,
182+
output_tokens: None,
183+
output_tokens_details: None,
180184
prompt_tokens: Some(0),
181185
completion_tokens: Some(0),
182186
total_tokens: 0,

shai-http/src/apis/openai/response/formatter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ impl ResponseFormatter {
7373
truncation: self.payload.truncation.clone(),
7474
user: self.payload.user.clone(),
7575
usage: Usage {
76+
input_tokens: None,
77+
input_tokens_details: None,
78+
output_tokens: None,
79+
output_tokens_details: None,
7680
completion_tokens: Some(0),
7781
prompt_tokens: Some(0),
7882
total_tokens: 0,

shai-llm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ serde = { version = "1.0", features = ["derive"] }
1414
serde_json = "1.0"
1515
uuid = { version = "1.0", features = ["v4"] }
1616
tokio = { version = "1.0", features = ["full"] }
17-
openai_dive = { git = "https://github.com/Marlinski/openai-client", branch = "feature/streaming-api-response", features = ["stream"] }
17+
openai_dive = { version = "1.3.1", features = ["stream"] }
1818
async-stream = "0.3"
1919
reqwest-eventsource = "0.6"
2020
regex = "1.0"

shai-llm/src/providers/anthropic/anthropic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ impl AnthropicProvider {
381381
logprobs: None,
382382
}],
383383
usage: Some(Usage {
384+
input_tokens: None,
385+
input_tokens_details: None,
386+
output_tokens: None,
387+
output_tokens_details: None,
384388
prompt_tokens: Some(response["usage"]["input_tokens"].as_u64().unwrap_or(0) as u32),
385389
completion_tokens: Some(response["usage"]["output_tokens"].as_u64().unwrap_or(0) as u32),
386390
total_tokens: response["usage"]["input_tokens"].as_u64().unwrap_or(0) as u32 + response["usage"]["output_tokens"].as_u64().unwrap_or(0) as u32,

0 commit comments

Comments
 (0)