https://promptfoo.dev/ logo
Error output is null
# ❓|questions
x
[FAIL] API call error: Error: Request failed after 4 retries: request to https://api.openai.com/v1/chat/completions failed, reason: After I set my OPENAI_API_KEY in my windows envriroment variables, and call the OpenAI API, the evaluation is complete and the output table reports the call is a failure and throw out the above message, the error reason is null.
i
Can you try running with --verbose and sharing the output here? That will give more detail on what's going on
x
This is the output message of --verbose mode: D:\github\promptfoo>promptfoo eval --verbose Reading prompts from ["Write a tweet about {{topic}}"] Reading prompts from ["Write a tweet about {{topic}}"] Calling OpenAI API: {"model":"gpt-4o-mini","messages":[{"role":"user","content":"Write a tweet about bananas"}],"seed":0,"max_tokens":1024,"temperature":0,"top_p":1,"presence_penalty":0,"frequency_penalty":0} Eval #1 complete (1 of 1) At least one evaluation failure occurred. This might be caused by the underlying call to the provider, or a test failure. Context: [{"provider":{"id":"openai:gpt-4o-mini"},"prompt":{"raw":"Write a tweet about bananas","label":"Write a tweet about {{topic}}"},"vars":{"topic":"bananas"},"response":{"error":"API call error: Error: Request failed after 4 retries: request to https://api.openai.com/v1/chat/completions failed, reason: "},"success":false,"score":0,"namedScores":{},"latencyMs":80225,"error":"API call error: Error: Request failed after 4 retries: request to https://api.openai.com/v1/chat/completions failed, reason: "}] Running db migrations... Running migrations from C:\Users\xutwe\AppData\Roaming\npm\node_modules\promptfoo\dist\drizzle... Inserting eval eval-2024-08-05T02:47:29 Inserting prompt add16627d8dbb348b8b3ac175c8b96107d26a4b08b5be0262962f8ec5b18ec9e Inserting dataset 8d4abf0457fef90f66c2b1b9b38079f83369b9dcc5710a3ac6e95fa8f27be1ab Awaiting 5 promises to database... =============================================================================================================================================== ✔ Evaluation complete.
i
hmm not too much info in there. can you hit the openai api directly via curl (e.g. the example [here](https://platform.openai.com/docs/guides/chat-completions/getting-started)) / do you have any proxy set up?
x
The problem is solved and is due to a proxy server related issue. Thanks for your help.
i
Ah glad you got it working