Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openai_translator): Enforce JSON Response format #611

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

ehimen-io
Copy link
Contributor

@ehimen-io ehimen-io commented Jan 15, 2025

Hello! Really appreciate this gem for translation tasks!

I get an issue where the GPT models sometimes responds with improperly formatted JSON (as seen in #590), so this PR contains an additional system prompt to prevent this. I also turned on JSON mode to properly structure the output.

Let me know if there are any changes needed to be made. If not, it would be great if we could create a new release of this gem :)

PS: Ignore the branch name, this fix was originally for Watsonx but I changed gears.

@glebm
Copy link
Owner

glebm commented Jan 15, 2025

Thanks!

@glebm glebm merged commit a0e2fef into glebm:main Jan 15, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants