SDK operations for Models, Unit tests and Sample notebook#46842
Open
kshitij-microsoft wants to merge 18 commits into
Open
SDK operations for Models, Unit tests and Sample notebook#46842kshitij-microsoft wants to merge 18 commits into
kshitij-microsoft wants to merge 18 commits into
Conversation
d139366 to
bce90ad
Compare
kingernupur
reviewed
May 13, 2026
dargilco
reviewed
May 22, 2026
| * New optional `force` parameter on `agents.delete` and `agents.delete_version` methods. | ||
| * New optional `blueprint_reference` parameters on `agents.create_version` method. | ||
|
|
||
| * New `.beta.models` sub-client for registering and managing local model weights as Foundry `ModelVersion` resources. Generated operations: `list`, `list_versions`, `get`, `update`, `delete`, `pending_upload`, `create_async`, `get_credentials`. |
Member
There was a problem hiding this comment.
I already have a line for ".beta.models" above. Please merge.
| @@ -20,6 +20,8 @@ | |||
| * New optional `force` parameter on `agents.delete` and `agents.delete_version` methods. | |||
| * New optional `blueprint_reference` parameters on `agents.create_version` method. | |||
|
|
|||
| "azure.ai.projects.models.AgentCardSkill": "Azure.AI.Projects.AgentCardSkill", | ||
| "azure.ai.projects.models.InsightRequest": "Azure.AI.Projects.InsightRequest", | ||
| "azure.ai.projects.models.AgentClusterInsightRequest": "Azure.AI.Projects.AgentClusterInsightRequest", | ||
| "azure.ai.projects.models.InsightResult": "Azure.AI.Projects.InsightResult", |
Member
There was a problem hiding this comment.
I don't expect to see anything here change in this file in your PR... is there some issue with resolving conflict after a merge?
howieleung
reviewed
May 22, 2026
| creds = project_client.beta.models.get_credentials( | ||
| name=model_name, | ||
| version=model_version, | ||
| body=ModelCredentialRequest(blob_uri=model.blob_uri), |
Member
… into kchawla/models
Darren (dargilco):
- D1: Merge feature/azure-ai-projects/2.2.0 into branch (separate merge commit).
- D2: Remove duplicate '.beta.models' CHANGELOG bullet.
- D3: Remove stray blank line in CHANGELOG.
- D4: Revert apiview-properties.json to base.
- D5: Wire async patched BetaModelsOperations into aio/operations/_patch.py;
add azure/ai/projects/aio/operations/_patch_models_async.py with async create_version()
using azure.storage.blob.aio.ContainerClient.
Howie (howieleung):
- H1: Rename helper models_create -> create_version (and validator).
- H2: Rename sample_models{,_async}.py -> sample_models_basic{,_async}.py.
- H3: Print friendly per-field summaries in samples instead of raw model repr.
- H4: Guard against None return from create_version before accessing fields.
Also follows TypeSpec rename: generated create_async() -> pending_create_version().
- Renames patched BetaModelsOperations.create_version() to create() (sync + async). - Renames internal validator _validate_create_version_inputs -> _validate_create_inputs. - Updates samples, tests, README, and CHANGELOG to use the new name. - Leaves generated spec method pending_create_version unchanged.
- Add parameterized sample tests test_models_samples (sync + async). - Add slim modelsServicePreparer (only foundry_project_endpoint). - Add sanitizers for random model name, Foundry storage account/container, /workspaces/<name>, azureai:// asset URIs, account/project from FOUNDRY_PROJECT_ENDPOINT, and SAS query parameters (sig, skoid, sktid). - Use per-recording random MODEL_NAME (recsmplmdl<hex>) and sanitize to a stable value on playback (Foundry asset-store reserves <name>/<version> permanently). - Update assets.json tag to point at the new recordings. Bug fixes surfaced by live runs (renamed generated kwargs): - pending_upload: body= -> pending_upload_request= - pending_create_version: body= -> model_version= - get_credentials: body= -> credential_request= Applied to patched create() helper (sync + async), all three model samples, and the test_patch_models mock. Notes: - sample_models_basic.py (which uses AzCopy) is excluded from the parameterized sample tests because AzCopy traffic isn't captured by the test proxy. - LLM print-call validation is not invoked for models tests (canary project has no Azure OpenAI connection).
The multi-step orchestrator helper performs local input validation before any HTTP call, so the test framework's synthetic placeholder args (e.g. source={}) cause it to raise TypeError before _RequestCaptured is ever raised. Add a shared EXCLUDED_BETA_METHODS mapping and skip excluded methods in both sync and async discovery. The header invariant is still enforced for every underlying HTTP method create() calls (pending_upload, pending_create_version, get).
- Replace hasattr-based duck typing with isinstance(dict) check so pyright can narrow types correctly on _extract_pending_upload_targets. - Remove unused HttpResponseError import. - Suppress do-not-import-asyncio for asyncio.sleep used in the async polling loop (transport sleep is not applicable). - Add :param/:keyword/:return/:rtype docstring sections on private helpers to satisfy azure-pylint-guidelines-checker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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 API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines