-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support custom chat render (#3499)
Co-authored-by: 野声 <lijiacheng.ljc@antgroup.com>
- Loading branch information
Showing
8 changed files
with
238 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/ai-native/src/browser/chat/chat.render.registry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Injectable } from '@opensumi/di'; | ||
import { Disposable } from '@opensumi/ide-core-common'; | ||
|
||
import { | ||
ChatAIRoleRender, | ||
ChatThinkingRender, | ||
ChatUserRoleRender, | ||
ChatWelcomeRender, | ||
IChatRenderRegistry, | ||
} from '../types'; | ||
|
||
@Injectable() | ||
export class ChatRenderRegistry extends Disposable implements IChatRenderRegistry { | ||
public chatWelcomeRender?: ChatWelcomeRender; | ||
public chatAIRoleRender?: ChatAIRoleRender; | ||
public chatUserRoleRender?: ChatUserRoleRender; | ||
public chatThinkingRender?: ChatThinkingRender; | ||
|
||
registerWelcomeRender(render: ChatWelcomeRender): void { | ||
this.chatWelcomeRender = render; | ||
} | ||
|
||
registerAIRoleRender(render: ChatAIRoleRender): void { | ||
this.chatAIRoleRender = render; | ||
} | ||
|
||
registerUserRoleRender(render: ChatUserRoleRender): void { | ||
this.chatUserRoleRender = render; | ||
} | ||
|
||
registerThinkingRender(render: ChatThinkingRender): void { | ||
this.chatThinkingRender = render; | ||
} | ||
} |
Oops, something went wrong.