mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
* 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
19 lines
596 B
JavaScript
19 lines
596 B
JavaScript
import { ShamrockTokenizer, Tokenizer } from './tokenizer.js'
|
|
import { render } from '../common.js'
|
|
|
|
export async function makeWordcloud (e, groupId, duration = 0, userId) {
|
|
let tokenizer = getTokenizer(e)
|
|
let topK = await tokenizer.getKeywordTopK(e, groupId, 100, duration, userId)
|
|
let list = JSON.stringify(topK)
|
|
logger.info(list)
|
|
let img = await render(e, 'chatgpt-plugin', 'wordcloud/index', { list }, { retType: 'base64' })
|
|
return img
|
|
}
|
|
|
|
function getTokenizer (e) {
|
|
if (e.adapter === 'shamrock') {
|
|
return new ShamrockTokenizer()
|
|
} else {
|
|
return new Tokenizer()
|
|
}
|
|
}
|