-
Notifications
You must be signed in to change notification settings - Fork 64
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
context deadline exceeded (Client.Timeout or context cancellation while reading body) #21
Comments
Had the same issue, and made a backend called the Completion API 3 times in the same call. It was getting timed out. Making a custom HTTP client and setting a longer timeout solved it. // passing a custom http client with a timeout of 600 seconds
// this is required because the default http client has a timeout of 30 seconds
httpClient := &http.Client{
Timeout: time.Duration(600 * time.Second),
}
client := gpt3.NewClient(apiKey, gpt3.WithHTTPClient(httpClient)) |
hello |
解决了,非常感谢
…---Original---
From: ***@***.***>
Date: Sat, Feb 18, 2023 18:53 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [PullRequestInc/go-gpt3] context deadline exceeded(Client.Timeout or context cancellation while reading body) (Issue #21)
Had the same issue, and made a backend called the Completion API 3 times in the same call. It was getting timed out. The default HTTP client provided has a timeout of 30 seconds
Making a custom HTTP client and setting a longer timeout solved it.
// passing a custom http client with a timeout of 600 seconds // this is required because the default http client has a timeout of 30 seconds httpClient := &http.Client{ Timeout: time.Duration(600 * time.Second), } client := gpt3.NewClient(apiKey, gpt3.WithHTTPClient(httpClient))
hello
Still return “context deadline exceeded (Client.Timeout or context cancellation while reading body)”
I used streaming call(client.CompletionStreamWithEngine), but the problem was not solved
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
你好,请问你的是流式调用么 |
when I ask a complex question , It will random interrupt.
请输入你的问题(quit 离开): 帮我写个关于 c++ 基础知识的博客
C++是一种面向对象的编程语言,它是一种多范式的编程语言,可以用于开发桌面应用程序、移动应用程序、服务器应用程序、游戏开发等。C++是一种非常强大的编程语言,它拥有非常强大的功能,可以帮助开发者实现复杂的功能。
C++的基础知识包括:
The text was updated successfully, but these errors were encountered: