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

Adding subscription region in Microsoft text translator api #4002

Open
Sumit-nainani opened this issue Jul 9, 2024 · 1 comment
Open

Adding subscription region in Microsoft text translator api #4002

Sumit-nainani opened this issue Jul 9, 2024 · 1 comment
Labels
feature-request A request for new functionality or an enhancement to an existing one. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@Sumit-nainani
Copy link

Use this query to search for the most popular feature requests.

Is your feature request related to a problem? Please describe.
I'm always frustrated when I use the Text Translator API sample code provided in the bot-builder-samples repository because the subscriptionRegion is not included in the header section. This omission leads to authentication errors when using a regional translator resource.

Description of the solution
I would like the sample code to be updated to include the subscriptionRegion in the headers. The updated code should look like this:
path of file is :
microsoft/BotBuilder-Samples/samples/python/17.multilingual-bot/translation/microsoft_translator.py
headers = {
"Ocp-Apim-Subscription-Key": self.subscription_key,
"Ocp-Apim-Subscription-Region": self.subscription_region, # Necessary if using a regional translator resource and If you are using a global translator resource, you can omit the 'Ocp-Apim-Subscription-Region' header.
"Content-type": "application/json",
"X-ClientTraceId": str(uuid.uuid4()),

}

Additionally, comments should be added to explain that this header is necessary when using a regional translator resource and can be omitted if using a global translator resource. For example:

alternatives I've considered
As an alternative, I considered manually adding the subscriptionRegion every time I use the sample code. However, this is not an ideal solution as it requires extra effort and increases the likelihood of errors.

Additional context
if not using region.
Screenshot 2024-07-09 at 10 47 02 PM

if using region.
Screenshot 2024-07-09 at 10 48 19 PM

@Sumit-nainani Sumit-nainani added feature-request A request for new functionality or an enhancement to an existing one. needs-triage The issue has just been created and it has not been reviewed by the team. labels Jul 9, 2024
@derhallim
Copy link

@Sumit-nainani .. any updates on this? We're having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A request for new functionality or an enhancement to an existing one. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants