l***@163.com
l***@163.com
  • 发布:2024-04-07 13:49
  • 更新:2024-04-07 13:50
  • 阅读:146

require(...).main is not a function

分类:uni-app

引入uni-ai时候,云函数运行报错
TypeError: require(...).main is not a function
at Q (/tmp/function/index.js:1:24430)
at z (/tmp/function/index.js:1:25493)
at ce (/tmp/function/index.js:1:26463)
at runUserFunction (/code/index.js:93:265042)
at (/code/index.js:93:259252)

2024-04-07 13:49 负责人:无 分享
已邀请:
l***@163.com

l***@163.com (作者) - lixin

module.exports = {
_before: function() { // 通用预处理器

},  
async chatAi(content) {  
    const llm = uniCloud.ai.getLLMManager()  
    const res = await llm.chatCompletion({  
        messages: [{  
            role: 'user',  
            content: content,  
        }],  
        maxTokens: 3000  
    })  
    console.log("111",content,res)    
    return res  
}  

}

要回复问题请先登录注册