Skip to content

Push updates from the latest typespec #40616

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 8 commits into
base: main
Choose a base branch
from
Open

Conversation

nick863
Copy link
Member

@nick863 nick863 commented Apr 19, 2025

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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

nick863 and others added 8 commits April 1, 2025 11:01
* Use 1DP endpoint

* Add more config

* Fix linters

* Fix linters

* Fix spelling

* Add package to the build, so we can use private feed

* Fix samples and readme

* Fix readme-s and spelling

* Make back compatible

* Fixes

* Fix linters and record the tests

---------

Co-authored-by: Darren Cohen <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings April 19, 2025 01:41
@github-actions github-actions bot added the AI label Apr 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the SDK based on the latest typespec, introducing new client implementations (both asynchronous and synchronous), updating configuration and type definitions, and refreshing ancillary package files.

  • Added asynchronous and synchronous client implementations with updated request handling
  • Introduced new configuration, types, version, and vendor files
  • Updated package initialization and documentation for tests and licensing

Reviewed Changes

Copilot reviewed 147 out of 152 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/ai/azure-ai-assistants/azure/ai/assistants/aio/_client.py Introduces the async client with endpoint formatting and policy setup
sdk/ai/azure-ai-assistants/azure/ai/assistants/init.py Sets up package export and versioning
sdk/ai/azure-ai-assistants/azure/ai/assistants/_client.py Provides the synchronous client with similar functionalities
sdk/ai/azure-ai-assistants/azure/ai/assistants/_types.py Defines type unions used across the SDK
Other files Include configuration, vendor, patch, version, changelog, and packaging changes to support the updated typespec
Files not reviewed (5)
  • .vscode/cspell.json: Language not supported
  • pylintrc: Language not supported
  • sdk/ai/azure-ai-assistants/MANIFEST.in: Language not supported
  • sdk/ai/azure-ai-assistants/apiview-properties.json: Language not supported
  • sdk/ai/azure-ai-assistants/assets.json: Language not supported
Comments suppressed due to low confidence (1)

sdk/ai/azure-ai-assistants/azure/ai/assistants/_types.py:13

  • [nitpick] The union type definition includes duplicate 'str' entries; removing the redundancy will improve clarity.
AssistantsApiResponseFormatOption = Union[
    str,
    str,
    "_models.AssistantsApiResponseFormatMode",
    "_models.AssistantsApiResponseFormat",
    "_models.ResponseFormatJsonSchemaType",
]

def __init__(
self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any
) -> None:
_endpoint = "{endpoint}"
Copy link
Preview

Copilot AI Apr 19, 2025

Choose a reason for hiding this comment

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

The endpoint formatting is incorrect since the literal "{endpoint}" is used. Consider using an f-string (e.g., f"{endpoint}") or directly passing the endpoint variable.

Suggested change
_endpoint = "{endpoint}"
_endpoint = endpoint

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

"""

def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
_endpoint = "{endpoint}"
Copy link
Preview

Copilot AI Apr 19, 2025

Choose a reason for hiding this comment

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

In the synchronous client, the endpoint placeholder is hard-coded and does not interpolate the actual value. Use an f-string or the endpoint parameter directly to ensure proper URL formation.

Suggested change
_endpoint = "{endpoint}"
_endpoint = endpoint

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-ai-assistants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants