@chatmoss/model
v0.0.6
Published
chatmoss模型组件
Downloads
2
Readme
chatmoss-model
本sdk已开放moss支持的所有chatgpt模型和文心千帆大模型
使用示例
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('请问你叫什么')