Skip to content

Commit dd20247

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 758447d + 6dedb3e commit dd20247

File tree

4 files changed

+354
-18
lines changed

4 files changed

+354
-18
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ edition = "2021"
66
[dependencies]
77
anyhow = "1.0.94"
88
axum = "0.7.9"
9+
futures = "0.3.30"
910
regex = "1.11.1"
10-
reqwest = { version = "0.12.12", default-features = false, features = ["json", "native-tls"] }
11+
reqwest = { version = "0.12.12", default-features = false, features = ["json", "native-tls", "stream"] }
1112
serde = { version = "1.0.215", features = ["serde_derive"] }
1213
serde_json = "1.0.133"
1314
serde_yml = "0.0.12"

src/api.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,32 @@ pub struct OrchestratorResponse {
7878
pub detections: Option<Detections>,
7979
pub warnings: Option<Vec<HashMap<String, String>>>,
8080
}
81+
82+
// Streaming response structures
83+
#[derive(Serialize, Deserialize, Debug)]
84+
pub struct StreamingDelta {
85+
pub content: Option<String>,
86+
pub role: Option<String>,
87+
pub tool_calls: Option<serde_json::Value>,
88+
}
89+
90+
#[derive(Serialize, Deserialize, Debug)]
91+
pub struct StreamingChoice {
92+
pub index: u32,
93+
pub delta: StreamingDelta,
94+
pub logprobs: Option<serde_json::Value>,
95+
pub finish_reason: Option<String>,
96+
pub stop_reason: Option<String>,
97+
}
98+
99+
#[derive(Serialize, Deserialize, Debug)]
100+
pub struct StreamingResponse {
101+
pub id: String,
102+
pub object: String,
103+
pub created: u64,
104+
pub model: String,
105+
pub choices: Vec<StreamingChoice>,
106+
pub usage: Option<serde_json::Value>,
107+
pub detections: Option<Detections>,
108+
pub warnings: Option<Vec<HashMap<String, String>>>,
109+
}

0 commit comments

Comments
 (0)