Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Feb 26, 2025
1 parent d825172 commit 1657557
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/ai_test/chat_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,17 @@ async fn get_model_list_test() {
println!("models: {:?}", models);
}

async fn collect_answer(mut stream: QuestionStream, stop_when_num_of_char: Option<u8>) -> String {
async fn collect_answer(
mut stream: QuestionStream,
stop_when_num_of_char: Option<usize>,
) -> String {
let mut answer = String::new();
let mut num_of_char = 0;
let mut num_of_char: usize = 0;
while let Some(value) = stream.next().await {
num_of_char += match value.unwrap() {
QuestionStreamValue::Answer { value } => {
answer.push_str(&value);
value.len() as u8
value.len()
},
QuestionStreamValue::Metadata { .. } => 0,
QuestionStreamValue::KeepAlive => 0,
Expand Down

0 comments on commit 1657557

Please sign in to comment.