Skip to content

Use additional context in LLM prompt, update OpenAI dep#4040

Open
flodolo wants to merge 1 commit intomozilla:mainfrom
flodolo:improve_llm_prompt
Open

Use additional context in LLM prompt, update OpenAI dep#4040
flodolo wants to merge 1 commit intomozilla:mainfrom
flodolo:improve_llm_prompt

Conversation

@flodolo
Copy link
Copy Markdown
Collaborator

@flodolo flodolo commented Mar 26, 2026

Fixes #4030

  • Update OpenAI package to latest version (2.29.0)
  • Improve prompt formulation
  • Pass string ID, comment, terminology matches when available
  • Move OpenAI GPT version to settings

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There might be a better way to do this?

f"ENGLISH SOURCE:\n{english_text}\n\n"
f"MACHINE TRANSLATION TO REFINE:\n{translated_text}"
)
# TODO: remove before merge.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is here to help with testing, needs to be removed before merge.


class Command(BaseCommand):
help = "Refines machine translations using OpenAI's GPT-4 API with specified characteristics"
help = "Refines machine translations using OpenAI's GPT API with specified characteristics"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

At some point we're going to move away from GPT-4, not sure there is a benefit in having references to GTP-4 in the code.

@flodolo flodolo force-pushed the improve_llm_prompt branch 2 times, most recently from 5a56d9c to ada5db9 Compare March 26, 2026 13:07
- Update OpenAI package to latest version (2.29.0)
- Improve prompt formulation
- Pass string ID, comment, terminology matches when available
- Move OpenAI GPT version to settings
@flodolo flodolo force-pushed the improve_llm_prompt branch from ada5db9 to aa2327a Compare March 26, 2026 13:14
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.

Improve LLM prompt by providing clearer instructions and additional context

1 participant