Skip to content

Update translate #950

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update translate #950

wants to merge 2 commits into from

Conversation

Mokason
Copy link

@Mokason Mokason commented Jan 31, 2025

This pull request includes several changes to support the latest GPT version for multilingual content handling and to add a new environment variable for the Azure OpenAI API version. The most important changes are grouped into configuration updates and content handling improvements.

Configuration Updates:

  • Added a new environment variable AZURE_OPENAI_API_VERSION to app/enrichment/app.py and functions/TextEnrichment/__init__.py to handle different API versions. [1] [2]

Content Handling Improvements:

  • Modified poll_queue() in app/enrichment/app.py to skip translation fields if using the latest GPT version (2024-10-21 or newer) and use original content instead.
  • Updated main() in functions/TextEnrichment/__init__.py to use original content for entity recognition and key phrase extraction if using the latest GPT version, otherwise use translated content. [1] [2]
  • Adjusted translate_and_set() in functions/TextEnrichment/__init__.py to skip translation if using the latest GPT version.

These changes ensure compatibility with the latest GPT version and improve the handling of multilingual content with less tokens.

@Mokason Mokason requested review from dayland and wotey as code owners January 31, 2025 10:11
@Mokason
Copy link
Author

Mokason commented Feb 3, 2025

@microsoft-github-policy-service agree company="Microsoft"

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.

1 participant