Skip to content

Commit ed22ee5

Browse files
committed
fix: fix fmt
1 parent 91a742a commit ed22ee5

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

lib/llm/src/http/service/openai.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -546,19 +546,20 @@ async fn chat_completions(
546546
process_metrics_only(response, &mut response_collector);
547547
});
548548

549-
let response = NvCreateChatCompletionResponse::from_annotated_stream(stream, tool_parser_name)
550-
.await
551-
.map_err(|e| {
552-
tracing::error!(
553-
request_id,
554-
"Failed to fold chat completions stream for: {:?}",
555-
e
556-
);
557-
ErrorMessage::internal_server_error(&format!(
558-
"Failed to fold chat completions stream: {}",
559-
e
560-
))
561-
})?;
549+
let response =
550+
NvCreateChatCompletionResponse::from_annotated_stream(stream, tool_parser_name)
551+
.await
552+
.map_err(|e| {
553+
tracing::error!(
554+
request_id,
555+
"Failed to fold chat completions stream for: {:?}",
556+
e
557+
);
558+
ErrorMessage::internal_server_error(&format!(
559+
"Failed to fold chat completions stream: {}",
560+
e
561+
))
562+
})?;
562563

563564
inflight_guard.mark_ok();
564565
Ok(Json(response).into_response())

lib/llm/src/protocols/openai/chat_completions/aggregator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ impl DeltaAggregator {
165165
// After aggregation, inspect each choice's text for tool call syntax
166166
for choice in aggregator.choices.values_mut() {
167167
if choice.tool_calls.is_none() {
168-
if let Ok(tool_calls) = try_tool_call_parse_aggregate(&choice.text, tool_parser_name.as_deref()) {
168+
if let Ok(tool_calls) =
169+
try_tool_call_parse_aggregate(&choice.text, tool_parser_name.as_deref())
170+
{
169171
if tool_calls.is_empty() {
170172
continue;
171173
}

0 commit comments

Comments
 (0)