Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

request stream: false, for post processing

CJ Pais2211da652ea4
diff --git a/src-tauri/src/llm_client.rs b/src-tauri/src/llm_client.rs
index 6ed64c12..381f3a75 100644
--- a/src-tauri/src/llm_client.rs
+++ b/src-tauri/src/llm_client.rs
@@ -112,6 +112,7 @@ fn remember_rejection(key: String) {
struct ChatCompletionRequest {
model: String,
messages: Vec<ChatMessage>,
+ stream: bool,
#[serde(skip_serializing_if = "Option::is_none")]
response_format: Option<ResponseFormat>,
#[serde(flatten)]
@@ -264,6 +265,7 @@ pub async fn send_chat_completion_with_schema(
let mut request_body = ChatCompletionRequest {
model: model.to_string(),
messages,
+ stream: false,
response_format,
reasoning,
};
@@ -413,12 +415,19 @@ mod tests {
role: "user".to_string(),
content: "hi".to_string(),
}],
+ stream: false,
response_format: None,
reasoning,
};
serde_json::to_value(&request).unwrap()
}
+ #[test]
+ fn requests_explicitly_disable_streaming() {
+ let json = request_json(ReasoningParams::default());
+ assert_eq!(json["stream"], false);
+ }
+
#[test]
fn default_reasoning_params_serialize_to_no_fields() {
let json = request_json(ReasoningParams::default());