feat: 重构对话功能

This commit is contained in:
DEV_DSW
2026-04-14 17:02:20 +08:00
parent b3f07c4cfe
commit c61e41049f
53 changed files with 5200 additions and 1982 deletions

View File

@@ -1,4 +1,12 @@
export interface ChatOptions {
signal?: AbortSignal;
}
export interface GatewayChatMessage {
role: 'system' | 'user' | 'assistant' | 'tool';
content: string;
}
export abstract class BaseProvider {
abstract chat(messages: DialogueMessageProps[], modelName: string): Promise<AsyncIterable<UniversalChunk>>
abstract chat(messages: GatewayChatMessage[], modelName: string, options?: ChatOptions): Promise<AsyncIterable<UniversalChunk>>
}