mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
feat(channels): add streaming response hooks to ChannelBase
- Add onResponseChunk hook for progressive text display during streaming - Add onResponseComplete hook for customizing response delivery - Update mock plugin channel to support streaming chunks This enables channels to display AI responses progressively as they stream, improving user experience with real-time feedback. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
0ca8cf86f6
commit
f7979aa902
4 changed files with 117 additions and 17 deletions
|
|
@ -12,7 +12,15 @@ export interface InboundMessage {
|
|||
text: string;
|
||||
}
|
||||
|
||||
/** Plugin Channel → Server (WebSocket) */
|
||||
/** Plugin Channel → Server (WebSocket) — streaming chunk */
|
||||
export interface ChunkMessage {
|
||||
type: 'chunk';
|
||||
messageId: string;
|
||||
chatId: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
/** Plugin Channel → Server (WebSocket) — final response */
|
||||
export interface OutboundMessage {
|
||||
type: 'outbound';
|
||||
messageId: string;
|
||||
|
|
@ -20,4 +28,4 @@ export interface OutboundMessage {
|
|||
text: string;
|
||||
}
|
||||
|
||||
export type WsMessage = InboundMessage | OutboundMessage;
|
||||
export type WsMessage = InboundMessage | ChunkMessage | OutboundMessage;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue