https://promptfoo.dev/ logo
Azure OpenAI ECONNRESET
# ❓|questions
n
Hi all, I am having an network issue connecting to Azure OpenAI with [FAIL] API call error: Error: Request failed after 4 retries: request to https://custom-domain.openai.azure.com/openai/deployments/custom-gpt-35-turbo/chat/completions?api-version=2023-07-01-preview failed, reason: read ECONNRESET I tried connecting to the above URL with axios on the same context and it works fine, at least receiving a 404 error as expected. Could you please provide some suggestions? Thank you so much.
I am using v0.28.1
npm - 8.5.5 and node 16.15.0
i
hmm, based on the information provided I'm not sure. Have you fully created the deployment in Azure OpenAI Studio?
There may also be useful debug output:
Copy code
LOG_LEVEL=debug promptfoo eval --no-cache --no-progress-bar
n
Hey Ian, Thank you so much for your reply. debug didnt seem to do much. It just gave the same error. Is there a way to increase verbose level or display a stack trace when an error occurs?
I am wondering if it has to do with the proxy settings. Is there a way force the proxy settings and certificates for network requests
i
That could be it. Do you have a proxy set up for the working requests?
n
Yes I do have the proxy setup which is why axios was working I believe. I wonder if promptfoo overrides the default proxy config or any settings? Is there a way to force using a proxy?
i
It doesn't override the proxy config, but it also doesn't have any special code to support proxy use. Maybe that is something that needs to be added
if the proxy is at the system level, it probably should just work 🤔
n
I would have assumed it work as is using HTTP PROXY env vars. See this https://github.com/node-fetch/node-fetch/issues/195
I believe the code is using node-fetch modules?
i
yep, it is using node-fetch
Looks like
node-fetch
does not support proxies. This PR adds support for HTTP/HTTPS proxies configured through envar: https://github.com/promptfoo/promptfoo/pull/299
n
I will test it out and keep you posted @ian . Appreciate such quick response.
🙇‍♂️
i
no problem! Just published this change in 0.29.0
n
Ian, I believe it is now working like a charm. Thank you once again. One side question though. Is the separator
---
supposed to work with
txt
file and multiple json data requests (chat completion request role and content attributes)?
i
I think it should as long as everything besides the
---
is a json object. But not totally sure from memory
let me know if you are having problems there. the workaround would be to split them into separate files
n
Yes I was having some trouble with JSON Parsing. I individually copied them into separate files and that seems to work fine even when it is
txt
file with json input.
i
Got it. I'll see if I can repro and put in a fix. But glad you got it working
9 Views