-
Notifications
You must be signed in to change notification settings - Fork 269
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
Append JSON instructions to OpenAI system prompt #615
Append JSON instructions to OpenAI system prompt #615
Conversation
…sponse_format json_object
@navidemad can you fix the linting error? (Add an ignore for the too long line). @glebm do you have any input on how we should handle these instructions? I have not used OpenAI for any translation. |
@davidwessman I fixed the linting error as requested |
I don't do ruby at all anymore but this PR makes sense to me in principle. |
@jaredmoody @dankimio @yshmarov you have recently done Open AI-issues on the repo, does this change look good to you as well? 🙂 |
@jaredmoody yes, this looks good. not sure if there's a need for a separate |
@dankimio I made it that way because if someone sets the :openai_system_prompt option—for example, to create a custom prompt—but forgets to include this JSON part, it will also fail. This way, it will be appended automatically, preventing this issue. |
We do something very similar to this in our prompt, so LGTM. As a future enhancement though, it would be nice to request JSON from the API by passing https://github.com/alexrudall/ruby-openai?tab=readme-ov-file#json-mode |
https://github.com/glebm/i18n-tasks/blob/main/lib/i18n/tasks/translators/openai_translator.rb#L101 |
Ah, great, I missed when that was added last month. |
In order to fix response_format json_object introduced in the following commit: a0e2fef