feat: support code highlight and markdown gfm

This commit is contained in:
Yifei Zhang
2023-03-20 06:06:29 +00:00
parent 12f52bf252
commit f5aef317df
8 changed files with 448 additions and 24 deletions

View File

@@ -24,7 +24,7 @@ export enum Theme {
}
export interface ChatConfig {
maxToken?: number;
maxToken?: number
historyMessageCount: number; // -1 means all
compressMessageLengthThreshold: number;
sendBotMessages: boolean; // send bot's message or not
@@ -282,7 +282,7 @@ export const useChatStore = create<ChatStore>()(
summarizeSession() {
const session = get().currentSession();
if (session.topic === DEFAULT_TOPIC) {
if (session.topic === DEFAULT_TOPIC && session.messages.length >= 3) {
// should summarize topic
requestWithPrompt(
session.messages,