added login

This commit is contained in:
2025-10-09 10:05:59 +01:00
parent edc7567d15
commit 4f72cc6abe
6 changed files with 228 additions and 41 deletions
+5 -2
View File
@@ -42,7 +42,7 @@ impl LlmWorker {
.json(&payload)
.send()
.await
.unwrap();
.map_err(|_| String::from("Failed to make request to LLM server"))?;
// The API returns a JSON with `choices[].message.content`
#[derive(Deserialize)]
@@ -54,7 +54,10 @@ impl LlmWorker {
message: Message,
}
let llm_resp: LlmResponse = resp.json().await.unwrap();
let llm_resp: LlmResponse = resp
.json()
.await
.map_err(|_| String::from("Failed to make request to LLM server"))?;
Ok(ChatMsg {
display_name: message.display_name.clone(),