[Rust Frontend] Populate cached_token_count in responses (#44887)
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
@@ -582,7 +582,8 @@ impl EngineCoreClient {
|
||||
let results: Vec<T> = self.call_utility(method, args).await?;
|
||||
|
||||
if results.iter().all_equal() {
|
||||
// `engine_count >= 1` is enforced during startup handshake so `results` must be non-empty.
|
||||
// `engine_count >= 1` is enforced during startup handshake so `results` must be
|
||||
// non-empty.
|
||||
Ok(results.into_iter().next().unwrap())
|
||||
} else {
|
||||
Err(Error::InconsistentUtilityResults {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::any::type_name;
|
||||
use std::{fmt, str::FromStr};
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
|
||||
use rmpv::Value;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
Reference in New Issue
Block a user