Skip to content

Commit bb932d2

Browse files
committed
refactor: rewrite entire library to use HttpClient trait instead of reqwest::Client
- Replace hardcoded reqwest::Client with HttpClient trait throughout - Client struct now accepts any HttpClient implementation - Remove duplicate ClientWithTrait and ChatWithTrait structures - All API methods (get, post, delete) now use the trait - Backward compatibility: forms and streaming still use reqwest directly (TODO) - Default implementation uses reqwest::Client for zero breaking changes - This enables middleware injection for tracing, logging, etc.
1 parent b758b55 commit bb932d2

File tree

5 files changed

+253
-137
lines changed

5 files changed

+253
-137
lines changed

async-openai/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ byot = []
2828

2929
[dependencies]
3030
async-openai-macros = { path = "../async-openai-macros", version = "0.1.0" }
31+
async-trait = "0.1"
3132
backoff = { version = "0.4.0", features = ["tokio"] }
3233
base64 = "0.22.1"
3334
futures = "0.3.31"
@@ -40,6 +41,7 @@ reqwest = { version = "0.12.12", features = [
4041
reqwest-eventsource = "0.6.0"
4142
serde = { version = "1.0.217", features = ["derive", "rc"] }
4243
serde_json = "1.0.135"
44+
serde_urlencoded = "0.7"
4345
thiserror = "2.0.11"
4446
tokio = { version = "1.43.0", features = ["fs", "macros"] }
4547
tokio-stream = "0.1.17"

0 commit comments

Comments
 (0)