-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fetch timeout #330
Comments
Can you give me a little more info about your environment? |
Node 18-alpine docker image, "@deepgram/sdk": "^3.5.0", anything else that could be relevant? |
We use const controller = new AbortController();
const { signal } = controller;
// set up your timeout
const client = createClient(
"API_KEY",
{
global: {
fetch: {
options: {
url: "SOME_URL",
signal,
},
},
}
},
); You can also provide an entirely custom fetch and configure your requirements that way |
Thanks for the tips, I converted it to a custom fetch and it now works. It most likely appears to be a lifetime issue because if I pass it into global options I guess the same signal tries to be used multiple times. For anyone interested in the future, this worked:
|
What is the current behavior?
Speech to text is returning
DeepgramUnknownError: Failed to construct 'Request': member signal is not of type AbortSignal
when attempting to use signal to abort the request after some time
Steps to reproduce
Expected behavior
I would have presumed it wouldn't throw an error, unless I'm doing something wrong, but the types seem to allow this?
Is there another way to add the timeout?
Environment
Node 18
The text was updated successfully, but these errors were encountered: