Repository navigation
Conversation
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1613953&view=codecoverage-tab |
984c7e5 to
d870cf3
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The implementation consistently fixes the registration mismatch while preserving existing key types for other stores.
0 open findings
What changed in this PR
Aligns Azure AI Search template key types with its string-keyed collection registration, preventing generated applications from failing during dependency injection.
Changes:
- Uses string keys for Azure AI Search collections and records.
- Preserves
Guidkeys for local and Qdrant stores. - Updates both Azure AI Search snapshots.
| File | Description |
|---|---|
src/.../Services/SemanticSearch.cs |
Selects the collection key type by vector store. |
src/.../Services/IngestedChunk.cs |
Selects the record key type by vector store. |
test/.../aichatweb.oai_aais.../SemanticSearch.cs |
Updates the non-Aspire snapshot. |
test/.../aichatweb.oai_aais.../IngestedChunk.cs |
Updates its string-key record snapshot. |
test/.../aichatweb.A_aoai_aais.../SemanticSearch.cs |
Updates the Aspire snapshot. |
test/.../aichatweb.A_aoai_aais.../IngestedChunk.cs |
Updates its string-key record snapshot. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1630637&view=codecoverage-tab |
Why
Since #7804,
SemanticSearchtakes aVectorStoreCollection<Guid, IngestedChunk>for every vector store. With Azure AI Search,Program.csregisters the collection withAddAzureAISearchCollection<IngestedChunk>, which only registersstringkeys. A project created withdotnet new aichatweb --vector-store azureaisearchthen stops at startup:Change
With Azure AI Search,
IngestedChunk.Keyand the collection thatSemanticSearchtakes are nowstring, as the registration. The local vector store and Qdrant keepGuidkeys.--vector-store azureaisearchIngestedChunk.KeyGuidstringSemanticSearchVectorStoreCollection<Guid, IngestedChunk>VectorStoreCollection<string, IngestedChunk>VectorStoreWriterstill writesGuidkeys. Azure AI Search stores keys as strings, so the chunks it writes are read through thestring-keyed collection.The snapshots of the two Azure AI Search configurations are updated.
I generated
dotnet new aichatweb --provider openai --vector-store azureaisearch --managed-identity falsefrom the template package built frommainand from this branch. Onmainthe app stops at startup with the error above; with this change it starts. The snapshot tests pass (5/5).Microsoft Reviewers: Open in CodeFlow