gpt4 book ai didi

flutter - OpenAI ChatGPT (GPT-3.5) API : Why does it take so long to get a completion?

转载 作者:行者123 更新时间:2023-12-02 22:48:31 30 4
gpt4 key购买 nike

我正在尝试在我的 Flutter 应用程序中使用 GPT 3.5。我得到了答复,但需要 30-60 秒才能得到答复。代码如下:

 Future<String> getResponse(String message) async {
OpenAI.apiKey = openApiKey;
try {
final chatCompletion = await OpenAI.instance.chat.create(
model: 'gpt-3.5-turbo',
messages: [
OpenAIChatCompletionChoiceMessageModel(
content: message,
role: OpenAIChatMessageRole.user,
),
],
);
print(chatCompletion);
return chatCompletion.choices.first.message.content;
} catch (e) {
return "Something went wrong. Please try again later.";
}
}

现在我有一个个人帐户,并且我没有在 OpenAI 网站上付费订阅。我的代码有问题吗?或者我应该选择付费计划,这样可以解决问题并且响应速度会更快吗?

最佳答案

这可能是由于 OpenAI 服务器过载造成的。

正如官方解释的OpenAI forum by @rob.wheatley :

The last few days have been really quite bad. Even with streaming, aresponse could take a long time to start. But last night, as I wastesting my new streaming interface, I noticed some odd, but promising,behavior. Randomly, I would get very quick responses. They were rareat first. /.../ This morning, all responses have been quick so far.

So, the whole thing looks like a capacity issue to me. Not great ifyou are building a commercial app.

来源:

关于flutter - OpenAI ChatGPT (GPT-3.5) API : Why does it take so long to get a completion?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75987139/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com