Azure-Samples / ai-rag-chat-evaluator

Tools for evaluation of RAG Chat Apps using Azure AI Evaluate SDK and OpenAI
MIT License
209 stars 75 forks source link

script: module 'openai' has no attribute 'error' #4

Closed dfberry closed 8 months ago

dfberry commented 8 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

1) azd up 2) run script python3 -m scripts generate --output=example_input/qa.jsonl --numquestions=200 --persource=5 to generate ground truth data

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) Mac os m1 Sonoma 14.1.2 running dev container

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon. image

I assume this is something about env vars so here they are (truncated):

AZURE_ENV_NAME="dfberry-swedencentral-evaluator" AZURE_LOCATION="swedencentral" AZURE_OPENAI_EVAL_DEPLOYMENT="eval" AZURE_OPENAI_RESOURCE_GROUP="dfberry-swedencentral-evaluatorlsadmiogsgtqg-rg" AZURE_OPENAI_SERVICE="dfberry-swedencentral-evaluatorlsadmiogsgtqg-openai" AZURE_RESOURCE_GROUP="dfberry-swedencentral-evaluatorlsadmiogsgtqg-rg" AZURE_SUBSCRIPTION_ID="b57b253a-e19e-4a9c-..." AZURE_TENANT_ID="51397421-..." OPENAI_API_KEY="" OPENAI_GPT_MODEL="gpt-4" OPENAI_HOST="azure" OPENAI_ORGANIZATION=""

I assume I don't have a key is why it doesn't work....reading README again. I must have missed something.

pamelafox commented 8 months ago

Interesting, I'll try to replicate. Looks like an OpenAI SDK version issue.

pamelafox commented 8 months ago

Yes, I had to explicitly pin openai to their older version, please pull main and try again. I'll file an issue for sdk team.

pamelafox commented 8 months ago

Filed: https://github.com/Azure/azure-sdk-for-python/issues/33827