Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
zwpaper committed Jan 7, 2025
1 parent 8d67124 commit e2a8b37
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ee/tabby-webserver/src/service/answer/testutils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,19 @@ impl ChatCompletionStream for FakeChatCompletionStream {
),
tool_calls: None,
function_call: None,
refusal: None,
},
finish_reason: Some(FinishReason::Stop),
logprobs: None,
}],
system_fingerprint: Some("seed".to_owned()),
service_tier: None,
usage: Some(CompletionUsage {
prompt_tokens: 1,
completion_tokens: 2,
total_tokens: 3,
prompt_tokens_details: None,
completion_tokens_details: None,
}),
})
}
Expand All @@ -99,11 +103,20 @@ impl ChatCompletionStream for FakeChatCompletionStream {
content: Some("This is the first part of the response. ".to_string()),
function_call: None,
tool_calls: None,
refusal: None,
},
finish_reason: None,
logprobs: None,
}],
system_fingerprint: Some("seed".to_owned()),
service_tier: None,
usage: Some(CompletionUsage {
prompt_tokens: 1,
completion_tokens: 2,
total_tokens: 3,
prompt_tokens_details: None,
completion_tokens_details: None,
}),
}),
Ok(CreateChatCompletionStreamResponse {
id: "test-stream-response".to_owned(),
Expand All @@ -117,11 +130,20 @@ impl ChatCompletionStream for FakeChatCompletionStream {
content: Some("This is the second part of the response.".to_string()),
function_call: None,
tool_calls: None,
refusal: None,
},
finish_reason: Some(FinishReason::Stop),
logprobs: None,
}],
system_fingerprint: Some("seed".to_owned()),
service_tier: None,
usage: Some(CompletionUsage {
prompt_tokens: 1,
completion_tokens: 2,
total_tokens: 3,
prompt_tokens_details: None,
completion_tokens_details: None,
}),
}),
]);

Expand Down

0 comments on commit e2a8b37

Please sign in to comment.