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

Add a script to translate commcare with openai #35754

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

AmitPhulera
Copy link
Contributor

Product Description

A prototype of using LLMs to make translations in HQ

Technical Summary

Feature Flag

Safety Assurance

Safety story

Automated test coverage

QA Plan

Migrations

  • The migrations in this code can be safely applied first independently of the code

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@AmitPhulera AmitPhulera requested a review from snopoke February 11, 2025 08:05
],
temperature=0.2,
)
return json.loads(completion.choices[0].message.content)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be useful to structured outputs to get a better chance of it producing the right result: https://platform.openai.com/docs/guides/structured-outputs

Either using response_format or using function calling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @snopoke! That is helpful. I was not aware of that. I have definitely seen it producing wrong formats in one or two runs.

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