-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: chat service & support sendReplyMessage api (#3539)
- Loading branch information
Showing
16 changed files
with
210 additions
and
142 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
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
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,29 @@ | ||
import { Autowired, Injectable } from '@opensumi/di'; | ||
import { Disposable, Emitter, Event } from '@opensumi/ide-core-common'; | ||
|
||
import { IChatInternalService, IChatMessageStructure } from '../../common'; | ||
|
||
import { ChatInternalService } from './chat.internal.service'; | ||
|
||
@Injectable() | ||
export class ChatService extends Disposable { | ||
@Autowired(IChatInternalService) | ||
private chatInternalService: ChatInternalService; | ||
|
||
private readonly _onChatMessageLaunch = new Emitter<IChatMessageStructure>(); | ||
public readonly onChatMessageLaunch: Event<IChatMessageStructure> = this._onChatMessageLaunch.event; | ||
|
||
private readonly _onChatReplyMessageLaunch = new Emitter<string>(); | ||
public readonly onChatReplyMessageLaunch: Event<string> = this._onChatReplyMessageLaunch.event; | ||
|
||
public sendMessage(data: IChatMessageStructure) { | ||
this._onChatMessageLaunch.fire(data); | ||
} | ||
|
||
/** | ||
* 主动以 ai role 的身份回复消息 | ||
*/ | ||
public sendReplyMessage(data: string) { | ||
this._onChatReplyMessageLaunch.fire(data); | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -336,3 +336,11 @@ | |
} | ||
} | ||
} | ||
|
||
.chat_with_more_actions { | ||
&:hover { | ||
div[class*='chat_msg_more_actions___'] { | ||
display: flex; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.