require(...).main is not a function
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)
l***@163.com
- 发布:2024-04-07 11:43
- 更新:2024-04-07 17:43
- 阅读:130
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
})
return res
}
}
或者按照那个uni-ai实例写的都不行,都是require(...).main is not a function
l***@163.com (作者)
用的是你们阿里云的空间,按照module.exports = {
_before: function() { // 通用预处理器
}也按照uni-ai实例复制过来的,都是这个错误
2024-04-07 14:29
l***@163.com (作者)
回复 l***@163.com: require(...).main is not a function
TypeError: require(...).main is not a function
at Q (/tmp/function/index.js:1:24492)
at z (/tmp/function/index.js:1:25555)
at ce (/tmp/function/index.js:1:26525)
at runUserFunction (/code/index.js:93:265042)
at (<anonymous>)
2024-04-07 14:35