feat: experimental markdown support (#658)

* feat: test button

* fix: enter

* fix: bing suggested

* fix: bing suggested

* fix: bing suggested

* fix: button under icqq

* fix: 删除suno心跳

* fix: add default md handler

* fix: duplicate this

* fix: add a button

* Update md.js

* Update md.js

* fix: api stream

* fix: claude.ai

* fix: md enhancement

* fix: optional buttons

* fix: mode name

* fix: ignore md while not enable md
This commit is contained in:
ikechan8370 2024-03-05 14:12:50 +08:00 committed by GitHub
parent 58e6201e6e
commit cb3e57bea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 610 additions and 126 deletions

View file

@ -132,7 +132,8 @@ export class ClaudeAIClient {
let body = {
attachments,
files: [],
model: 'claude-2.1',
// 官方更新后这里没有传值了
// model: 'claude-2.1',
prompt: text,
timezone: 'Asia/Hong_Kong'
}

View file

@ -27,6 +27,7 @@ const defaultConfig = {
openAiBaseUrl: defaultOpenAIReverseProxy,
OpenAiPlatformRefreshToken: '',
openAiForceUseReverse: false,
apiStream: false,
drawCD: 30,
model: '',
temperature: 0.8,
@ -178,6 +179,7 @@ const defaultConfig = {
sunoSessToken: '',
sunoClientToken: '',
translateSource: 'openai',
enableMd: false, // 第三方md非QQBot。需要适配器实现segment.markdown和segment.button方可使用否则不建议开启会造成各种错误
version: 'v2.7.10'
}
const _path = process.cwd()

View file

@ -479,7 +479,7 @@ export async function convertFaces (msg, handleAt = false, e) {
groupCardQQMap[groupMembers.get(key).card || groupMembers.get(key).nickname] = groupMembers.get(key).user_id
}
}
}
}
let tmpMsg = ''
let tmpFace = ''
let tmpAt = ''

View file

@ -7,7 +7,7 @@ export async function makeWordcloud (e, groupId, duration = 0, userId) {
let list = JSON.stringify(topK)
logger.info(list)
let img = await render(e, 'chatgpt-plugin', 'wordcloud/index', { list }, { retType: 'base64' })
await e.reply(img, true)
return img
}
function getTokenizer (e) {