Python: Support stable + preview Azure AI Search (Foundry IQ) API versions - #6602
Closed
Farzad Sunavala (farzad528) wants to merge 10 commits into
Closed
Conversation
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python agent-framework-azure-ai-search integration to work with both the stable (GA) and preview Azure AI Search / Foundry IQ data-plane API versions exposed via azure-search-documents 12.x, while keeping stable behavior as the default and gating preview-only agentic features behind explicit preview support.
Changes:
- Bumps
agent-framework-azure-ai-searchto1.0.0b260618and updates the dependency range toazure-search-documents>=12.0.0,<13(stable/preview compatible). - Adds
api_versionplumbing plus exportedSTABLE_API_VERSION/PREVIEW_API_VERSIONconstants, and gates preview-only agentic options (output mode + low/medium reasoning effort) via_preview_features_active(). - Updates tests, docs, and samples to reflect the stable vs preview split and SDK surface differences (including vector query parameter changes in 12.x).
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| python/uv.lock | Updates lockfile to reflect azure-search-documents 12.0.0 and the bumped azure-ai-search package version. |
| python/samples/02-agents/context_providers/azure_ai_search/search_context_semantic.py | Documents optional api_version pinning for semantic mode usage. |
| python/samples/02-agents/context_providers/azure_ai_search/search_context_agentic.py | Updates agentic sample to use model=... and documents preview-only options + optional api_version pinning. |
| python/samples/02-agents/context_providers/azure_ai_search/README.md | Adds stable vs preview API-version guidance and corrects installation package names. |
| python/packages/core/agent_framework/azure/init.py | Re-exports STABLE_API_VERSION / PREVIEW_API_VERSION via the lazy agent_framework.azure namespace. |
| python/packages/azure-ai-search/tests/test_aisearch_context_provider.py | Adds explicit tests for api-version forwarding and stable/preview feature gating; introduces preview-feature stubs to keep tests SDK-agnostic. |
| python/packages/azure-ai-search/README.md | Documents stable vs preview channels, pinning via constants, and preview-only agentic capabilities. |
| python/packages/azure-ai-search/pyproject.toml | Updates package version and dependency bounds for azure-search-documents 12.x. |
| python/packages/azure-ai-search/AGENTS.md | Documents new constants and the preview gating model. |
| python/packages/azure-ai-search/agent_framework_azure_ai_search/_context_provider.py | Implements api_version forwarding, preview feature gating, SDK-resilient imports, and 12.x query/response compatibility adjustments. |
| python/packages/azure-ai-search/agent_framework_azure_ai_search/init.py | Re-exports STABLE_API_VERSION / PREVIEW_API_VERSION from the package root. |
| python/CHANGELOG.md | Adds an Unreleased entry describing the stable/preview support and new API surface. |
…sions Update agent-framework-azure-ai-search to work across the stable/GA azure-search-documents SDK (12.0.0, api-version 2026-04-01) and the preview SDK (12.1.0b1, api-version 2026-05-01-preview) for both semantic and agentic modes. - Bump the dependency to azure-search-documents>=12.0.0,<13 and the package to 1.0.0b260618. - Add an api_version parameter (threaded into SearchClient, SearchIndexClient, and KnowledgeBaseRetrievalClient) plus STABLE_API_VERSION/PREVIEW_API_VERSION constants, re-exported from agent_framework.azure. - Auto-detect preview-only agentic features (output mode, low/medium reasoning effort) via _preview_features_active(), which requires both the preview SDK and a preview api-version; defaults (extractive + minimal) work on both channels and preview-only options raise an actionable error otherwise. - Make knowledge-base imports SDK-version resilient and fix the 12.x surface (k -> k_nearest_neighbors, defensive additional_properties). - Update tests (pass on both SDKs), docs, samples, CHANGELOG, and uv.lock. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Farzad Sunavala (farzad528)
force-pushed
the
farzad528/update-foundry-iq-api-versions
branch
from
June 18, 2026 13:34
e432b02 to
8ce1528
Compare
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.
Motivation & Context
The
agent-framework-azure-ai-searchpackage pinnedazure-search-documents>=11.7.0b2,<11.7.0b3and hard-imported Knowledge Base symbols from a single preview SDK layout. Azure AI Search / Foundry IQ has since shipped a stable/GA data-plane API (2026-04-01, served byazure-search-documents 12.0.0) alongside the latest preview API (2026-05-01-preview, served by12.1.0b1), and the two SDK layouts diverge: the preview adds agentic output modes and low/medium reasoning effort on the knowledge base definition and retrieve request, which the stable SDK/wire does not expose. On the current pin the package cannot use the stable channel, and on the 12.x SDKs it would fail to import or send fields the GA wire rejects.This change lets the package work across both channels — stable (released) by default and preview opt-in — for both semantic and agentic modes, following the
azure-search-documentsstable/preview convention and the Agent Framework package guidance. Context: https://devblogs.microsoft.com/foundry/foundry-iq-agent-framework-integration/Description & Review Guide
What are the major changes?
azure-search-documents>=12.0.0,<13so a normal install resolves the stable SDK (12.0.0, api-version2026-04-01) and--preresolves the preview SDK (12.1.0b1, api-version2026-05-01-preview). Bump the package to1.0.0b260618.api_versionparameter toAzureAISearchContextProvider, threaded intoSearchClient,SearchIndexClient, andKnowledgeBaseRetrievalClient, plus exportedSTABLE_API_VERSION/PREVIEW_API_VERSIONconstants (also re-exported fromagent_framework.azure).None(default) defers to the installed SDK's default._preview_features_active(), which requires both the preview SDK and a preview api-version. Defaults (extractive output + minimal effort) work on both channels; a stable api-version never sends preview-only fields, and explicitly requestinganswer_synthesis/low/mediumwithout preview support raises an actionable error.VectorizableTextQuery/VectorizedQueryusek_nearest_neighbors(wask), and reference parsing readsadditional_propertiesdefensively.model_deployment_namesample argument),CHANGELOG.md, anduv.lock.What is the impact of these changes?
--pre. No breakage for existing default usage (extractive + minimal). Preview-only agentic options surface a clear error instead of a server-side400when used on the stable wire. Unit tests pass on both12.0.0and12.1.0b1; the flow was also validated live against a preview knowledge base across default / stable-pinned / preview-pinned api-versions.What do you want reviewers to focus on?
_preview_features_active()(SDK capability AND preview api-version) and the resulting error/branching in__init__validation,_ensure_knowledge_base, and_agentic_search.>=12.0.0,<13and the stable-by-default / preview-opt-in behavior.Related Issue
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.