Format Rust code using rustfmt

This commit is contained in:
github-actions[bot] 2023-11-13 20:12:16 +00:00 committed by GitHub
parent 17555ddfa3
commit 2f5e080d61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 27 deletions

View File

@ -89,30 +89,31 @@ async fn handle_message(
.post("http://localhost:3030/completion")
.json(&req)
.send()
.await {
Ok(res) => res,
Err(e) => {
return Err(LlmError::RequestFailed {
error: format!("{}", e),
});
}
};
let llm_response = match res.json::<LlmResponse>()
.await
{
Ok(response) => response,
Err(e) => {
return Err(LlmError::DeserializationToLlmResponseFailed {
error: format!("{}", e),
});
}
};
{
Ok(res) => res,
Err(e) => {
return Err(LlmError::RequestFailed {
error: format!("{}", e),
});
}
};
let _ = _print_tx.send(Printout {
verbosity: 0,
content: format!("llm: {:?}", llm_response.clone().content)
}).await;
let llm_response = match res.json::<LlmResponse>().await {
Ok(response) => response,
Err(e) => {
return Err(LlmError::DeserializationToLlmResponseFailed {
error: format!("{}", e),
});
}
};
let _ = _print_tx
.send(Printout {
verbosity: 0,
content: format!("llm: {:?}", llm_response.clone().content),
})
.await;
let message = KernelMessage {
id,
@ -125,10 +126,8 @@ async fn handle_message(
message: Message::Response((
Response {
inherit: false,
ipc: serde_json::to_vec::<Result<LlmResponse, LlmError>>(&Ok(
llm_response,
))
.unwrap(),
ipc: serde_json::to_vec::<Result<LlmResponse, LlmError>>(&Ok(llm_response))
.unwrap(),
metadata: None,
},
None,

View File

@ -256,7 +256,7 @@ async fn main() {
ProcessId::new(Some("encryptor"), "sys", "uqbar"),
encryptor_sender,
false,
)
),
];
#[cfg(feature = "llm")]