Update router/src/server.rs

This commit is contained in:
Nicolas Patry 2025-03-05 11:45:53 +01:00 committed by GitHub
parent 6777b1075d
commit 9b34930ba1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1287,20 +1287,6 @@ pub(crate) async fn chat_completions(
match result{
Ok(stream_token) => {
let token_text = &stream_token.token.text.clone();
<<<<<<< Updated upstream
=======
let usage = stream_token.details.as_ref().map(|details| {
let completion_tokens = details.generated_tokens;
let prompt_tokens = details.input_length;
let total_tokens = prompt_tokens + completion_tokens;
Usage {
completion_tokens,
prompt_tokens,
total_tokens,
}
});
>>>>>>> Stashed changes
match state {
StreamState::Buffering => {
json_buffer.push_str(&token_text.replace(" ", ""));