我正在使用ruby-openAI gem与openAI交互,但我得到超时错误,有没有办法可以超过超时限制?
response = @client.completions(
parameters: {
model: "text-davinci-003",
prompt: "In the style of #{@as_written_by}, write a longer article in HTML of at least 750 words using the #{article} as the primary source and basis for the new article, and include interesting facts from the #{secondary_sources}, with a tags around the source of the information pointing to the original URLs",
max_tokens: 3000
})
1条答案
按热度按时间qzlgjiam1#
当你示例化你的客户端时,你可以传递给它一个“request_timeout”属性,并指定所需的持续时间(秒)。
您也可以在配置级别执行此操作:
更多信息请看这里的文档:https://github.com/alexrudall/ruby-openai#custom-timeout-or-base-uri