Python: Integrate azure-cosmos into core, lazy loading, and root samples - #5044
Python: Integrate azure-cosmos into core, lazy loading, and root samples#5044Giles Odigwe (giles17) wants to merge 1 commit into
Conversation
- Add agent-framework-azure-cosmos to core[all] optional dependencies - Sort the [all] dependency list alphabetically - Create lazy-loading namespace at agent_framework.azure_cosmos - Add CosmosHistoryProvider to agent_framework.azure umbrella namespace - Move sample from packages/azure-cosmos/samples/ to samples/02-agents/context_providers/azure_cosmos/ - Update azure-cosmos README.md and AGENTS.md with new paths and import options - Remove empty devui package-local samples folder (already relocated) Closes microsoft#5003 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Integrates the agent-framework-azure-cosmos package into the Python monorepo’s standard “core extras + lazy import namespaces + root samples” patterns, and cleans up leftover DevUI samples scaffolding.
Changes:
- Adds
agent-framework-azure-cosmostoagent-framework-core[all]and updates the lockfile. - Introduces
agent_framework.azure_cosmoslazy-loading namespace and re-exportsCosmosHistoryProviderviaagent_framework.azure. - Moves/links Cosmos samples into the root
python/samples/structure and updates package docs to point to the new location; removes the empty DevUI samples package folder.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python/uv.lock | Adds agent-framework-azure-cosmos to the resolved all extra set. |
| python/samples/02-agents/context_providers/azure_cosmos/README.md | New root sample README for Cosmos context provider. |
| python/samples/02-agents/context_providers/azure_cosmos/cosmos_history_provider.py | Updates sample to import via the new lazy namespace. |
| python/packages/devui/samples/README.md | Removes now-obsolete DevUI samples README (samples live in root). |
| python/packages/devui/samples/init.py | Removes empty/unused DevUI samples package marker. |
| python/packages/core/pyproject.toml | Adds agent-framework-azure-cosmos to core[all] and re-sorts entries. |
| python/packages/core/agent_framework/azure/init.py | Adds CosmosHistoryProvider to Azure umbrella lazy exports. |
| python/packages/core/agent_framework/azure_cosmos/init.py | New lazy-loading namespace for Cosmos connector exports. |
| python/packages/azure-cosmos/samples/README.md | Replaces package-local sample docs with a pointer to root samples. |
| python/packages/azure-cosmos/README.md | Updates sample link to the new root samples location. |
| python/packages/azure-cosmos/AGENTS.md | Documents the new recommended lazy import path and umbrella import path. |
Comments suppressed due to low confidence (1)
python/samples/02-agents/context_providers/azure_cosmos/cosmos_history_provider.py:11
- This sample contains standalone triple-quoted string literals later in the file (the large description block and the sample output block). Because Ruff enables bugbear (B) rules for
samples/**, these will be flagged asB018(useless expression) since they are not the module docstring. Convert them into a proper module docstring at the top of the file and/or regular comments so linting passes.
| Lazy-loading namespace (recommended): | ||
|
|
||
| ```python | ||
| from agent_framework.azure_cosmos import CosmosHistoryProvider |
There was a problem hiding this comment.
This should be in the azure namespace
There was a problem hiding this comment.
This shouldn't exist
| "AgentResponseCallbackProtocol": ("agent_framework_durabletask", "agent-framework-durabletask"), | ||
| "AzureAISearchContextProvider": ("agent_framework_azure_ai_search", "agent-framework-azure-ai-search"), | ||
| "AzureAISearchSettings": ("agent_framework_azure_ai_search", "agent-framework-azure-ai-search"), | ||
| "CosmosHistoryProvider": ("agent_framework_azure_cosmos", "agent-framework-azure-cosmos"), |
There was a problem hiding this comment.
This is missing from the accompanying init.pyi
| import asyncio | ||
| import os | ||
|
|
||
| from agent_framework.azure_cosmos import CosmosHistoryProvider |
There was a problem hiding this comment.
Should be .azure
|
Copilot could you address the open comments? |
|
superceded by #5056 |
Motivation and Context
Addresses #5003 - the azure-cosmos package was registered in the workspace but not fully integrated into the standard monorepo patterns. The DevUI package also had a leftover empty samples directory.
Description
azure-cosmos integration (all 3 promotion steps):
agent-framework-azure-cosmosto the[all]extra inpackages/core/pyproject.tomlagent_framework.azure_cosmosexportingCosmosHistoryProviderCosmosHistoryProviderto theagent_framework.azureumbrella namespacepackages/azure-cosmos/samples/tosamples/02-agents/context_providers/azure_cosmos/AGENTS.mdto document all import paths (lazy-loading, Azure umbrella, and direct)README.mdto point to the new sample locationHousekeeping:
[all]dependency list alphabeticallypackages/devui/samples/folder (samples were already relocated tosamples/02-agents/devui/)Contribution Checklist