roneyal
09/28/2023, 8:47 PMian
09/28/2023, 9:10 PMAZURE_OPENAI_API_HOST environment variable or under the env key in your config:
yaml
env:
AZURE_OPENAI_API_HOST: "https://xxxxx.openai.azure.com"
Let me know if you still run into issues! The apiHost key is currently not supported by the Azure provider (though I've just committed a [fix](https://github.com/promptfoo/promptfoo/commit/c7c0949f1a6237200834236247cef586f510de21) that enables this)roneyal
09/28/2023, 10:31 PMenv:
AZURE_OPENAI_API_HOST: "https://xxxxxxxx.openai.azure.com"
But I still got the same error (Error: Azure OpenAI API host must be set)
When I try this:
providers:
- id: azureopenai:chat:gpt-4-32k
config:
apiHost: "xxxxxxxx.openai.azure.com"
I get a different error:
[FAIL] (0.00) API response error: TypeError: Cannot read properties of undefined (reading '0'): {""error"":{""code"":""DeploymentNotFound"",""message"":""The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.""}}
---
Do you happen to know how to resolve that?
--
Update - I resolved this error. I figured out that my custom Azure deployment, which I believe is also called the engine, should be used like this:
providers:
- id: azureopenai:chat:engineNameGoesHere
config:
apiHost: "xxxxxxxx.openai.azure.com"roneyal
09/28/2023, 11:29 PMnpx promptfoo view
it says:
Server listening at http://localhost:15500
Do you want to open the browser to the URL? (y/N):
When I open it in a browser it just says:
Cannot GET /
Any idea why that might be?
Thanks!jamesbraza
09/29/2023, 12:17 AMnpm install ../promptfooian
09/29/2023, 5:57 PMnpx promptfoo@latest viewroneyal
10/02/2023, 9:43 PMnpm install promptfoo
Is that recommended? I think I did that because the npx commands weren't working for me until I did that.
@ian
Yes even http://localhost:15500/eval doesn't work.
However, when I try npx promptfoo@latest view, that does work, so that's good! Thanks for that suggestion.
I assume that means when I'm running npx promptfoo view, I'm not using the latest version, though I'm not sure why that is happening because I've pulled the latest version.roneyal
10/02/2023, 10:24 PMassert:
- type: python
value: len(output.split())
And I'm getting this error:
Python code execution failed: spawnSync /bin/sh EPIPE
Any idea of how to resolve that?
Thanks!ian
10/02/2023, 11:16 PMyaml
assert:
- type: python
value: len(output.split())
If not that, then it looks like it's trying to run a python executable that doesn't exist (or it doesn't have permissions to execute it). Do you have a python executable in the context that you're running promptfoo?
As a workaround, you can try the equivalent Javascript:
yaml
assert:
- type: javascript
value: output.split(" ").length;ian
10/02/2023, 11:18 PMnpx promptfoo@latest
I'm curious what your installed version of promptfoo is globally. Can you run npm list -g promptfoo?roneyal
10/09/2023, 4:55 PMroneyal
10/09/2023, 4:58 PMnpm list -g promptfoo I get:
% npm list -g promptfoo
/opt/homebrew/lib
└── (empty)
Does that mean I haven't installed it properly, or at all?
I've been running promptfoo with npx promptfoo eval -o output.csvian
10/14/2023, 1:43 AMnpm list promptfoo
You can also try reinstalling with npm install promptfoo@latest and see if the problem is fixed.
If you're happy with using npx, feel free to ignore 🙂roneyal
10/18/2023, 8:13 PMnpm list promptfoo
gives:
% npm list promptfoo
promptfoo@0.24.4 /Volumes/Drive/promptfoo/promptfoo
└── (empty)
After reinstalling with npm install promptfoo@latest
I get:
% npm list promptfoo
promptfoo@0.24.4 /Volumes/Drive/promptfoo/promptfoo
└── promptfoo@0.25.0
After doing that, I still get the same error as above when I try to run npx promptfoo view
npx promptfoo@latest view still works though!
Is there a way to run promptfoo view with npm, now that I've installed it?