mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-30 07:39:06 +08:00
fix(api): enhance message status handling
- Updated MessageStatus type to include 'pending' as a new state, reflecting the message processing lifecycle. - Modified CreateMessageDto and UpdateMessageDto interfaces to utilize the updated MessageStatus type for improved clarity and consistency in message status management.
This commit is contained in:
parent
5061472850
commit
942e014d92
@ -11,6 +11,7 @@ import type {
|
||||
MessageData,
|
||||
MessageRole,
|
||||
MessageStats,
|
||||
MessageStatus,
|
||||
TreeResponse
|
||||
} from '@shared/data/types/message'
|
||||
import type { AssistantMeta, ModelMeta } from '@shared/data/types/meta'
|
||||
@ -30,7 +31,7 @@ export interface CreateMessageDto {
|
||||
/** Message content */
|
||||
data: MessageData
|
||||
/** Message status */
|
||||
status?: 'success' | 'error' | 'paused'
|
||||
status?: MessageStatus
|
||||
/** Siblings group ID (0 = normal, >0 = multi-model group) */
|
||||
siblingsGroupId?: number
|
||||
/** Assistant ID */
|
||||
@ -58,7 +59,7 @@ export interface UpdateMessageDto {
|
||||
/** Change siblings group */
|
||||
siblingsGroupId?: number
|
||||
/** Update status */
|
||||
status?: 'success' | 'error' | 'paused'
|
||||
status?: MessageStatus
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -182,9 +182,13 @@ import type { AssistantMeta, ModelMeta } from './meta'
|
||||
export type MessageRole = 'user' | 'assistant' | 'system'
|
||||
|
||||
/**
|
||||
* Message status - final state after processing
|
||||
* Message status
|
||||
* - pending: Placeholder created, streaming in progress
|
||||
* - success: Completed successfully
|
||||
* - error: Failed with error
|
||||
* - paused: User stopped generation
|
||||
*/
|
||||
export type MessageStatus = 'success' | 'error' | 'paused'
|
||||
export type MessageStatus = 'pending' | 'success' | 'error' | 'paused'
|
||||
|
||||
/**
|
||||
* Complete message entity as stored in database
|
||||
|
||||
Loading…
Reference in New Issue
Block a user