Repository navigation
Python: Support knowledge_source_params in AzureAISearchContextProvider - #8673
Conversation
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): df7c618d6cfd
Model: gpt-5.6-sol-fast
Overview
The change adds agentic-only per-source retrieval overrides while preserving prior defaults, source ordering, explicit opt-out behavior, and caller object ownership. Constructor guards reject duplicate names and nonempty semantic-mode usage, and focused tests cover both existing and index-backed knowledge bases. No concrete Critical, High, or Medium defect remained after reconciling the proposed failure cases against the implementation and tests.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
Saquib Jawed (@saquibjawedbit) Thanks — the per-source override and defaulting behavior is well covered, the dedicated review found no issues, and all reported checks are green.
Motivation & Context
AzureAISearchContextProviderbuilds the per-sourceknowledge_source_paramsfor agentic retrieval itself (one entry per knowledge source, withinclude_reference_source_data=True). Callers have no way to set any other per-source option, most importantlyfilter_add_onfor server-side OData filtering, without subclassing the provider or touching private state.#6612 proposed this earlier but was closed after the provider changed underneath it (source kinds are now resolved per source, #7875). This PR builds on the current code.
Description & Review Guide
knowledge_source_params: Sequence[KnowledgeSourceParams] | Noneon the agentic overloads. The semantic overload types it asNone, and passing it in semantic mode raisesValueError.knowledge_source_name. Entries for sources the provider did not resolve are appended. Other sources keep their defaults.include_reference_source_dataunset, it defaults toTrue(on a copy, so the caller's object isn't changed). This keepsref.source_datapopulated (Python: AzureAISearchContextProvider agentic mode:source_datais alwaysNoneon references — missinginclude_reference_source_dataparameter #5095). An explicitFalseis respected.knowledge_source_namevalues are rejected at construction.None, requests are built exactly as before.Related Issue
Fixes #5560
The only earlier PR for this issue (#6612) is closed. This PR works on current
mainand applies overrides to both the existing-KB and index-backed setup paths.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.Validation:
uv run poe test -P azure-ai-search(389 passed),uv run poe syntax -P azure-ai-search,uv run poe pyright -P azure-ai-search,uv run poe mypy -P azure-ai-search.