You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Content Safety (Text Analyze) Tool isn't compatible with new content safety API versions
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
1.Add a new Azure Content Safety connection with the api version "2024-09-01" which is the default in the implementation example codes of text moderation in Azure AI Foundry.
2. Create a Content Safety node with the created connection.
3. It return the following error:
File "project_directory\.venv\Lib\site-packages\promptflow\tools\azure_content_safety.py", line 255, in make_decision
raise AzureContentSafetySystemError(message=error_message)
Can not find detection result for Category.Hate
pf.flow.node_test failed with UserErrorException: Exception: Can not find detection result for Category.Hate
The thing is, there is a condition on that file azure_content_safety.py which depending on the api_version parameter of the connection it uses a specific make_decision() method.
Expected behavior
I should use the make_decision_1001() method but as the api version does not match it uses the older version which work for a different json structure.
I changed the date value of the condition in the azure_content_safety.py file to the one I set on the api '2024-09-01' and it worked perfectly
Screenshots
Running Information(please complete the following information):
Promptflow Package Version using pf -v: [1.17.2]
promptflow-tools version using [1.6.0]
Operating System: [Windows 11]
Python Version using python --version: [python==3.12.9]
The text was updated successfully, but these errors were encountered:
The Content Safety (Text Analyze) Tool isn't compatible with new content safety API versions
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
1.Add a new Azure Content Safety connection with the api version "2024-09-01" which is the default in the implementation example codes of text moderation in Azure AI Foundry.
2. Create a Content Safety node with the created connection.
3. It return the following error:
The thing is, there is a condition on that file azure_content_safety.py which depending on the api_version parameter of the connection it uses a specific make_decision() method.
Expected behavior
I should use the make_decision_1001() method but as the api version does not match it uses the older version which work for a different json structure.
I changed the date value of the condition in the azure_content_safety.py file to the one I set on the api '2024-09-01' and it worked perfectly
Screenshots

Running Information(please complete the following information):
pf -v
: [1.17.2]python --version
: [python==3.12.9]The text was updated successfully, but these errors were encountered: