diff --git a/src/backend/core/services/ai_services/legacy.py b/src/backend/core/services/ai_services/legacy.py index 9855ee73a..c6c4dd912 100644 --- a/src/backend/core/services/ai_services/legacy.py +++ b/src/backend/core/services/ai_services/legacy.py @@ -61,7 +61,8 @@ AI_TRANSLATE = ( "Keep the same html structure and formatting. " "Translate the content in the html to the specified language {language:s}. " "Check the translation for accuracy and make any necessary corrections. " - "Do not provide any other information." + "Do not provide any other information. " + "Return the content directly without wrapping it in code blocks or markdown delimiters." ) diff --git a/src/backend/core/tests/documents/test_api_documents_ai_translate.py b/src/backend/core/tests/documents/test_api_documents_ai_translate.py index 1954cbc47..290f87825 100644 --- a/src/backend/core/tests/documents/test_api_documents_ai_translate.py +++ b/src/backend/core/tests/documents/test_api_documents_ai_translate.py @@ -117,7 +117,9 @@ def test_api_documents_ai_translate_anonymous_success(mock_create, settings): "Keep the same html structure and formatting. " "Translate the content in the html to the specified language Spanish. " "Check the translation for accuracy and make any necessary corrections. " - "Do not provide any other information." + "Do not provide any other information. " + "Return the content directly without wrapping it in code blocks or markdown " + "delimiters." ), }, {"role": "user", "content": "Hello"}, @@ -219,7 +221,9 @@ def test_api_documents_ai_translate_authenticated_success(mock_create, reach, ro "Translate the content in the html to the " "specified language Colombian Spanish. " "Check the translation for accuracy and make any necessary corrections. " - "Do not provide any other information." + "Do not provide any other information. " + "Return the content directly without wrapping it in code blocks or markdown " + "delimiters." ), }, {"role": "user", "content": "Hello"}, @@ -296,7 +300,9 @@ def test_api_documents_ai_translate_success(mock_create, via, role, mock_user_te "Translate the content in the html to the " "specified language Colombian Spanish. " "Check the translation for accuracy and make any necessary corrections. " - "Do not provide any other information." + "Do not provide any other information. " + "Return the content directly without wrapping it in code blocks or markdown " + "delimiters." ), }, {"role": "user", "content": "Hello"}, diff --git a/src/backend/core/tests/external_api/test_external_api_documents_ai.py b/src/backend/core/tests/external_api/test_external_api_documents_ai.py index ee695958b..e645c4007 100644 --- a/src/backend/core/tests/external_api/test_external_api_documents_ai.py +++ b/src/backend/core/tests/external_api/test_external_api_documents_ai.py @@ -226,7 +226,9 @@ def test_external_api_documents_ai_translate_can_be_allowed( "Translate the content in the html to the " "specified language Colombian Spanish. " "Check the translation for accuracy and make any necessary corrections. " - "Do not provide any other information." + "Do not provide any other information. " + "Return the content directly without wrapping it in code blocks or markdown " + "delimiters." ), }, {"role": "user", "content": "Hello"},