@chatmoss/core
v0.1.6
Published
chatmoss核心框架包
Downloads
13
Readme
chatmoss-core
本sdk目前支持moss云所支持的所有模型以及百度文心千帆所有模型,同时支持根据基于本sdk进行对应的前后置插件扩展已经模型扩展
使用示例
npm i @chatmoss/core
npm i @chatmoss/model
import { Moss } from '@chatmoss/core'
import { moss as mossModel, ernieBot as ernieBotModel } from '@chatmoss/model'
const moss = Moss.create({
apiKey: 模型对应的apikey,
secretKey: '模型对应的密钥',
appid: 模型对应的应用id,
model: 模型,
modules: mossModel // 需要加载的模块
})
const message = []
const request = async (prompt) => {
message.push({ role: 'user', content: prompt })
const result = await moss.chat(message)
message.push({ role: 'ai', content: result })
console.log(message)
}
request('请问你叫什么')