https://promptfoo.dev/ logo
Assert.py failing in latest 0.54.1 version.
# ❓|questions
p
Hi @ian with recent changes. . https://github.com/promptfoo/promptfoo/pull/691/files. Assert.py failing in latest 0.54.1 versionGetting below error Error: Python script execution failed: Error: langdetect.lang_detect_exception.LangDetectException: No features in text. Error: Python script execution failed: Error: langdetect.lang_detect_exception.LangDetectException: No features in text. at runAssertion (/Users/i536526/.npm/_npx/85804/lib/node_modules/promptfoo/dist/src/assertions.js:184:27) at async /Users/i536526/.npm/_npx/85804/lib/node_modules/promptfoo/dist/src/assertions.js:83:24 I am asserting Input and Output in my assert.py file where if Input language is equal to output language. It is working fine till 0.54.0. Attaching the script as well. https://cdn.discordapp.com/attachments/1231927335394213981/1231927335758991472/Screenshot_2024-04-22_at_13.18.21.png?ex=6638bcbc&is=662647bc&hm=d576958590eaed477a8cb51e5414e135bd12627803f0f41828da4533f36a67e0&
i
It looks like you might have to rewrite your python file to export a
get_assert
function: - Change: https://github.com/promptfoo/promptfoo/releases/tag/0.51.0 - Docs: Unfortunately it was a breaking change, but should be a small fix. This will make it easier to use python asserts in the future (not dependent on stdout)