Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

复现教程过程我遇到的三个问题 #17

Open
michael7908 opened this issue Jul 16, 2023 · 1 comment
Open

复现教程过程我遇到的三个问题 #17

michael7908 opened this issue Jul 16, 2023 · 1 comment

Comments

@michael7908
Copy link

  1. 粘贴 添加了"追踪上下文"功能的代码(如下)后, 点击运行报错
    import cloud from '@lafjs/cloud'
    export async function main(ctx: FunctionContext) {
    const { ChatGPTAPI } = await import('chatgpt')
    const api = new ChatGPTAPI({ apiKey: cloud.env.CHAT_GPT_API_KEY })

let res = await api.sendMessage('“鸡你太美”指的是中国大陆哪位男艺人?给你个提示,他喜欢唱、跳、篮球、Rap')
console.log(res.text)

// 传入 parentMessageId 追踪上下文
res = await api.sendMessage('不对,他姓蔡,请重新回答', {
parentMessageId: res.id
})
console.log(res.text)

return res.text
}

报错讯息:AxiosError: Request failed with status code 502"
已排除API问题;也不是代码拷贝有误——因为第一段代码运行正常,甚至第一次就会出现正确答案(蔡徐坤)。

2.laf左下角选择了内置依赖chatgpt后,安装并重启后并如教程中那样没有出现“自定义依赖 chatGPT 版本号”,依然是空白一片。

  1. VS code 打开本地的feat-1后, 运行npm run dev后,弹出的UI界面无法回答问题。
    报错讯息:出错了,请重试!
    依然排除OpenAI的API问题。

还望大神拨冗解答,谢谢!

@michael7908
Copy link
Author

更新一下:
1)今天上laf,换了容量大一点的服务器,上面的这些问题就都解决了——不需要按教程里介绍的那样安装npm的chatgpt依赖,一样可以在本地复现项目;
2)但问题是:问答没几轮,回答时AI就开始报错。还望左风大神拨冗解答root cause。
谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant