-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix typing in samples #38354
base: feature/azure-ai-projects
Are you sure you want to change the base?
Fix typing in samples #38354
Conversation
API change check APIView has identified API level changes in this PR and created following API reviews. |
sdk/ai/azure-ai-projects/samples/agents/sample_agents_with_file_search_attachment.py
Outdated
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/samples/connections/async_samples/sample_connections_async.py
Outdated
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/samples/agents/sample_agents_functions.py
Outdated
Show resolved
Hide resolved
@@ -121,22 +123,22 @@ async def sample_connections_async(): | |||
print("====> Creating ChatCompletionsClient using API key authentication") | |||
from azure.core.credentials import AzureKeyCredential | |||
|
|||
client = ChatCompletionsClient( | |||
endpoint=connection.endpoint_url, credential=AzureKeyCredential(connection.key) | |||
ai_client = ChatCompletionsClient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change of name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the sync sample version you call it inference_client
. So if you want to change the name, you can change it to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mypy defines the variable type y its first occurrence in the code and once it was assigned specific type, it will complain if we call methods of the other type.
|
||
import os | ||
from azure.ai.projects import AIProjectClient | ||
from azure.ai.projects.models import ConnectionType, AuthenticationType | ||
from azure.identity import DefaultAzureCredential | ||
|
||
#from azure.identity import DefaultAzureCredential, get_bearer_token_provider | ||
from azure.core.credentials import TokenCredential |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this import statement above the line that uses it.
|
||
import asyncio | ||
import os | ||
from azure.ai.projects.aio import AIProjectClient | ||
from azure.ai.projects.models import ConnectionType, AuthenticationType | ||
from azure.core.credentials_async import AsyncTokenCredential | ||
from azure.identity.aio import DefaultAzureCredential |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the line from azure.core.credentials_async import AsyncTokenCredential
above the line that uses it, not at the top.
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines