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

Might Be a Bug, Might Just Need to Clarify the Setup For Bing #39005

Closed
theloglizard opened this issue Dec 31, 2024 · 6 comments
Closed

Might Be a Bug, Might Just Need to Clarify the Setup For Bing #39005

theloglizard opened this issue Dec 31, 2024 · 6 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@theloglizard
Copy link

theloglizard commented Dec 31, 2024

  • sample_agents_bing_grounding.py:
  • **Azure SDK **:
  • Linux Ubuntu:
  • 3.8.10:

Describe the bug
When I run the example code it gripes about not having a Bing Search API key.

python3 raw_python.py 
/subscriptions/16f866b6-7cb3-494f-b738-7ad0d449b655/resourceGroups/DefaultResourceGroup-EUS/providers/Microsoft.MachineLearningServices/workspaces/username-test1/connections/hubforbinggrou7517785039
Created agent, ID: asst_xxxxxxxxxxxxxxxx
Created thread, ID: thread_yyyyyyyyyyyyyyyyy
Created message, ID: msg_zzzzzzzzzzzzzzzzz
Run finished with status: failed
Run failed: {'code': 'missing_required_parameter', 'message': 'Bing Search API key is missing for Bing Grounding tool.'}
Deleted agent
Messages: {'object': 'list', 'data': [{'id': 'msg_zzzzzzzzzzzzzzzzzzzzzzz', 'object': 'thread.message', 'created_at': 1735603824, 'assistant_id': None, 'thread_id': 'thread_yyyyyyyyyyyyyyyyyyyyyyy', 'run_id': None, 'role': 'user', 'content': [{'type': 'text', 'text': {'value': "How does wikipedia explain Euler's Identity?", 'annotations': []}}], 'attachments': [], 'metadata': {}}], 'first_id': 'msg_zzzzzzzzzzzzzzzzzzzzzz', 'last_id': 'msg_zzzzzzzzzzzzzzzzz', 'has_more': False}

A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. python3 sample_agents_bing_grounding.py
pip3 freeze raw_python.py 
azure-ai-projects==1.0.0b4
azure-core==1.32.0
azure-identity==1.19.0
azureml==0.2.7
certifi==2024.12.14
cffi==1.17.1
charset-normalizer==3.4.1
cryptography==44.0.0
idna==3.10
isodate==0.7.2
msal==1.31.1
msal-extensions==1.2.0
numpy==1.24.4
pandas==2.0.3
portalocker==2.10.1
pycparser==2.22
PyJWT==2.9.0
python-dateutil==2.9.0.post0
pytz==2024.2
requests==2.32.3
six==1.17.0
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3

Expected behavior
I expected to see some sort of GenAI summary of the Wikipedia article on Euler's identity.

Screenshots
N/A
Additional context
Very simple problem from my perspective. I suspect there is either a missing parameter that gets picked up in the developer environment, or that some (unmentioned in the Python code) switch needs to be set on the Azure/Cloud side when creating the Bing Service.

Glad for a little help on the bleeding edge. Couldn't find anything just searching about.
Thanks

@theloglizard theloglizard changed the title Might Be a Bug, Might Just Need to Clarify the Setup For BIng Might Be a Bug, Might Just Need to Clarify the Setup For Bing Dec 31, 2024
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 31, 2024
@jhakulin
Copy link
Member

Thanks for the report. Did you setup BING_CONNECTION_NAME env variable on the sample?

Please see this document.
https://learn.microsoft.com/en-us/azure/ai-services/agents/how-to/tools/bing-grounding?tabs=python&pivots=overview

@theloglizard
Copy link
Author

theloglizard commented Dec 31, 2024

Yeah, sorry: It hit me last night I hadn't mentioned my environment variables, which are as below, though slightly redacted with ellipsis:

export BING_CONNECTION_NAME='hubforbing. . . . '
export MODEL_DEPLOYMENT_NAME='gpt-4o'
export PROJECT_CONNECTION_STRING="eastus.api.azureml.ms;. . . "

Thanks for the quick come-back.
I think that link you provided may get me off the hump as there are things about attaching the key as a resource that I need to figure out.

@jhakulin jhakulin self-assigned this Dec 31, 2024
@xiangyan99 xiangyan99 removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jan 1, 2025
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jan 1, 2025
@theloglizard
Copy link
Author

theloglizard commented Jan 2, 2025

So following the instructions in the url you helpfully provided I got a little further by adding an API key, but now I get this:

/subscriptions/16f866b6-7cb3-494f-b738-7ad0d449b655/resourceGroups/DefaultResourceGroup-EUS/providers/Microsoft.MachineLearningServices/workspaces/xxxxxxxxx-test1/connections/api_bing_rtfm
Created agent, ID: asst_4yjkqR8fR6Y1Q8ZvkjRIjtKd
Created thread, ID: thread_ce9SizRNeoR0qG0KJFzD6nOH
Created message, ID: msg_hKKCb9PhqqXiUdZPrJyYVyEJ
Run finished with status: failed
Run failed: {'code': 'rate_limit_exceeded', 'message': 'Rate limit is exceeded. Try again in 86400 seconds.'}
Deleted agent
Messages: {'object': 'list', 'data': [{'id': 'msg_hKKCb9PhqqXiUdZPrJyYVyEJ', 'object': 'thread.message', 'created_at': 1735790149, 'assistant_id': None, 'thread_id': 'thread_ce9SizRNeoR0qG0KJFzD6nOH', 'run_id': None, 'role': 'user', 'content': [{'type': 'text', 'text': {'value': "How does wikipedia explain Euler's Identity?", 'annotations': []}}], 'attachments': [], 'metadata': {}}], 'first_id': 'msg_hKKCb9PhqqXiUdZPrJyYVyEJ', 'last_id': 'msg_hKKCb9PhqqXiUdZPrJyYVyEJ', 'has_more': False}

I'm pretty sure I have the right BING_CONNECTION_NAME because if I garble it, it tells me it can't find the connection found in the BING_CONNECTION_NAME.

Now I fiddled with the API key I pulled from the "Grounding with Bing Search" I created (and which I expected to work) by adding an extra character to the end --thereby making it intentionally wrong. And I get the same Rate limit error message.
This suggests the key I'm pulling from the Grounding with Bing Search isn't the right key.
I notice in the document https://learn.microsoft.com/en-us/azure/ai-services/agents/how-to/tools/bing-grounding?tabs=python&pivots=overview
The keys look like uppercase hex. I'm seeing 32 lower case hex digits

Is there any further provisioning required beyond creating the Grounding with Bing Search?

Thanks in advance for any thoughts you may have. I suspect it's time to open a support case.

@jhakulin
Copy link
Member

jhakulin commented Jan 2, 2025

@theloglizard Have you tried to increase the TPM (Tokens Per Minute) on your deployment? What TPM you have currently on your deployment?

@theloglizard
Copy link
Author

@jhakulin That was it. I went from 10K to 200K Tokens/Minute and 2K requests/minute and the example runs, now.
Thanks very much for your help.

@jhakulin
Copy link
Member

jhakulin commented Jan 2, 2025

Thank you! Closing this issue, please let us know if any other issues come up.

@jhakulin jhakulin closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants