Open cyberflying opened 3 days ago
@cyberflying Can you please give the steps to reproduce this Issue or explain in detail what you were trying to do when you observed this Issue? Meanwhile we will try to analyze it more with the information that you have provided.
@Vinay-Microsoft , I just deployed this repo and tried to test it.
2024-11-27T03:00:23.668312676Z ERROR:create_app:Exception in /api/conversation | Error code: 400 - {'error': {'message': "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766", 'type': None, 'param': 'prompt', 'code': 'content_filter', 'status': 400, 'innererror': {'code': 'ResponsibleAIPolicyViolation', 'content_filter_result': {'hate': {'filtered': False, 'severity': 'safe'}, 'jailbreak': {'filtered': True, 'detected': True}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}}}
Hello @cyberflying,
first I encounter error at the admin config page , it seems cannot get ${ORCHESTRATION_STRATEGY} in line 143 in file default.json, I change to "langchain" --> Could you please provide a screenshot of the error? Also, I'd like to know if the error occurred after changing the Orchestrator strategy to Langchain, or if you were experiencing it before the change.
2024-11-27T03:00:23.668312676Z ERROR:create_app:Exception in /api/conversation | Error code: 400 - {'error': {'message': "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766", 'type': None, 'param': 'prompt', 'code': 'content_filter', 'status': 400, 'innererror': {'code': 'ResponsibleAIPolicyViolation', 'content_filter_result': {'hate': {'filtered': False, 'severity': 'safe'}, 'jailbreak': {'filtered': True, 'detected': True}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}}} --> This error occurs because your input triggered Azure OpenAI's responsible AI policy, which is in place to prevent harmful or inappropriate content. Specifically, the jailbreak filter detected and blocked content that tried to bypass the system's safety features.
Could you please share the exact prompt or request you made when you encountered this error? This will help us better understand what triggered the content filtering issue. Alternatively, please try rephrasing the question to ensure it does not involve any sensitive topics or attempt to bypass moderation?
Thank you.
@Prasanjeet-Microsoft , I just input "hi" on chat web page:
I have deleted all "Answering system prompt" on admin configuration page and just input "hi", also report same error. please check below chat web app logs:
2024-11-28T02:33:38.3311410Z INFO:httpx:HTTP Request: POST https://xxx.openai.azure.com//openai/deployments/text-embedding-ada-002/embeddings?api-version=2024-06-01 "HTTP/1.1 200 OK" 2024-11-28T02:33:38.7392617Z INFO:backend.batch.utilities.helpers.azure_search_helper:Adding image_vector field to index 2024-11-28T02:33:38.7473105Z ERROR:asyncio:Unclosed client session 2024-11-28T02:33:38.7473577Z client_session: <aiohttp.client.ClientSession object at 0x726f612004d0> 2024-11-28T02:33:38.7473949Z ERROR:asyncio:Unclosed connector 2024-11-28T02:33:38.7473996Z connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x726f61175f60>, 505121.032998746)]'] 2024-11-28T02:33:38.7474081Z connector: <aiohttp.connector.TCPConnector object at 0x726f61201050> 2024-11-28T02:33:38.7483094Z ERROR:asyncio:Unclosed client session 2024-11-28T02:33:38.7483384Z client_session: <aiohttp.client.ClientSession object at 0x726f61201650> 2024-11-28T02:33:38.7483425Z ERROR:asyncio:Unclosed connector 2024-11-28T02:33:38.7483461Z connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x726f61174360>, 505121.131676243)]'] 2024-11-28T02:33:38.7483496Z connector: <aiohttp.connector.TCPConnector object at 0x726f611d0990> 2024-11-28T02:33:39.4212867Z 2024-11-28T02:33:39.4213524Z 2024-11-28T02:33:39.4213585Z [1m> Entering new AgentExecutor chain...[0m 2024-11-28T02:33:40.1830831Z INFO:httpx:HTTP Request: POST https://xxx.openai.azure.com//openai/deployments/gpt-4o-mini/chat/completions?api-version=2024-06-01 "HTTP/1.1 200 OK" 2024-11-28T02:33:40.1853654Z [32;1m[1;3mThought: The user has greeted me, so I should respond in a friendly manner. 2024-11-28T02:33:40.1854140Z Action: Question Answering 2024-11-28T02:33:40.3314002Z Action Input: "How should I respond to a greeting?"[0mINFO:httpx:HTTP Request: POST https://xxxx.openai.azure.com//openai/deployments/text-embedding-ada-002/embeddings?api-version=2024-06-01 "HTTP/1.1 200 OK" 2024-11-28T02:33:41.9882768Z INFO:httpx:HTTP Request: POST https://xxx.openai.azure.com//openai/deployments/gpt-4o-mini/chat/completions?api-version=2024-06-01 "HTTP/1.1 200 OK" 2024-11-28T02:33:41.9900598Z 2024-11-28T02:33:41.9915351Z Observation: [36;1m[1;3m{"question": "How should I respond to a greeting?", "answer": "The retrieved documents do not contain information related to responding to greetings. However, a general guideline for responding to a greeting is to acknowledge the greeting with a friendly response. For example, if someone says \"Hello,\" you can respond with \"Hello! How are you?\" or simply \"Hi!\" It's important to match the tone of the greeting and engage in a polite manner. If you have a specific context in mind, please provide more details for a tailored response.", "source_documents": ["{\"id\": \"doc_6dfaa9b4a9b5d90bfc4514c28cfbfa07dff428b3\", \"content\": \"[ { \\"hotel name\\": \\"Oceanview Inn\\", \\"resort name\\": \\"Aruba Noord\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": false, \\"meeting rooms\\": 2, \\"ballrooms for receptions\\": 1, \\"number of rooms\\": 85, \\"EV charging available\\": true, \\"covered parking\\": true, \\"self-parking\\": true }, { \\"hotel name\\": \\"Metro Business Hotel\\", \\"resort name\\": \\"Puerto Rico Ponce\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 5, \\"ballrooms for receptions\\": 0, \\"number of rooms\\": 150, \\"EV charging available\\": false, \\"covered parking\\": true, \\"self-parking\\": false }, { \\"hotel name\\": \\"Grand Regency\\", \\"resort name\\": \\"Puerto Rico San Juan\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": true, \\"meeting rooms\\": 8, \\"ballrooms for receptions\\": 2, \\"number of rooms\\": 200, \\"EV charging available\\": true, \\"covered parking\\": false, \\"self-parking\\": true }, { \\"hotel name\\": \\"Beautiful Inn\\", \\"resort name\\": \\"Virgin Islands Virgin Gorda\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": false, \\"meeting rooms\\": 1, \\"ballrooms for receptions\\": 0, \\"number of rooms\\": 50, \\"EV charging available\\":\", \"source\": \"https://st.blob.core.windows.net/documents/Hotels.txt_SAS_TOKEN_PLACEHOLDER_\", \"title\": \"/documents/Hotels.txt\", \"chunk\": 0, \"offset\": 0, \"page_number\": null, \"chunk_id\": null}", "{\"id\": \"doc_70cf9a34e26e0df3f462e055f67ad3fdf20adf8f\", \"content\": \"name\\": \\"Beautiful Inn\\", \\"resort name\\": \\"Virgin Islands Virgin Gorda\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": false, \\"meeting rooms\\": 1, \\"ballrooms for receptions\\": 0, \\"number of rooms\\": 50, \\"EV charging available\\": false, \\"covered parking\\": false, \\"self-parking\\": true }, { \\"hotel name\\": \\"Airport Gateway Hotel\\", \\"resort name\\": \\"Bahamas Nassau\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 4, \\"ballrooms for receptions\\": 1, \\"number of rooms\\": 120, \\"EV charging available\\": false, \\"covered parking\\": true, \\"self-parking\\": false }, { \\"hotel name\\": \\"City Center Boutique Hotel\\", \\"resort name\\": \\"Bonaire Kralendijk\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": false, \\"meeting rooms\\": 2, \\"ballrooms for receptions\\": 0, \\"number of rooms\\": 45, \\"EV charging available\\": false, \\"covered parking\\": false, \\"self-parking\\": true }, { \\"hotel name\\": \\"The Palms Resort & Spa\\", \\"resort name\\": \\"Aruba Oranjestad\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 6, \\"ballrooms for receptions\\": 3, \\"number of rooms\\": 172, \\"EV charging available\\": true,\", \"source\": \"https://st.blob.core.windows.net/documents/Hotels.txt_SAS_TOKEN_PLACEHOLDER_\", \"title\": \"/documents/Hotels.txt\", \"chunk\": 1, \"offset\": 1395, \"page_number\": null, \"chunk_id\": null}", "{\"id\": \"doc_10a63453cca5c8473049b1d59025c45bb378ba75\", \"content\": \"name\\": \\"Curacao Willemstad\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 7, \\"ballrooms for receptions\\": 3, \\"number of rooms\\": 210, \\"EV charging available\\": true, \\"covered parking\\": true, \\"self-parking\\": true }, { \\"hotel name\\": \\"Mountain View Inn\\", \\"resort name\\": \\"Puerto Rico Ponce\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": false, \\"meeting rooms\\": 2, \\"ballrooms for receptions\\": 0, \\"number of rooms\\": 75, \\"EV charging available\\": false, \\"covered parking\\": true, \\"self-parking\\": true }, { \\"hotel name\\": \\"The Urban Hotel\\", \\"resort name\\": \\"Curacao Willemstad\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 4, \\"ballrooms for receptions\\": 1, \\"number of rooms\\": 130, \\"EV charging available\\": false, \\"covered parking\\": false, \\"self-parking\\": true }]\", \"source\": \"https://st.blob.core.windows.net/documents/Hotels.txt_SAS_TOKEN_PLACEHOLDER_\", \"title\": \"/documents/Hotels.txt\", \"chunk\": 4, \"offset\": 5610, \"page_number\": null, \"chunk_id\": null}", "{\"id\": \"doc_204387224d43fa063d3b35b09ca600338ac83eb9\", \"content\": \"Resort & Spa\\", \\"resort name\\": \\"Aruba Oranjestad\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 6, \\"ballrooms for receptions\\": 3, \\"number of rooms\\": 172, \\"EV charging available\\": true, \\"covered parking\\": true, \\"self-parking\\": false }, { \\"hotel name\\": \\"Heritage Grand Hotel\\", \\"resort name\\": \\"Bonaire Santa Barbara\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": true, \\"meeting rooms\\": 10, \\"ballrooms for receptions\\": 2, \\"number of rooms\\": 225, \\"EV charging available\\": false, \\"covered parking\\": false, \\"self-parking\\": true }, { \\"hotel name\\": \\"The Traveler's Rest\\", \\"resort name\\": \\"Bahamas Freeport\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": false, \\"meeting rooms\\": 1, \\"ballrooms for receptions\\": 0, \\"number of rooms\\": 60, \\"EV charging available\\": false, \\"covered parking\\": true, \\"self-parking\\": true }, { \\"hotel name\\": \\"The Executive Suites\\", \\"resort name\\": \\"Curacao Westpunt\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 5, \\"ballrooms for receptions\\": 1, \\"number of rooms\\": 100, \\"EV charging available\\": true, \\"covered\", \"source\": \"https://st.blob.core.windows.net/documents/Hotels.txt_SAS_TOKEN_PLACEHOLDER_\", \"title\": \"/documents/Hotels.txt\", \"chunk\": 2, \"offset\": 2807, \"page_number\": null, \"chunk_id\": null}", "{\"id\": \"doc_9db5ecd133ac39409ebdf2beb7221dba171d5948\", \"content\": \"\\"resort name\\": \\"Curacao Westpunt\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 5, \\"ballrooms for receptions\\": 1, \\"number of rooms\\": 100, \\"EV charging available\\": true, \\"covered parking\\": true, \\"self-parking\\": false }, { \\"hotel name\\": \\"The Sunrise Retreat\\", \\"resort name\\": \\"Virgin Islands Road Town\\", \\"free breakfast\\": true, \\"non-smoking rooms\\": true, \\"digital key\\": false, \\"business center\\": false, \\"meeting rooms\\": 0, \\"ballrooms for receptions\\": 1, \\"number of rooms\\": 30, \\"EV charging available\\": true, \\"covered parking\\": false, \\"self-parking\\": true }, { \\"hotel name\\": \\"The Downtown Plaza Hotel\\", \\"resort name\\": \\"Bahamas Nassau\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 3, \\"ballrooms for receptions\\": 2, \\"number of rooms\\": 180, \\"EV charging available\\": false, \\"covered parking\\": true, \\"self-parking\\": false }, { \\"hotel name\\": \\"Seaside Luxury Resort\\", \\"resort name\\": \\"Curacao Willemstad\\", \\"free breakfast\\": false, \\"non-smoking rooms\\": true, \\"digital key\\": true, \\"business center\\": true, \\"meeting rooms\\": 7, \\"ballrooms for receptions\\": 3, \\"number of rooms\\": 210, \\"EV charging available\\": true, \\"covered parking\\": true,\", \"source\": \"https://st.blob.core.windows.net/documents/Hotels.txt_SAS_TOKEN_PLACEHOLDER_\", \"title\": \"/documents/Hotels.txt\", \"chunk\": 3, \"offset\": 4206, \"page_number\": null, \"chunk_id\": null}"], "prompt_tokens": 2836, "completion_tokens": 92}[0m 2024-11-28T02:33:41.9915924Z [32;1m[1;3m[0m 2024-11-28T02:33:41.9915971Z 2024-11-28T02:33:41.9916005Z [1m> Finished chain.[0m 2024-11-28T02:33:42.3130918Z INFO:httpx:HTTP Request: POST https://xxx.openai.azure.com//openai/deployments/gpt-4o-mini/chat/completions?api-version=2024-06-01 "HTTP/1.1 400 model_error" 2024-11-28T02:33:42.3150935Z ERROR:create_app:Exception in /api/conversation | Error code: 400 - {'error': {'message': "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766", 'type': None, 'param': 'prompt', 'code': 'content_filter', 'status': 400, 'innererror': {'code': 'ResponsibleAIPolicyViolation', 'content_filter_result': {'hate': {'filtered': False, 'severity': 'safe'}, 'jailbreak': {'filtered': True, 'detected': True}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}}} 2024-11-28T02:33:42.3151356Z Traceback (most recent call last): 2024-11-28T02:33:42.3151402Z File "/usr/src/app/create_app.py", line 444, in conversation_custom 2024-11-28T02:33:42.3151442Z messages = await message_orchestrator.handle_message( 2024-11-28T02:33:42.3151478Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3151586Z File "/usr/src/app/backend/batch/utilities/helpers/orchestrator_helper.py", line 27, in handle_message 2024-11-28T02:33:42.3151627Z return await orchestrator.handle_message( 2024-11-28T02:33:42.3151664Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3151703Z File "/usr/src/app/backend/batch/utilities/orchestrator/orchestrator_base.py", line 72, in handle_message 2024-11-28T02:33:42.3151741Z result = await self.orchestrate(user_message, chat_history, *kwargs) 2024-11-28T02:33:42.3151779Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3151819Z File "/usr/src/app/backend/batch/utilities/orchestrator/lang_chain_agent.py", line 108, in orchestrate 2024-11-28T02:33:42.3151855Z answer = post_prompt_tool.validate_answer(answer) 2024-11-28T02:33:42.3151909Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3151950Z File "/usr/src/app/backend/batch/utilities/tools/post_prompt_tool.py", line 27, in validate_answer 2024-11-28T02:33:42.3151989Z response = llm_helper.get_chat_completion( 2024-11-28T02:33:42.3152026Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3152065Z File "/usr/src/app/backend/batch/utilities/helpers/llm_helper.py", line 125, in get_chat_completion 2024-11-28T02:33:42.3152101Z return self.openai_client.chat.completions.create( 2024-11-28T02:33:42.3152137Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3152177Z File "/usr/local/lib/python3.11/site-packages/openai/_utils/_utils.py", line 274, in wrapper 2024-11-28T02:33:42.3152217Z return func(args, **kwargs) 2024-11-28T02:33:42.3152267Z ^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3152309Z File "/usr/local/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 704, in create 2024-11-28T02:33:42.3152342Z return self._post( 2024-11-28T02:33:42.3152376Z ^^^^^^^^^^^ 2024-11-28T02:33:42.3152413Z File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1270, in post 2024-11-28T02:33:42.3152451Z return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) 2024-11-28T02:33:42.3152492Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3152529Z File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 947, in request 2024-11-28T02:33:42.3152562Z return self._request( 2024-11-28T02:33:42.3152613Z ^^^^^^^^^^^^^^ 2024-11-28T02:33:42.3152653Z File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1051, in _request 2024-11-28T02:33:42.3152691Z raise self._make_status_error_from_response(err.response) from None 2024-11-28T02:33:42.3152777Z openai.BadRequestError: Error code: 400 - {'error': {'message': "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766", 'type': None, 'param': 'prompt', 'code': 'content_filter', 'status': 400, 'innererror': {'code': 'ResponsibleAIPolicyViolation', 'content_filter_result': {'hate': {'filtered': False, 'severity': 'safe'}, 'jailbreak': {'filtered': True, 'detected': True}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}}} 2024-11-28T02:33:42.3192028Z [pid: 1|app: 0|req: 136/136] 169.254.136.3 () {102 vars in 10016 bytes} [Thu Nov 28 02:33:37 2024] POST /api/conversation => generated 113 bytes in 4470 msecs (HTTP/1.1 500) 2 headers in 91 bytes (1 switches on core 0) 2024-11-28T02:33:42.4339970Z [pid: 1|app: 0|req: 137/137] 169.254.136.3 () {100 vars in 9950 bytes} [Thu Nov 28 02:33:42 2024] GET /api/assistanttype => generated 32 bytes in 115 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0) 2024-11-28T02:33:42.7959523Z [pid: 1|app: 0|req: 138/138] 169.254.136.3 () {100 vars in 9949 bytes} [Thu Nov 28 02:33:42 2024] GET /api/assistanttype => generated 32 bytes in 190 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)
Hello @cyberflying, Could you please let us know what other parameters were modified during the deployment, apart from the Azure OpenAI model?
I would also like to request that you delete the existing document (Hotels.txt) and try uploading a different document and then interact with the chat on the web page to see if the same error persists.
Describe the bug
frontend web app log: 2024-11-26T15:08:54.704231547Z ERROR:create_app:Exception in /api/conversation | Error code: 400 - {'error': {'message': "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766", 'type': None, 'param': 'prompt', 'code': 'content_filter', 'status': 400, 'innererror': {'code': 'ResponsibleAIPolicyViolation', 'content_filter_result': {'hate': {'filtered': False, 'severity': 'safe'}, 'jailbreak': {'filtered': True, 'detected': True}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}}}
Expected behavior
A clear and concise description of what you expected to happen.
How does this bug make you feel?
Share a gif from giphy to tells us how you'd feel
Debugging information
delete the system prompt, it does work.