Skip to content

Conversation

@nattsw
Copy link
Contributor

@nattsw nattsw commented Feb 24, 2025

There is a bug now where if the new DiscourseAi translator does not return values back in <translator> tags, we return the full response.

This PR scopes both the input and output in its respective tags, and returns an empty string if there is no output tag.

The problem only exists on topic translations, not post translations, as posts contain html and the prompt for translating indicates there will be html (topics do not have them). So an accompanying migration has been added

example incorrect result:

"To provide a translation, I first need the original text in a specific language to translate it into \"pt\". Could you please provide the text you wish to translate, including any HTML tags?"

Copy link

@dbattersby dbattersby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@nattsw nattsw merged commit 5f24835 into main Feb 25, 2025
5 checks passed
@nattsw nattsw deleted the better-scopes branch February 25, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants