fix: 重复处理首个 chunk

This commit is contained in:
wisdgod
2025-01-28 06:27:14 +08:00
parent 00a6980da9
commit 0d8035fd02
3 changed files with 25 additions and 23 deletions

View File

@@ -125,6 +125,7 @@ impl ErrorResponse {
pub enum StreamError {
ChatError(ChatError),
DataLengthLessThan5,
EmptyStream,
}
impl std::fmt::Display for StreamError {
@@ -132,6 +133,7 @@ impl std::fmt::Display for StreamError {
match self {
StreamError::ChatError(error) => write!(f, "{}", error.error.code),
StreamError::DataLengthLessThan5 => write!(f, "data length less than 5"),
StreamError::EmptyStream => write!(f, "empty stream"),
}
}
}