Closed echen101 closed 3 months ago
Having the same issue here. Which python version are you using? Downgraded my python venv from 3.12 to 3.10. Thought that this might be an issue with promptflow.
But now I don't get any useful error details anymore:
...\ai-rag-chat-evaluator> python -m scripts evaluate --config=example_config.json --numquestions=2 12:53:16 (INFO) scripts: Running evaluation from config ...\ai-rag-chat-evaluator\example_config.json 12:53:16 (INFO) scripts: Replaced results_dir in config with timestamp 12:53:16 (INFO) scripts: Replaced prompt_template in config with contents of example_input/prompt_feri.txt 12:53:16 (INFO) scripts: Using Azure OpenAI Service with API Key from AZURE_OPENAI_KEY 12:53:16 (INFO) scripts: {'api_type': 'azure', 'api_base': 'https://xxx.openai.azure.com', 'api_key': 'xxx', 'api_version': '2023-07-01-preview', 'deployment_id': 'chat', 'model': 'gpt-35-turbo'} 12:53:16 (INFO) scripts: Running evaluation using data from ...\ai-rag-chat-evaluator\example_input\feri_qa.jsonl 12:53:16 (INFO) scripts: Limiting evaluation to 2 questions 12:53:16 (INFO) scripts: Sending a test question to the target to ensure it is running... 12:53:16 (ERROR) scripts: Failed to send a test question to the target due to error: Expecting value: line 1 column 1 (char 0) 12:53:16 (ERROR) scripts: Evaluation was terminated early due to an error ⬆
@mhauschild That looks like a different issue, as its failing to get a JSON response from your chat endpoint. The target URL in example_config.json must correspond to the endpoint that receives POST requests from the chat app, like https://app-backend-j25rgqsibtmlo.azurewebsites.net/chat or https://localhost:50505/chat The endpoint must respond with JSON.
I was using python 3.12, I tried 3.10 but there is the same error. I also noticed that promptflow was asking for keychain password during evaluate. I used the login password. After then the error occurred.
Ah! PromptFlow uses a keyring library that doesn't work as easily on a Mac. If you're working in the Dev Container, I added code to the Dockerfile to make the keyring work: https://github.com/Azure-Samples/ai-rag-chat-evaluator/blob/main/.devcontainer/Dockerfile
Here's the Promptflow FAQ about it: https://microsoft.github.io/promptflow/how-to-guides/faq.html#troubleshooting
I find that frustrating as well. Let me know if the tips in the FAQ work for you.
I am also getting this issue when running on the devcontainer with the new keyring changes.
I'm trying to use the Azure OpenAI with key and not with user identity. They key is loaded into the .env var file as AZURE_OPENAI_KEY
Also tried on Ubuntu with the packages installed and same error
sudo apt-get install -y gcc cmake pkg-config libdbus-1-dev libglib2.0-dev
pip install keyrings.alt dbus-python
Error:
File "/home/vscode/.local/lib/python3.11/site-packages/promptflow/_sdk/_orm/connection.py", line 52, in get
raise ConnectionNotFoundError(f"Connection {name!r} is not found.")
promptflow._sdk._errors.ConnectionNotFoundError: Connection 'Default_AzureOpenAI' is not found.
I haven't replicated this issue yet, but I am in discussion with the evaluate SDK team and PromptFlow team about the keyring related difficulties.
@jakebowles99 You said the "new keyring changes", was this working for you before a particular change?
Are both of you using keys or using default azure credential?
[update] I tested using api key as well, same issue. I am using default azure credential, not api keys.
@jakebowles99 You said the "new keyring changes", was this working for you before a particular change?
@pamelafox Sorry I was referring to this, I had assumed it was a new change:
Ah! PromptFlow uses a keyring library that doesn't work as easily on a Mac. If you're working in the Dev Container, I added code to the Dockerfile to make the keyring work: https://github.com/Azure-Samples/ai-rag-chat-evaluator/blob/main/.devcontainer/Dockerfile
I have not yet had this working. I can generate the test prompts etc from the script, so it can access the OpenAI service and eval model, but the issue appears to lie in the promptflow side of things
@mhauschild That looks like a different issue, as its failing to get a JSON response from your chat endpoint. The target URL in example_config.json must correspond to the endpoint that receives POST requests from the chat app, like https://app-backend-j25rgqsibtmlo.azurewebsites.net/chat or https://localhost:50505/chat The endpoint must respond with JSON.
changed config to "target_url": "http://127.0.0.1:50505/chat", and getting now the same error as @jakebowles99 stated yesterday.
File "/home/vscode/.local/lib/python3.11/site-packages/promptflow/_sdk/_orm/connection.py", line 52, in get raise ConnectionNotFoundError(f"Connection {name!r} is not found.") promptflow._sdk._errors.ConnectionNotFoundError: Connection 'Default_AzureOpenAI' is not found.
using api key.
my output:
File "C:\...\ai-rag-chat-evaluator\.venv\lib\site-packages\promptflow\_sdk\_orm\connection.py", line 52, in get raise ConnectionNotFoundError(f"Connection {name!r} is not found.") promptflow._sdk._errors.ConnectionNotFoundError: Connection 'Default_AzureOpenAI' is not found.
I'm on windows and python 3.10
Update: The issue is with the promptflow dependency, its latest release is incompatible. Please run:
pip install promptflow==1.6.0
Thanks @pamelafox, works now.
Filed issue https://github.com/Azure/azure-sdk-for-python/issues/35060 for the azure-ai-generative team to investigate the incompatibility. Closing since it's working for us with the pinned version.
Using promptflow 1.6.0 fixes the issue. Thanks @pamelafox
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
Versions
Mention any other details that might be useful
I've tried evaluating all questions (200) and a subset (2), both failed with the same connection error. The test question went fine as I saw the log before the error