diff --git a/python/CHANGELOG.md b/python/CHANGELOG.md index 4d9cd86150e..b8c58e82db8 100644 --- a/python/CHANGELOG.md +++ b/python/CHANGELOG.md @@ -7,6 +7,68 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.12.0] - 2026-07-21 + +### Added +- **agent-framework-azure-cosmos-memory**: Add an alpha Azure Cosmos DB semantic-memory context provider with fact extraction, user profiles, samples, and integration coverage ([#6719](https://github.com/microsoft/agent-framework/pull/6719)) +- **agent-framework-azurefunctions**, **agent-framework-core**, **agent-framework-durabletask**: Add HITL response-URL addressing for requests raised from inside workflows ([#7001](https://github.com/microsoft/agent-framework/pull/7001)) +- **agent-framework-core**: Add cross-session origin attribution to context-injected messages ([#7041](https://github.com/microsoft/agent-framework/pull/7041)) +- **agent-framework-core**, **agent-framework-tools**: Warn when auto-approved tools have name collisions ([#7090](https://github.com/microsoft/agent-framework/pull/7090)) +- **agent-framework-hosting-a2a**: Add app-owned A2A hosting helpers ([#7050](https://github.com/microsoft/agent-framework/pull/7050)) +- **agent-framework-hosting-mcp**: Add app-owned MCP hosting helpers for exposing agents and workflows as native MCP tools ([#7209](https://github.com/microsoft/agent-framework/pull/7209)) +- **agent-framework-hosting-responses**: [BREAKING] Add Responses conversation ID creation and parsing helpers, and distinguish conversation IDs from previous response IDs ([#7234](https://github.com/microsoft/agent-framework/pull/7234)) +- **agent-framework-hosting-telegram**: Add Telegram hosting helpers and samples ([#7047](https://github.com/microsoft/agent-framework/pull/7047)) +- **samples**: Add a Microsoft OpenTelemetry Distro observability sample ([#5632](https://github.com/microsoft/agent-framework/pull/5632)) + +### Changed +- **agent-framework-ag-ui**: [BREAKING] Emit `TOOL_CALL` events for workflow participant tool calls ([#7039](https://github.com/microsoft/agent-framework/pull/7039)) +- **agent-framework-a2a**: Reduce `A2AExecutor` log noise for content types without protocol mappings ([#7034](https://github.com/microsoft/agent-framework/pull/7034)) +- **agent-framework-ag-ui**, **agent-framework-core**: Optimize shared serialization paths ([#7165](https://github.com/microsoft/agent-framework/pull/7165)) +- **agent-framework-ag-ui**, **agent-framework-bedrock**, **agent-framework-claude**, **agent-framework-core**, **agent-framework-github-copilot**, **agent-framework-ollama**, **agent-framework-openai**: Normalize chat finish reasons across providers ([#7105](https://github.com/microsoft/agent-framework/pull/7105)) +- **agent-framework-anthropic**, **agent-framework-azure-contentunderstanding**, **agent-framework-azure-cosmos**, **agent-framework-core**, **agent-framework-declarative**, **agent-framework-devui**, **agent-framework-foundry**, **agent-framework**: Update Microsoft Foundry branding in shipped APIs and package documentation ([#6999](https://github.com/microsoft/agent-framework/pull/6999)) +- **agent-framework-azure-contentunderstanding**, **agent-framework-azure-cosmos-memory**, **agent-framework-chatkit**, **agent-framework-core**, **agent-framework-durabletask**, **agent-framework-foundry**, **agent-framework-foundry-hosting**, **agent-framework-gemini**, **agent-framework-hyperlight**, **agent-framework-lab**, **agent-framework-monty**, **agent-framework-openai**, **agent-framework-tools**, **agent-framework**: Consolidate dependency updates and compatibility adjustments ([#7204](https://github.com/microsoft/agent-framework/pull/7204)) +- **agent-framework-azurefunctions**, **agent-framework-devui**, **agent-framework-foundry**, **agent-framework-hosting-responses**, **agent-framework-lab**, **agent-framework-mistral**, **agent-framework**: Clean up dependency groups and compatibility handling ([#7046](https://github.com/microsoft/agent-framework/pull/7046)) +- **agent-framework-azurefunctions**, **agent-framework-durabletask**: Normalize initial durable workflow inputs across hosting paths ([#7205](https://github.com/microsoft/agent-framework/pull/7205)) +- **agent-framework-core**: [BREAKING — experimental] Correct harness before-strategy compaction when state persists per service call ([#7055](https://github.com/microsoft/agent-framework/pull/7055)) +- **agent-framework-core**: [BREAKING] Graduate `create_harness_agent` from experimental to stable ([#7120](https://github.com/microsoft/agent-framework/pull/7120)) +- **agent-framework-core**: Graduate the mode and todo providers from experimental to stable ([#7053](https://github.com/microsoft/agent-framework/pull/7053)) +- **agent-framework-core**: Graduate `ToolApprovalMiddleware` from experimental to stable ([#7106](https://github.com/microsoft/agent-framework/pull/7106)) +- **agent-framework-core**: Graduate `FileMemoryProvider` from experimental to stable ([#7113](https://github.com/microsoft/agent-framework/pull/7113)) +- **agent-framework-core**: Make `FileAccessProvider` opt-in for harness agents ([#7094](https://github.com/microsoft/agent-framework/pull/7094)) +- **agent-framework-core**: Serialize tool definitions best-effort for observability ([#7029](https://github.com/microsoft/agent-framework/pull/7029)) +- **agent-framework-declarative**: Promote declarative workflows from release candidate to stable ([#7065](https://github.com/microsoft/agent-framework/pull/7065)) +- **agent-framework-devui**: Refine request logging ([#7083](https://github.com/microsoft/agent-framework/pull/7083)) +- **agent-framework-foundry-hosting**: Promote the package to beta and add it to the main installation surface; make the Foundry Toolbox MCP skills sample self-contained ([#7099](https://github.com/microsoft/agent-framework/pull/7099)) +- **agent-framework-azure-contentunderstanding**, **agent-framework-gemini**, **agent-framework-mistral**, **agent-framework-monty**, **agent-framework-tools**: Promote the packages to beta, add them to the main installation surface, expose lazy-loading namespaces, and move package-local samples into the root sample tree +- **agent-framework-github-copilot**: Forward `GitHubCopilotOptions` verbatim when creating sessions ([#7155](https://github.com/microsoft/agent-framework/pull/7155)) +- **docs**: Add self-hosting sample snippets ([#7104](https://github.com/microsoft/agent-framework/pull/7104)) +- **docs**: Add environment-file templates for Durable Task hosting samples ([#5948](https://github.com/microsoft/agent-framework/pull/5948)) +- **samples**: Keep ChatKit attachments close to the sample application that owns them ([#7038](https://github.com/microsoft/agent-framework/pull/7038)) + +### Fixed +- **agent-framework-ag-ui**: Bind streamed tool arguments to their call ids ([#6342](https://github.com/microsoft/agent-framework/pull/6342)) +- **agent-framework-ag-ui**: Accept state data URIs whose media type includes parameters ([#6905](https://github.com/microsoft/agent-framework/pull/6905)) +- **agent-framework-ag-ui**: Coalesce reasoning deltas without content ids into a single reasoning block ([#6804](https://github.com/microsoft/agent-framework/pull/6804)) +- **agent-framework-ag-ui**: Bridge request state and session continuity ([#7084](https://github.com/microsoft/agent-framework/pull/7084)) +- **agent-framework-ag-ui**: Replay workflow handoff results correctly ([#7102](https://github.com/microsoft/agent-framework/pull/7102)) +- **agent-framework-ag-ui**: Clarify `require_confirmation` documentation for `confirm_changes` HITL gating ([#6884](https://github.com/microsoft/agent-framework/pull/6884)) +- **agent-framework-anthropic**: Prevent per-run `additional_beta_flags` from leaking into request keyword arguments ([#7060](https://github.com/microsoft/agent-framework/pull/7060)) +- **agent-framework-core**: Clear `service_session_id` in the agent wrapper when session propagation is enabled ([#5875](https://github.com/microsoft/agent-framework/pull/5875)) +- **agent-framework-core**: Preserve tool span context for parallel calls ([#6512](https://github.com/microsoft/agent-framework/pull/6512)) +- **agent-framework-core**: Parse structured values assembled from split text chunks ([#6990](https://github.com/microsoft/agent-framework/pull/6990)) +- **agent-framework-core**: Raise `ValueError` for malformed data URIs ([#6916](https://github.com/microsoft/agent-framework/pull/6916)) +- **agent-framework-core**: Preserve function-call names when merging streaming deltas ([#6809](https://github.com/microsoft/agent-framework/pull/6809)) +- **agent-framework-core**, **agent-framework-durabletask**: Handle checkpoint encodings consistently ([#6579](https://github.com/microsoft/agent-framework/pull/6579)) +- **agent-framework-core**: Preserve explicit null arguments during automatic function calling ([#7108](https://github.com/microsoft/agent-framework/pull/7108)) +- **agent-framework-core**: Count non-ASCII text correctly during compaction ([#7124](https://github.com/microsoft/agent-framework/pull/7124)) +- **agent-framework-core**: Forward `header_provider` headers to streamable HTTP MCP transports ([#7218](https://github.com/microsoft/agent-framework/pull/7218)) +- **agent-framework-core**: Prevent compaction from emitting empty projections ([#7219](https://github.com/microsoft/agent-framework/pull/7219)) +- **agent-framework-core**: Return MCP tool-use sampling results to the requesting server ([#7189](https://github.com/microsoft/agent-framework/pull/7189)) +- **agent-framework-hosting**, **agent-framework-hosting-responses**: Isolate stored session snapshots from later mutations ([#7141](https://github.com/microsoft/agent-framework/pull/7141)) +- **agent-framework-ollama**: Generate distinct call ids for parallel tool calls ([#6822](https://github.com/microsoft/agent-framework/pull/6822)) +- **agent-framework-orchestrations**: Prevent the Magentic manager from duplicating conversation history ([#6297](https://github.com/microsoft/agent-framework/pull/6297)) +- **samples**: Correct the concurrent agents sample's handling of workflow output ([#6548](https://github.com/microsoft/agent-framework/pull/6548)) + ## [1.11.0] - 2026-07-09 ### Added @@ -1334,7 +1396,8 @@ Release candidate for **agent-framework-core** and **agent-framework-azure-ai** For more information, see the [announcement blog post](https://devblogs.microsoft.com/foundry/introducing-microsoft-agent-framework-the-open-source-engine-for-agentic-ai-apps/). -[Unreleased]: https://github.com/microsoft/agent-framework/compare/python-1.11.0...HEAD +[Unreleased]: https://github.com/microsoft/agent-framework/compare/python-1.12.0...HEAD +[1.12.0]: https://github.com/microsoft/agent-framework/compare/python-1.11.0...python-1.12.0 [1.11.0]: https://github.com/microsoft/agent-framework/compare/python-1.10.0...python-1.11.0 [1.10.0]: https://github.com/microsoft/agent-framework/compare/python-1.9.0...python-1.10.0 [1.9.0]: https://github.com/microsoft/agent-framework/compare/python-1.8.1...python-1.9.0 diff --git a/python/PACKAGE_STATUS.md b/python/PACKAGE_STATUS.md index cd99ec36448..4392a8c14ee 100644 --- a/python/PACKAGE_STATUS.md +++ b/python/PACKAGE_STATUS.md @@ -18,9 +18,10 @@ Status is grouped into these buckets: | `agent-framework-a2a` | `python/packages/a2a` | `beta` | | `agent-framework-ag-ui` | `python/packages/ag-ui` | `rc` | | `agent-framework-anthropic` | `python/packages/anthropic` | `beta` | -| `agent-framework-azure-contentunderstanding` | `python/packages/azure-contentunderstanding` | `alpha` | +| `agent-framework-azure-contentunderstanding` | `python/packages/azure-contentunderstanding` | `beta` | | `agent-framework-azure-ai-search` | `python/packages/azure-ai-search` | `beta` | | `agent-framework-azure-cosmos` | `python/packages/azure-cosmos` | `beta` | +| `agent-framework-azure-cosmos-memory` | `python/packages/azure-cosmos-memory` | `alpha` | | `agent-framework-azurefunctions` | `python/packages/azurefunctions` | `beta` | | `agent-framework-bedrock` | `python/packages/bedrock` | `beta` | | `agent-framework-chatkit` | `python/packages/chatkit` | `beta` | @@ -31,8 +32,9 @@ Status is grouped into these buckets: | `agent-framework-devui` | `python/packages/devui` | `beta` | | `agent-framework-durabletask` | `python/packages/durabletask` | `beta` | | `agent-framework-foundry` | `python/packages/foundry` | `released` | +| `agent-framework-foundry-hosting` | `python/packages/foundry_hosting` | `beta` | | `agent-framework-foundry-local` | `python/packages/foundry_local` | `beta` | -| `agent-framework-gemini` | `python/packages/gemini` | `alpha` | +| `agent-framework-gemini` | `python/packages/gemini` | `beta` | | `agent-framework-github-copilot` | `python/packages/github_copilot` | `rc` | | `agent-framework-hosting` | `python/packages/hosting` | `alpha` | | `agent-framework-hosting-a2a` | `python/packages/hosting-a2a` | `alpha` | @@ -42,13 +44,14 @@ Status is grouped into these buckets: | `agent-framework-hyperlight` | `python/packages/hyperlight` | `beta` | | `agent-framework-lab` | `python/packages/lab` | `beta` | | `agent-framework-mem0` | `python/packages/mem0` | `beta` | -| `agent-framework-mistral` | `python/packages/mistral` | `alpha` | -| `agent-framework-monty` | `python/packages/monty` | `alpha` | +| `agent-framework-mistral` | `python/packages/mistral` | `beta` | +| `agent-framework-monty` | `python/packages/monty` | `beta` | | `agent-framework-ollama` | `python/packages/ollama` | `beta` | | `agent-framework-openai` | `python/packages/openai` | `released` | | `agent-framework-orchestrations` | `python/packages/orchestrations` | `released` | | `agent-framework-purview` | `python/packages/purview` | `beta` | | `agent-framework-redis` | `python/packages/redis` | `beta` | +| `agent-framework-tools` | `python/packages/tools` | `beta` | ## Deprecated / removed packages diff --git a/python/packages/a2a/pyproject.toml b/python/packages/a2a/pyproject.toml index b0c0a5d72d9..3af64e0e36f 100644 --- a/python/packages/a2a/pyproject.toml +++ b/python/packages/a2a/pyproject.toml @@ -4,7 +4,7 @@ description = "A2A integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/ag-ui/pyproject.toml b/python/packages/ag-ui/pyproject.toml index 727cb4d8a00..bf1c903be6e 100644 --- a/python/packages/ag-ui/pyproject.toml +++ b/python/packages/ag-ui/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agent-framework-ag-ui" -version = "1.0.0rc8" +version = "1.0.0rc9" description = "AG-UI protocol integration for Agent Framework" readme = "README.md" license-files = ["LICENSE"] diff --git a/python/packages/anthropic/pyproject.toml b/python/packages/anthropic/pyproject.toml index 964b435b6db..f046b3ac1aa 100644 --- a/python/packages/anthropic/pyproject.toml +++ b/python/packages/anthropic/pyproject.toml @@ -4,7 +4,7 @@ description = "Anthropic integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/azure-ai-search/pyproject.toml b/python/packages/azure-ai-search/pyproject.toml index 537070161fe..ff656d4cea3 100644 --- a/python/packages/azure-ai-search/pyproject.toml +++ b/python/packages/azure-ai-search/pyproject.toml @@ -4,7 +4,7 @@ description = "Azure AI Search integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/azure-contentunderstanding/AGENTS.md b/python/packages/azure-contentunderstanding/AGENTS.md index 530a01643d6..fcc2cd6c9cb 100644 --- a/python/packages/azure-contentunderstanding/AGENTS.md +++ b/python/packages/azure-contentunderstanding/AGENTS.md @@ -56,13 +56,13 @@ into the Agent Framework as a context provider. It automatically analyzes file a | Sample | Description | |--------|-------------| -| `01_document_qa.py` | Upload a PDF via URL, ask questions about it | -| `02_multi_turn_session.py` | AgentSession persistence across turns | -| `03_multimodal_chat.py` | PDF + audio + video parallel analysis | -| `04_invoice_processing.py` | Structured field extraction with `prebuilt-invoice` analyzer | -| `05_large_doc_file_search.py` | CU extraction + OpenAI vector store RAG | -| `02-devui/01-multimodal_agent/` | DevUI web UI for CU-powered chat | -| `02-devui/02-file_search_agent/` | DevUI web UI combining CU + file_search RAG | +| `samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py` | Upload a PDF via URL, ask questions about it | +| `samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py` | AgentSession persistence across turns | +| `samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py` | PDF + audio + video parallel analysis | +| `samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py` | Structured field extraction with `prebuilt-invoice` analyzer | +| `samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py` | CU extraction + OpenAI vector store RAG | +| `samples/02-agents/devui/agent_content_understanding/` | DevUI web UI for CU-powered chat | +| `samples/02-agents/devui/agent_content_understanding_file_search_*/` | DevUI web UI combining CU + file_search RAG | ## Running Tests diff --git a/python/packages/azure-contentunderstanding/README.md b/python/packages/azure-contentunderstanding/README.md index b46975fee32..3d6cdde5582 100644 --- a/python/packages/azure-contentunderstanding/README.md +++ b/python/packages/azure-contentunderstanding/README.md @@ -31,14 +31,14 @@ The Azure Content Understanding integration provides a context provider that aut ### Basic Usage Example -See the [samples directory](samples/) which demonstrates: +See the [Azure Content Understanding samples](../../samples/02-agents/context_providers/azure_content_understanding/) which demonstrate: -- Single PDF upload and Q&A ([01_document_qa](samples/01-get-started/01_document_qa.py)) -- Multi-turn sessions with cached results ([02_multi_turn_session](samples/01-get-started/02_multi_turn_session.py)) -- PDF + audio + video parallel analysis ([03_multimodal_chat](samples/01-get-started/03_multimodal_chat.py)) -- Structured field extraction with prebuilt-invoice ([04_invoice_processing](samples/01-get-started/04_invoice_processing.py)) -- CU extraction + OpenAI vector store RAG ([05_large_doc_file_search](samples/01-get-started/05_large_doc_file_search.py)) -- Interactive web UI with DevUI ([02-devui](samples/02-devui/)) +- Single PDF upload and Q&A ([01_document_qa](../../samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py)) +- Multi-turn sessions with cached results ([02_multi_turn_session](../../samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py)) +- PDF + audio + video parallel analysis ([03_multimodal_chat](../../samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py)) +- Structured field extraction with prebuilt-invoice ([04_invoice_processing](../../samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py)) +- CU extraction + OpenAI vector store RAG ([05_large_doc_file_search](../../samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py)) +- Interactive web UI with DevUI ([DevUI samples](../../samples/02-agents/devui/README.md)) ```python import asyncio @@ -122,6 +122,6 @@ You also need to be logged in with `az login` (for `AzureCliCredential`). ### Next steps -- Explore the [samples directory](samples/) for complete code examples +- Explore the [Azure Content Understanding samples](../../samples/02-agents/context_providers/azure_content_understanding/) for complete code examples - Read the [Azure Content Understanding documentation](https://learn.microsoft.com/azure/ai-services/content-understanding/) for detailed service information - Learn more about the [Microsoft Agent Framework](https://aka.ms/agent-framework) diff --git a/python/packages/azure-contentunderstanding/pyproject.toml b/python/packages/azure-contentunderstanding/pyproject.toml index 4d2cf5a8a26..cb6b86d4058 100644 --- a/python/packages/azure-contentunderstanding/pyproject.toml +++ b/python/packages/azure-contentunderstanding/pyproject.toml @@ -4,7 +4,7 @@ description = "Azure Content Understanding integration for Microsoft Agent Frame authors = [{ name = "Microsoft", email = "af-support@microsoft.com" }] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260618" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta urls.issues = "https://github.com/microsoft/agent-framework/issues" classifiers = [ "License :: OSI Approved :: MIT License", - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", diff --git a/python/packages/azure-contentunderstanding/samples/README.md b/python/packages/azure-contentunderstanding/samples/README.md deleted file mode 100644 index 0f4460e3f4b..00000000000 --- a/python/packages/azure-contentunderstanding/samples/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Azure Content Understanding Samples - -These samples demonstrate how to use the `agent-framework-azure-contentunderstanding` package to add document, image, audio, and video understanding to your agents. - -## Prerequisites - -1. Azure CLI logged in: `az login` -2. Environment variables set (or `.env` file in the `python/` directory): - ``` - FOUNDRY_PROJECT_ENDPOINT=https://your-project.services.ai.azure.com - FOUNDRY_MODEL=gpt-4.1 - AZURE_CONTENTUNDERSTANDING_ENDPOINT=https://your-cu-resource.cognitiveservices.azure.com/ - ``` - -## Samples - -### 01-get-started — Script samples (easy → advanced) - -| # | Sample | Description | Run | -|---|--------|-------------|-----| -| 01 | [Document Q&A](01-get-started/01_document_qa.py) | Upload a PDF, ask questions with CU-powered extraction | `uv run samples/01-get-started/01_document_qa.py` | -| 02 | [Multi-Turn Session](01-get-started/02_multi_turn_session.py) | AgentSession persistence across turns | `uv run samples/01-get-started/02_multi_turn_session.py` | -| 03 | [Multi-Modal Chat](01-get-started/03_multimodal_chat.py) | PDF + audio + video parallel analysis | `uv run samples/01-get-started/03_multimodal_chat.py` | -| 04 | [Invoice Processing](01-get-started/04_invoice_processing.py) | Structured field extraction with prebuilt-invoice | `uv run samples/01-get-started/04_invoice_processing.py` | -| 05 | [Large Doc + file_search](01-get-started/05_large_doc_file_search.py) | CU extraction + OpenAI vector store RAG | `uv run samples/01-get-started/05_large_doc_file_search.py` | - -### 02-devui — Interactive web UI samples - -| # | Sample | Description | Run | -|---|--------|-------------|-----| -| 01 | [Multi-Modal Agent](02-devui/01-multimodal_agent/) | Web UI for file upload + CU-powered chat | `devui samples/02-devui/01-multimodal_agent` | -| 02a | [file_search (Azure OpenAI backend)](02-devui/02-file_search_agent/azure_openai_backend/) | DevUI with CU + Azure OpenAI vector store | `devui samples/02-devui/02-file_search_agent/azure_openai_backend` | -| 02b | [file_search (Foundry backend)](02-devui/02-file_search_agent/foundry_backend/) | DevUI with CU + Foundry vector store | `devui samples/02-devui/02-file_search_agent/foundry_backend` | - -## Install (preview) - -```bash -pip install --pre agent-framework-azure-contentunderstanding -``` diff --git a/python/packages/azure-cosmos-memory/pyproject.toml b/python/packages/azure-cosmos-memory/pyproject.toml index 2765d346fb6..32a8c5fe561 100644 --- a/python/packages/azure-cosmos-memory/pyproject.toml +++ b/python/packages/azure-cosmos-memory/pyproject.toml @@ -4,7 +4,7 @@ description = "Azure Cosmos DB Agent Memory Toolkit integration for Microsoft Ag authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.11" -version = "1.0.0a260709" +version = "1.0.0a260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/azure-cosmos/pyproject.toml b/python/packages/azure-cosmos/pyproject.toml index 9df8951fc96..a8c2465897b 100644 --- a/python/packages/azure-cosmos/pyproject.toml +++ b/python/packages/azure-cosmos/pyproject.toml @@ -4,7 +4,7 @@ description = "Azure Cosmos DB history provider integration for Microsoft Agent authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260521" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/azurefunctions/pyproject.toml b/python/packages/azurefunctions/pyproject.toml index ebd2ba7978e..1aa71c7a177 100644 --- a/python/packages/azurefunctions/pyproject.toml +++ b/python/packages/azurefunctions/pyproject.toml @@ -4,7 +4,7 @@ description = "Azure Functions integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -23,7 +23,7 @@ classifiers = [ ] dependencies = [ "agent-framework-core>=1.11.0,<2", - "agent-framework-durabletask>=1.0.0b260709,<2", + "agent-framework-durabletask>=1.0.0b260721,<2", "azure-functions>=1.24.0,<2", "azure-functions-durable>=1.3.1,<2", ] diff --git a/python/packages/bedrock/pyproject.toml b/python/packages/bedrock/pyproject.toml index 569581645d2..45cc9dbc914 100644 --- a/python/packages/bedrock/pyproject.toml +++ b/python/packages/bedrock/pyproject.toml @@ -4,7 +4,7 @@ description = "Amazon Bedrock integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/chatkit/pyproject.toml b/python/packages/chatkit/pyproject.toml index bae8991fcf8..14375be9879 100644 --- a/python/packages/chatkit/pyproject.toml +++ b/python/packages/chatkit/pyproject.toml @@ -4,7 +4,7 @@ description = "OpenAI ChatKit integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260528" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/claude/pyproject.toml b/python/packages/claude/pyproject.toml index 8cb5e8ed414..30d51acb1e9 100644 --- a/python/packages/claude/pyproject.toml +++ b/python/packages/claude/pyproject.toml @@ -4,7 +4,7 @@ description = "Claude Agent SDK integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/copilotstudio/pyproject.toml b/python/packages/copilotstudio/pyproject.toml index dd76156cb9f..0954949cce2 100644 --- a/python/packages/copilotstudio/pyproject.toml +++ b/python/packages/copilotstudio/pyproject.toml @@ -4,7 +4,7 @@ description = "Copilot Studio integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/core/agent_framework/foundry/__init__.py b/python/packages/core/agent_framework/foundry/__init__.py index 06bd4df17e5..c49b042567f 100644 --- a/python/packages/core/agent_framework/foundry/__init__.py +++ b/python/packages/core/agent_framework/foundry/__init__.py @@ -6,6 +6,7 @@ - ``agent-framework-anthropic`` - ``agent-framework-azure-contentunderstanding`` - ``agent-framework-foundry`` +- ``agent-framework-foundry-hosting`` - ``agent-framework-foundry-local`` """ @@ -31,6 +32,7 @@ "FoundryEmbeddingSettings": ("agent_framework_foundry", "agent-framework-foundry"), "FoundryEvals": ("agent_framework_foundry", "agent-framework-foundry"), "FoundryMemoryProvider": ("agent_framework_foundry", "agent-framework-foundry"), + "FoundryToolbox": ("agent_framework_foundry_hosting", "agent-framework-foundry-hosting"), "FoundryLocalChatOptions": ("agent_framework_foundry_local", "agent-framework-foundry-local"), "FoundryLocalClient": ("agent_framework_foundry_local", "agent-framework-foundry-local"), "FoundryLocalSettings": ("agent_framework_foundry_local", "agent-framework-foundry-local"), @@ -40,6 +42,8 @@ "RawFoundryAgentChatClient": ("agent_framework_foundry", "agent-framework-foundry"), "RawFoundryChatClient": ("agent_framework_foundry", "agent-framework-foundry"), "RawFoundryEmbeddingClient": ("agent_framework_foundry", "agent-framework-foundry"), + "InvocationsHostServer": ("agent_framework_foundry_hosting", "agent-framework-foundry-hosting"), + "ResponsesHostServer": ("agent_framework_foundry_hosting", "agent-framework-foundry-hosting"), "evaluate_foundry_target": ("agent_framework_foundry", "agent-framework-foundry"), "evaluate_traces": ("agent_framework_foundry", "agent-framework-foundry"), "to_prompt_agent": ("agent_framework_foundry", "agent-framework-foundry"), diff --git a/python/packages/core/agent_framework/foundry/__init__.pyi b/python/packages/core/agent_framework/foundry/__init__.pyi index 87972e69fcf..8413e538643 100644 --- a/python/packages/core/agent_framework/foundry/__init__.pyi +++ b/python/packages/core/agent_framework/foundry/__init__.pyi @@ -29,6 +29,7 @@ from agent_framework_foundry import ( evaluate_traces, to_prompt_agent, ) +from agent_framework_foundry_hosting import FoundryToolbox, InvocationsHostServer, ResponsesHostServer from agent_framework_foundry_local import ( FoundryLocalChatOptions, FoundryLocalClient, @@ -53,12 +54,15 @@ __all__ = [ "FoundryLocalClient", "FoundryLocalSettings", "FoundryMemoryProvider", + "FoundryToolbox", "GeneratedEvaluatorRef", + "InvocationsHostServer", "RawAnthropicFoundryClient", "RawFoundryAgent", "RawFoundryAgentChatClient", "RawFoundryChatClient", "RawFoundryEmbeddingClient", + "ResponsesHostServer", "evaluate_foundry_target", "evaluate_traces", "to_prompt_agent", diff --git a/python/packages/core/agent_framework/gemini/__init__.py b/python/packages/core/agent_framework/gemini/__init__.py new file mode 100644 index 00000000000..43673773599 --- /dev/null +++ b/python/packages/core/agent_framework/gemini/__init__.py @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft. All rights reserved. + +"""Google Gemini namespace for optional Agent Framework connectors. + +This module lazily re-exports objects from ``agent-framework-gemini``. +""" + +import importlib +from typing import Any + +_IMPORTS: dict[str, tuple[str, str]] = { + "GeminiChatClient": ("agent_framework_gemini", "agent-framework-gemini"), + "GeminiChatOptions": ("agent_framework_gemini", "agent-framework-gemini"), + "GeminiSettings": ("agent_framework_gemini", "agent-framework-gemini"), + "GoogleGeminiSettings": ("agent_framework_gemini", "agent-framework-gemini"), + "RawGeminiChatClient": ("agent_framework_gemini", "agent-framework-gemini"), + "ThinkingConfig": ("agent_framework_gemini", "agent-framework-gemini"), +} + + +def __getattr__(name: str) -> Any: + if name in _IMPORTS: + import_path, package_name = _IMPORTS[name] + try: + return getattr(importlib.import_module(import_path), name) + except ModuleNotFoundError as exc: + raise ModuleNotFoundError( + f"The package {package_name} is required to use `{name}`. " + f"Please use `pip install {package_name}`, or update your requirements.txt or pyproject.toml file." + ) from exc + raise AttributeError(f"Module `gemini` has no attribute {name}.") + + +def __dir__() -> list[str]: + return list(_IMPORTS.keys()) diff --git a/python/packages/core/agent_framework/gemini/__init__.pyi b/python/packages/core/agent_framework/gemini/__init__.pyi new file mode 100644 index 00000000000..c9082c9191a --- /dev/null +++ b/python/packages/core/agent_framework/gemini/__init__.pyi @@ -0,0 +1,19 @@ +# Copyright (c) Microsoft. All rights reserved. + +from agent_framework_gemini import ( + GeminiChatClient, + GeminiChatOptions, + GeminiSettings, + GoogleGeminiSettings, + RawGeminiChatClient, + ThinkingConfig, +) + +__all__ = [ + "GeminiChatClient", + "GeminiChatOptions", + "GeminiSettings", + "GoogleGeminiSettings", + "RawGeminiChatClient", + "ThinkingConfig", +] diff --git a/python/packages/core/agent_framework/mistral/__init__.py b/python/packages/core/agent_framework/mistral/__init__.py new file mode 100644 index 00000000000..c4d742a75f1 --- /dev/null +++ b/python/packages/core/agent_framework/mistral/__init__.py @@ -0,0 +1,32 @@ +# Copyright (c) Microsoft. All rights reserved. + +"""Mistral AI namespace for optional Agent Framework connectors. + +This module lazily re-exports objects from ``agent-framework-mistral``. +""" + +import importlib +from typing import Any + +_IMPORTS: dict[str, tuple[str, str]] = { + "MistralEmbeddingClient": ("agent_framework_mistral", "agent-framework-mistral"), + "MistralEmbeddingOptions": ("agent_framework_mistral", "agent-framework-mistral"), + "MistralEmbeddingSettings": ("agent_framework_mistral", "agent-framework-mistral"), +} + + +def __getattr__(name: str) -> Any: + if name in _IMPORTS: + import_path, package_name = _IMPORTS[name] + try: + return getattr(importlib.import_module(import_path), name) + except ModuleNotFoundError as exc: + raise ModuleNotFoundError( + f"The package {package_name} is required to use `{name}`. " + f"Please use `pip install {package_name}`, or update your requirements.txt or pyproject.toml file." + ) from exc + raise AttributeError(f"Module `mistral` has no attribute {name}.") + + +def __dir__() -> list[str]: + return list(_IMPORTS.keys()) diff --git a/python/packages/core/agent_framework/mistral/__init__.pyi b/python/packages/core/agent_framework/mistral/__init__.pyi new file mode 100644 index 00000000000..0868d21e02d --- /dev/null +++ b/python/packages/core/agent_framework/mistral/__init__.pyi @@ -0,0 +1,9 @@ +# Copyright (c) Microsoft. All rights reserved. + +from agent_framework_mistral import MistralEmbeddingClient, MistralEmbeddingOptions, MistralEmbeddingSettings + +__all__ = [ + "MistralEmbeddingClient", + "MistralEmbeddingOptions", + "MistralEmbeddingSettings", +] diff --git a/python/packages/core/agent_framework/monty/__init__.py b/python/packages/core/agent_framework/monty/__init__.py new file mode 100644 index 00000000000..53640f45c98 --- /dev/null +++ b/python/packages/core/agent_framework/monty/__init__.py @@ -0,0 +1,34 @@ +# Copyright (c) Microsoft. All rights reserved. + +"""Monty CodeAct namespace for optional Agent Framework connectors. + +This module lazily re-exports objects from ``agent-framework-monty``. +""" + +import importlib +from typing import Any + +_IMPORTS: dict[str, tuple[str, str]] = { + "FileMount": ("agent_framework_monty", "agent-framework-monty"), + "FileMountInput": ("agent_framework_monty", "agent-framework-monty"), + "MontyCodeActProvider": ("agent_framework_monty", "agent-framework-monty"), + "MontyExecuteCodeTool": ("agent_framework_monty", "agent-framework-monty"), + "MountMode": ("agent_framework_monty", "agent-framework-monty"), +} + + +def __getattr__(name: str) -> Any: + if name in _IMPORTS: + import_path, package_name = _IMPORTS[name] + try: + return getattr(importlib.import_module(import_path), name) + except ModuleNotFoundError as exc: + raise ModuleNotFoundError( + f"The package {package_name} is required to use `{name}`. " + f"Please use `pip install {package_name}`, or update your requirements.txt or pyproject.toml file." + ) from exc + raise AttributeError(f"Module `monty` has no attribute {name}.") + + +def __dir__() -> list[str]: + return list(_IMPORTS.keys()) diff --git a/python/packages/core/agent_framework/monty/__init__.pyi b/python/packages/core/agent_framework/monty/__init__.pyi new file mode 100644 index 00000000000..ac31cae8560 --- /dev/null +++ b/python/packages/core/agent_framework/monty/__init__.pyi @@ -0,0 +1,17 @@ +# Copyright (c) Microsoft. All rights reserved. + +from agent_framework_monty import ( + FileMount, + FileMountInput, + MontyCodeActProvider, + MontyExecuteCodeTool, + MountMode, +) + +__all__ = [ + "FileMount", + "FileMountInput", + "MontyCodeActProvider", + "MontyExecuteCodeTool", + "MountMode", +] diff --git a/python/packages/core/agent_framework/tools/__init__.py b/python/packages/core/agent_framework/tools/__init__.py new file mode 100644 index 00000000000..b92a0865ef9 --- /dev/null +++ b/python/packages/core/agent_framework/tools/__init__.py @@ -0,0 +1,48 @@ +# Copyright (c) Microsoft. All rights reserved. + +"""Built-in tools namespace for optional Agent Framework connectors. + +This module lazily re-exports objects from ``agent-framework-tools``. +""" + +import importlib +from typing import Any + +_IMPORTS: dict[str, tuple[str, str]] = { + "DOCKER_DEFAULT_IMAGE": ("agent_framework_tools.shell", "agent-framework-tools"), + "DockerNotAvailableError": ("agent_framework_tools.shell", "agent-framework-tools"), + "DockerShellTool": ("agent_framework_tools.shell", "agent-framework-tools"), + "LocalShellTool": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellCommandError": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellDecision": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellEnvironmentProvider": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellEnvironmentProviderOptions": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellEnvironmentSnapshot": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellExecutionError": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellExecutor": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellFamily": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellMode": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellPolicy": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellRequest": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellResult": ("agent_framework_tools.shell", "agent-framework-tools"), + "ShellTimeoutError": ("agent_framework_tools.shell", "agent-framework-tools"), + "default_instructions_formatter": ("agent_framework_tools.shell", "agent-framework-tools"), + "is_docker_available": ("agent_framework_tools.shell", "agent-framework-tools"), +} + + +def __getattr__(name: str) -> Any: + if name in _IMPORTS: + import_path, package_name = _IMPORTS[name] + try: + return getattr(importlib.import_module(import_path), name) + except ModuleNotFoundError as exc: + raise ModuleNotFoundError( + f"The package {package_name} is required to use `{name}`. " + f"Please use `pip install {package_name}`, or update your requirements.txt or pyproject.toml file." + ) from exc + raise AttributeError(f"Module `tools` has no attribute {name}.") + + +def __dir__() -> list[str]: + return list(_IMPORTS.keys()) diff --git a/python/packages/core/agent_framework/tools/__init__.pyi b/python/packages/core/agent_framework/tools/__init__.pyi new file mode 100644 index 00000000000..a1768b3b60d --- /dev/null +++ b/python/packages/core/agent_framework/tools/__init__.pyi @@ -0,0 +1,45 @@ +# Copyright (c) Microsoft. All rights reserved. + +from agent_framework_tools.shell import ( + DOCKER_DEFAULT_IMAGE, + DockerNotAvailableError, + DockerShellTool, + LocalShellTool, + ShellCommandError, + ShellDecision, + ShellEnvironmentProvider, + ShellEnvironmentProviderOptions, + ShellEnvironmentSnapshot, + ShellExecutionError, + ShellExecutor, + ShellFamily, + ShellMode, + ShellPolicy, + ShellRequest, + ShellResult, + ShellTimeoutError, + default_instructions_formatter, + is_docker_available, +) + +__all__ = [ + "DOCKER_DEFAULT_IMAGE", + "DockerNotAvailableError", + "DockerShellTool", + "LocalShellTool", + "ShellCommandError", + "ShellDecision", + "ShellEnvironmentProvider", + "ShellEnvironmentProviderOptions", + "ShellEnvironmentSnapshot", + "ShellExecutionError", + "ShellExecutor", + "ShellFamily", + "ShellMode", + "ShellPolicy", + "ShellRequest", + "ShellResult", + "ShellTimeoutError", + "default_instructions_formatter", + "is_docker_available", +] diff --git a/python/packages/core/pyproject.toml b/python/packages/core/pyproject.toml index 51c194cd884..50b97d4ef11 100644 --- a/python/packages/core/pyproject.toml +++ b/python/packages/core/pyproject.toml @@ -4,7 +4,7 @@ description = "Microsoft Agent Framework for building AI Agents with Python. Thi authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.11.0" +version = "1.12.0" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -36,6 +36,7 @@ all = [ "agent-framework-ag-ui", "agent-framework-anthropic", "agent-framework-azure-ai-search", + "agent-framework-azure-contentunderstanding", "agent-framework-azure-cosmos", "agent-framework-azurefunctions", "agent-framework-bedrock", @@ -46,24 +47,27 @@ all = [ "agent-framework-devui", "agent-framework-durabletask", "agent-framework-foundry", + "agent-framework-foundry-hosting", "agent-framework-foundry-local", + "agent-framework-gemini", "agent-framework-github-copilot; python_version >= '3.11'", "agent-framework-hyperlight; ((sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine == 'AMD64')) and python_version < '3.14'", "agent-framework-lab", "agent-framework-mem0", + "agent-framework-mistral", + "agent-framework-monty", "agent-framework-ollama", "agent-framework-openai", "agent-framework-orchestrations", "agent-framework-purview", "agent-framework-redis", + "agent-framework-tools", ] [dependency-groups] # These optional integrations depend on agent-framework-core, so core cannot list them as # runtime dependencies. They are declared here so isolated source checks can resolve their APIs. dev = [ - "agent-framework-azure-contentunderstanding", - "agent-framework-tools", "azure-ai-agentserver-core>=2.0.0b7,<3", ] diff --git a/python/packages/core/tests/core/test_foundry_namespace.py b/python/packages/core/tests/core/test_foundry_namespace.py index 70db21d4066..faadc99239a 100644 --- a/python/packages/core/tests/core/test_foundry_namespace.py +++ b/python/packages/core/tests/core/test_foundry_namespace.py @@ -2,6 +2,7 @@ import pytest from agent_framework_foundry import FoundryChatClient, FoundryMemoryProvider +from agent_framework_foundry_hosting import ResponsesHostServer from agent_framework_foundry_local import FoundryLocalClient import agent_framework.azure as azure @@ -11,9 +12,11 @@ def test_foundry_namespace_exposes_cloud_and_local_symbols() -> None: assert foundry.FoundryChatClient is FoundryChatClient assert foundry.FoundryMemoryProvider is FoundryMemoryProvider + assert foundry.ResponsesHostServer is ResponsesHostServer assert foundry.FoundryLocalClient is FoundryLocalClient assert "FoundryChatClient" in dir(foundry) assert "FoundryLocalClient" in dir(foundry) + assert "ResponsesHostServer" in dir(foundry) def test_azure_namespace_no_longer_exposes_foundry_symbols() -> None: diff --git a/python/packages/core/tests/core/test_gemini_namespace.py b/python/packages/core/tests/core/test_gemini_namespace.py new file mode 100644 index 00000000000..a59c7bd0e3c --- /dev/null +++ b/python/packages/core/tests/core/test_gemini_namespace.py @@ -0,0 +1,42 @@ +# Copyright (c) Microsoft. All rights reserved. + +import sys +from types import ModuleType + +import pytest + +import agent_framework.gemini as gemini + + +def test_gemini_namespace_dir_lists_lazy_exports() -> None: + names = dir(gemini) + for expected in ( + "GeminiChatClient", + "GeminiChatOptions", + "GeminiSettings", + "GoogleGeminiSettings", + "RawGeminiChatClient", + "ThinkingConfig", + ): + assert expected in names + + +def test_gemini_namespace_lazy_loads_known_attribute(monkeypatch: pytest.MonkeyPatch) -> None: + sentinel = object() + fake_module = ModuleType("agent_framework_gemini") + fake_module.GeminiChatClient = sentinel # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + monkeypatch.setitem(sys.modules, "agent_framework_gemini", fake_module) + + assert gemini.GeminiChatClient is sentinel + + +def test_gemini_namespace_unknown_attribute_raises_attribute_error() -> None: + with pytest.raises(AttributeError, match="Module `gemini` has no attribute DoesNotExist."): + _ = gemini.DoesNotExist # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + + +def test_gemini_namespace_missing_package_raises_helpful_error(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setitem(sys.modules, "agent_framework_gemini", None) + + with pytest.raises(ModuleNotFoundError, match="agent-framework-gemini"): + _ = gemini.GeminiChatClient diff --git a/python/packages/core/tests/core/test_mistral_namespace.py b/python/packages/core/tests/core/test_mistral_namespace.py new file mode 100644 index 00000000000..1f6cbb5a6cb --- /dev/null +++ b/python/packages/core/tests/core/test_mistral_namespace.py @@ -0,0 +1,39 @@ +# Copyright (c) Microsoft. All rights reserved. + +import sys +from types import ModuleType + +import pytest + +import agent_framework.mistral as mistral + + +def test_mistral_namespace_dir_lists_lazy_exports() -> None: + names = dir(mistral) + for expected in ( + "MistralEmbeddingClient", + "MistralEmbeddingOptions", + "MistralEmbeddingSettings", + ): + assert expected in names + + +def test_mistral_namespace_lazy_loads_known_attribute(monkeypatch: pytest.MonkeyPatch) -> None: + sentinel = object() + fake_module = ModuleType("agent_framework_mistral") + fake_module.MistralEmbeddingClient = sentinel # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + monkeypatch.setitem(sys.modules, "agent_framework_mistral", fake_module) + + assert mistral.MistralEmbeddingClient is sentinel + + +def test_mistral_namespace_unknown_attribute_raises_attribute_error() -> None: + with pytest.raises(AttributeError, match="Module `mistral` has no attribute DoesNotExist."): + _ = mistral.DoesNotExist # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + + +def test_mistral_namespace_missing_package_raises_helpful_error(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setitem(sys.modules, "agent_framework_mistral", None) + + with pytest.raises(ModuleNotFoundError, match="agent-framework-mistral"): + _ = mistral.MistralEmbeddingClient diff --git a/python/packages/core/tests/core/test_monty_namespace.py b/python/packages/core/tests/core/test_monty_namespace.py new file mode 100644 index 00000000000..364b59fd7bc --- /dev/null +++ b/python/packages/core/tests/core/test_monty_namespace.py @@ -0,0 +1,41 @@ +# Copyright (c) Microsoft. All rights reserved. + +import sys +from types import ModuleType + +import pytest + +import agent_framework.monty as monty + + +def test_monty_namespace_dir_lists_lazy_exports() -> None: + names = dir(monty) + for expected in ( + "FileMount", + "FileMountInput", + "MontyCodeActProvider", + "MontyExecuteCodeTool", + "MountMode", + ): + assert expected in names + + +def test_monty_namespace_lazy_loads_known_attribute(monkeypatch: pytest.MonkeyPatch) -> None: + sentinel = object() + fake_module = ModuleType("agent_framework_monty") + fake_module.MontyCodeActProvider = sentinel # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + monkeypatch.setitem(sys.modules, "agent_framework_monty", fake_module) + + assert monty.MontyCodeActProvider is sentinel + + +def test_monty_namespace_unknown_attribute_raises_attribute_error() -> None: + with pytest.raises(AttributeError, match="Module `monty` has no attribute DoesNotExist."): + _ = monty.DoesNotExist # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + + +def test_monty_namespace_missing_package_raises_helpful_error(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setitem(sys.modules, "agent_framework_monty", None) + + with pytest.raises(ModuleNotFoundError, match="agent-framework-monty"): + _ = monty.MontyCodeActProvider diff --git a/python/packages/core/tests/core/test_tools_namespace.py b/python/packages/core/tests/core/test_tools_namespace.py new file mode 100644 index 00000000000..1a2a5801c50 --- /dev/null +++ b/python/packages/core/tests/core/test_tools_namespace.py @@ -0,0 +1,42 @@ +# Copyright (c) Microsoft. All rights reserved. + +import sys +from types import ModuleType + +import pytest + +import agent_framework.tools as tools + + +def test_tools_namespace_dir_lists_lazy_exports() -> None: + names = dir(tools) + for expected in ( + "DockerShellTool", + "LocalShellTool", + "ShellEnvironmentProvider", + "ShellEnvironmentProviderOptions", + "ShellExecutor", + "ShellPolicy", + ): + assert expected in names + + +def test_tools_namespace_lazy_loads_known_attribute(monkeypatch: pytest.MonkeyPatch) -> None: + sentinel = object() + fake_module = ModuleType("agent_framework_tools.shell") + fake_module.LocalShellTool = sentinel # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + monkeypatch.setitem(sys.modules, "agent_framework_tools.shell", fake_module) + + assert tools.LocalShellTool is sentinel + + +def test_tools_namespace_unknown_attribute_raises_attribute_error() -> None: + with pytest.raises(AttributeError, match="Module `tools` has no attribute DoesNotExist."): + _ = tools.DoesNotExist # type: ignore[attr-defined] # ty: ignore[unresolved-attribute] + + +def test_tools_namespace_missing_package_raises_helpful_error(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setitem(sys.modules, "agent_framework_tools.shell", None) + + with pytest.raises(ModuleNotFoundError, match="agent-framework-tools"): + _ = tools.LocalShellTool diff --git a/python/packages/devui/pyproject.toml b/python/packages/devui/pyproject.toml index f1a293ed580..7e762c18cf1 100644 --- a/python/packages/devui/pyproject.toml +++ b/python/packages/devui/pyproject.toml @@ -4,7 +4,7 @@ description = "Debug UI for Microsoft Agent Framework with OpenAI-compatible API authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://github.com/microsoft/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -24,7 +24,7 @@ classifiers = [ ] dependencies = [ "agent-framework-core>=1.11.0,<2", - "openai>=1.99.0,<3", + "openai>=2.45.0,<3", "opentelemetry-sdk>=1.39.0,<2", "fastapi>=0.115.0,<0.138.1", "uvicorn[standard]>=0.30.0,<1" diff --git a/python/packages/durabletask/pyproject.toml b/python/packages/durabletask/pyproject.toml index 5a4b8d4ae13..064eef1aaa7 100644 --- a/python/packages/durabletask/pyproject.toml +++ b/python/packages/durabletask/pyproject.toml @@ -4,7 +4,7 @@ description = "Durable Task integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/foundry/pyproject.toml b/python/packages/foundry/pyproject.toml index 9e96bc65c14..6ce969c6cd1 100644 --- a/python/packages/foundry/pyproject.toml +++ b/python/packages/foundry/pyproject.toml @@ -4,7 +4,7 @@ description = "Microsoft Foundry integrations for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.10.1" +version = "1.10.2" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py b/python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py index a3848a75bed..4e13bc5c4b7 100644 --- a/python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py +++ b/python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py @@ -118,7 +118,7 @@ class FoundryToolbox(MCPStreamableHTTPTool): from agent_framework import Agent from agent_framework.foundry import FoundryChatClient - from agent_framework_foundry_hosting import FoundryToolbox, ResponsesHostServer + from agent_framework.foundry import FoundryToolbox, ResponsesHostServer from azure.identity import DefaultAzureCredential credential = DefaultAzureCredential() diff --git a/python/packages/foundry_hosting/pyproject.toml b/python/packages/foundry_hosting/pyproject.toml index ab597ec551f..87183bbf6a9 100644 --- a/python/packages/foundry_hosting/pyproject.toml +++ b/python/packages/foundry_hosting/pyproject.toml @@ -4,7 +4,7 @@ description = "Foundry Hosting integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta urls.issues = "https://github.com/microsoft/agent-framework/issues" classifiers = [ "License :: OSI Approved :: MIT License", - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", diff --git a/python/packages/foundry_local/pyproject.toml b/python/packages/foundry_local/pyproject.toml index 102cd958651..33dc3900d48 100644 --- a/python/packages/foundry_local/pyproject.toml +++ b/python/packages/foundry_local/pyproject.toml @@ -4,7 +4,7 @@ description = "Foundry Local integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260521" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/gemini/AGENTS.md b/python/packages/gemini/AGENTS.md index b87406b4602..633194061bf 100644 --- a/python/packages/gemini/AGENTS.md +++ b/python/packages/gemini/AGENTS.md @@ -29,7 +29,7 @@ Integration with Google's Gemini Developer API and Vertex AI via the `google-gen ```python from agent_framework import Content, Message -from agent_framework_gemini import GeminiChatClient +from agent_framework.gemini import GeminiChatClient client = GeminiChatClient(model="gemini-2.5-flash") response = await client.get_response([Message(role="user", contents=[Content.from_text("Hello")])]) diff --git a/python/packages/gemini/README.md b/python/packages/gemini/README.md index 1dc789098b0..ae38406b8b7 100644 --- a/python/packages/gemini/README.md +++ b/python/packages/gemini/README.md @@ -42,7 +42,7 @@ export GOOGLE_MODEL="gemini-2.5-flash-lite" ## Examples -See the [Google Gemini samples](samples/) for runnable end-to-end scripts covering: +See the [Google Gemini samples](../../samples/02-agents/providers/gemini/) for runnable end-to-end scripts covering: - Basic agent with tool calling and streaming - Extended thinking with `ThinkingConfig` diff --git a/python/packages/gemini/agent_framework_gemini/_chat_client.py b/python/packages/gemini/agent_framework_gemini/_chat_client.py index bfb4f67005c..5436ad50442 100644 --- a/python/packages/gemini/agent_framework_gemini/_chat_client.py +++ b/python/packages/gemini/agent_framework_gemini/_chat_client.py @@ -5,7 +5,7 @@ import json import logging import sys -from collections.abc import AsyncIterable, Awaitable, Mapping, Sequence +from collections.abc import AsyncIterable, Awaitable, Callable, Mapping, Sequence from typing import Any, ClassVar, Generic, cast from uuid import uuid4 @@ -538,9 +538,13 @@ def _inner_get_response( async def _stream() -> AsyncIterable[ChatResponseUpdate]: validated = await self._validate_options(options) model, contents, config = self._prepare_request(messages, validated) - async for chunk in await self._genai_client.aio.models.generate_content_stream( + generate_content_stream = cast( + Callable[..., Awaitable[AsyncIterable[types.GenerateContentResponse]]], + cast(Any, self._genai_client.aio.models).generate_content_stream, + ) + async for chunk in await generate_content_stream( model=model, - contents=contents, # pyright: ignore[reportArgumentType] + contents=contents, config=config, ): yield self._process_chunk(chunk) diff --git a/python/packages/gemini/pyproject.toml b/python/packages/gemini/pyproject.toml index dc067c83fa7..ae1520722e1 100644 --- a/python/packages/gemini/pyproject.toml +++ b/python/packages/gemini/pyproject.toml @@ -4,7 +4,7 @@ description = "Google Gemini integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta urls.issues = "https://github.com/microsoft/agent-framework/issues" classifiers = [ "License :: OSI Approved :: MIT License", - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "agent-framework-core>=1.11.0,<2", - "google-genai>=1.68.0,<3.0.0", + "google-genai>=1.69.0,<3.0.0", ] [tool.uv] diff --git a/python/packages/gemini/samples/__init__.py b/python/packages/gemini/samples/__init__.py deleted file mode 100644 index 2a50eae8941..00000000000 --- a/python/packages/gemini/samples/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Copyright (c) Microsoft. All rights reserved. diff --git a/python/packages/github_copilot/pyproject.toml b/python/packages/github_copilot/pyproject.toml index c5355d07534..c57564a845c 100644 --- a/python/packages/github_copilot/pyproject.toml +++ b/python/packages/github_copilot/pyproject.toml @@ -4,7 +4,7 @@ description = "GitHub Copilot integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0rc3" +version = "1.0.0rc4" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/hosting-a2a/pyproject.toml b/python/packages/hosting-a2a/pyproject.toml index 18cc956cab6..69f49b1ab0d 100644 --- a/python/packages/hosting-a2a/pyproject.toml +++ b/python/packages/hosting-a2a/pyproject.toml @@ -4,7 +4,7 @@ description = "A2A conversion helpers for app-owned Agent Framework hosting." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260710" +version = "1.0.0a260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -25,7 +25,7 @@ classifiers = [ dependencies = [ "a2a-sdk>=1.0.0,<2", "agent-framework-core>=1.11.0,<2", - "agent-framework-hosting==1.0.0a260709", + "agent-framework-hosting==1.0.0a260721", ] [tool.uv] diff --git a/python/packages/hosting-mcp/pyproject.toml b/python/packages/hosting-mcp/pyproject.toml index bea0efb7b65..1374951e983 100644 --- a/python/packages/hosting-mcp/pyproject.toml +++ b/python/packages/hosting-mcp/pyproject.toml @@ -4,7 +4,7 @@ description = "Agent and workflow MCP tool adapters for app-owned hosting." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260720" +version = "1.0.0a260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -24,7 +24,7 @@ classifiers = [ ] dependencies = [ "agent-framework-core>=1.11.0,<2", - "agent-framework-hosting==1.0.0a260709", + "agent-framework-hosting==1.0.0a260721", "mcp>=1.11.0,<2", "pydantic>=2,<3", ] diff --git a/python/packages/hosting-responses/pyproject.toml b/python/packages/hosting-responses/pyproject.toml index 64fdedd4b4f..d9a1cf06a66 100644 --- a/python/packages/hosting-responses/pyproject.toml +++ b/python/packages/hosting-responses/pyproject.toml @@ -4,7 +4,7 @@ description = "OpenAI Responses-shaped helpers for agent-framework-hosting." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0a260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -24,7 +24,7 @@ classifiers = [ ] dependencies = [ "agent-framework-core>=1.11.0,<2", - "agent-framework-hosting==1.0.0a260709", + "agent-framework-hosting==1.0.0a260721", "openai>=1.99.0,<3", ] diff --git a/python/packages/hosting-telegram/pyproject.toml b/python/packages/hosting-telegram/pyproject.toml index 3c0584da3cd..89e3bfd7a77 100644 --- a/python/packages/hosting-telegram/pyproject.toml +++ b/python/packages/hosting-telegram/pyproject.toml @@ -4,7 +4,7 @@ description = "Telegram Bot API-shaped helpers for agent-framework-hosting." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0a260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -24,7 +24,7 @@ classifiers = [ ] dependencies = [ "agent-framework-core>=1.11.0,<2", - "agent-framework-hosting==1.0.0a260709", + "agent-framework-hosting==1.0.0a260721", ] [tool.uv] diff --git a/python/packages/hosting/pyproject.toml b/python/packages/hosting/pyproject.toml index c1272781e41..479a7c2af6b 100644 --- a/python/packages/hosting/pyproject.toml +++ b/python/packages/hosting/pyproject.toml @@ -4,7 +4,7 @@ description = "Execution-state helpers for app-owned Agent Framework hosting rou authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0a260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/hyperlight/pyproject.toml b/python/packages/hyperlight/pyproject.toml index 1b137ac91bc..2985bd8dc6d 100644 --- a/python/packages/hyperlight/pyproject.toml +++ b/python/packages/hyperlight/pyproject.toml @@ -4,7 +4,7 @@ description = "Hyperlight CodeAct integrations for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/lab/pyproject.toml b/python/packages/lab/pyproject.toml index ce47cdcb309..10d27e4774d 100644 --- a/python/packages/lab/pyproject.toml +++ b/python/packages/lab/pyproject.toml @@ -4,7 +4,7 @@ description = "Experimental modules for Microsoft Agent Framework" authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/mem0/pyproject.toml b/python/packages/mem0/pyproject.toml index 406a524337a..9fd1a1f983c 100644 --- a/python/packages/mem0/pyproject.toml +++ b/python/packages/mem0/pyproject.toml @@ -4,7 +4,7 @@ description = "Mem0 integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/mistral/AGENTS.md b/python/packages/mistral/AGENTS.md index 267c6e70241..6edd27d6ac6 100644 --- a/python/packages/mistral/AGENTS.md +++ b/python/packages/mistral/AGENTS.md @@ -11,7 +11,7 @@ Integration with Mistral AI for embedding generation. ## Usage ```python -from agent_framework_mistral import MistralEmbeddingClient +from agent_framework.mistral import MistralEmbeddingClient # Requires MISTRAL_API_KEY environment variable (or pass api_key= directly) client = MistralEmbeddingClient(model="mistral-embed") @@ -22,5 +22,5 @@ print(result[0].vector) ## Import Path ```python -from agent_framework_mistral import MistralEmbeddingClient +from agent_framework.mistral import MistralEmbeddingClient ``` diff --git a/python/packages/mistral/README.md b/python/packages/mistral/README.md index 41460dd8909..0912bd421d1 100644 --- a/python/packages/mistral/README.md +++ b/python/packages/mistral/README.md @@ -8,6 +8,8 @@ pip install agent-framework-mistral --pre and see the [README](https://github.com/microsoft/agent-framework/tree/main/python/README.md) for more information. +See the [Mistral embedding sample](../../samples/02-agents/providers/mistral/mistral_embeddings.py) for a runnable example. + ## Embedding Client The `MistralEmbeddingClient` provides embedding generation using Mistral AI models. @@ -15,7 +17,7 @@ The `MistralEmbeddingClient` provides embedding generation using Mistral AI mode ### Quick Start ```python -from agent_framework_mistral import MistralEmbeddingClient +from agent_framework.mistral import MistralEmbeddingClient # Using environment variables (MISTRAL_API_KEY, MISTRAL_EMBEDDING_MODEL) client = MistralEmbeddingClient() diff --git a/python/packages/mistral/pyproject.toml b/python/packages/mistral/pyproject.toml index 359b635335c..a398f5249bb 100644 --- a/python/packages/mistral/pyproject.toml +++ b/python/packages/mistral/pyproject.toml @@ -4,7 +4,7 @@ description = "Mistral AI integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://learn.microsoft.com/en-us/agent-framework/" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta urls.issues = "https://github.com/microsoft/agent-framework/issues" classifiers = [ "License :: OSI Approved :: MIT License", - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", diff --git a/python/packages/mistral/samples/__init__.py b/python/packages/mistral/samples/__init__.py deleted file mode 100644 index 2a50eae8941..00000000000 --- a/python/packages/mistral/samples/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Copyright (c) Microsoft. All rights reserved. diff --git a/python/packages/monty/AGENTS.md b/python/packages/monty/AGENTS.md index b8466af8c11..0f8ffe479dc 100644 --- a/python/packages/monty/AGENTS.md +++ b/python/packages/monty/AGENTS.md @@ -3,8 +3,8 @@ Monty-backed CodeAct integrations for the Microsoft Agent Framework. > [!NOTE] -> **Alpha package.** Not part of `agent-framework[all]` yet. Install explicitly -> with `pip install agent-framework-monty --pre`. +> **Beta package.** Included in `agent-framework[all]` and available through +> the lazy-loading namespace `agent_framework.monty`. ## Core Classes @@ -19,7 +19,7 @@ Monty-backed CodeAct integrations for the Microsoft Agent Framework. ## Public API ```python -from agent_framework_monty import ( +from agent_framework.monty import ( FileMount, FileMountInput, MontyCodeActProvider, diff --git a/python/packages/monty/README.md b/python/packages/monty/README.md index 83d1ae79d17..980182e61f3 100644 --- a/python/packages/monty/README.md +++ b/python/packages/monty/README.md @@ -3,8 +3,8 @@ Monty-backed CodeAct integrations for Microsoft Agent Framework. > [!WARNING] -> This package is in **alpha**. APIs may change without notice. It is not part of -> `agent-framework[all]` yet; install it explicitly with `--pre`. +> This package is in **beta**. APIs may change before its stable release. It is +> included in `agent-framework[all]`. ## Installation @@ -28,7 +28,7 @@ available inside the Monty interpreter as **typed async functions** (e.g. ```python from agent_framework import Agent, tool -from agent_framework_monty import MontyCodeActProvider +from agent_framework.monty import MontyCodeActProvider @tool @@ -61,7 +61,7 @@ tools on the same agent). ```python from agent_framework import Agent, tool -from agent_framework_monty import MontyExecuteCodeTool +from agent_framework.monty import MontyExecuteCodeTool @tool @@ -110,7 +110,7 @@ agent = Agent( Mount host directories into the sandbox and cap execution resources: ```python -from agent_framework_monty import FileMount, MontyCodeActProvider +from agent_framework.monty import FileMount, MontyCodeActProvider codeact = MontyCodeActProvider( tools=[compute], @@ -174,6 +174,5 @@ Available primitives: - Code is type-checked against tool signatures via [ty](https://docs.astral.sh/ty/) before execution, so wrong argument types surface as a clear error before any host tool runs. -- The alpha package is **not** part of `agent-framework[all]` yet, so it must - be installed explicitly. Once promoted to beta it will be reachable via the - lazy-loading namespace `agent_framework.monty`. +- The beta package is part of `agent-framework[all]` and is reachable through + the lazy-loading namespace `agent_framework.monty`. diff --git a/python/packages/monty/pyproject.toml b/python/packages/monty/pyproject.toml index 50179293fd0..29109cc48b4 100644 --- a/python/packages/monty/pyproject.toml +++ b/python/packages/monty/pyproject.toml @@ -4,7 +4,7 @@ description = "Monty CodeAct integrations for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta urls.issues = "https://github.com/microsoft/agent-framework/issues" classifiers = [ "License :: OSI Approved :: MIT License", - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", diff --git a/python/packages/ollama/pyproject.toml b/python/packages/ollama/pyproject.toml index 57ec5fcc612..654d64ec752 100644 --- a/python/packages/ollama/pyproject.toml +++ b/python/packages/ollama/pyproject.toml @@ -4,7 +4,7 @@ description = "Ollama integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://learn.microsoft.com/en-us/agent-framework/" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/openai/pyproject.toml b/python/packages/openai/pyproject.toml index be5ece61e0d..63f4b925d50 100644 --- a/python/packages/openai/pyproject.toml +++ b/python/packages/openai/pyproject.toml @@ -4,7 +4,7 @@ description = "OpenAI integrations for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.10.1" +version = "1.10.2" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/orchestrations/pyproject.toml b/python/packages/orchestrations/pyproject.toml index d579532cc23..44998f0743e 100644 --- a/python/packages/orchestrations/pyproject.toml +++ b/python/packages/orchestrations/pyproject.toml @@ -4,7 +4,7 @@ description = "Orchestration patterns for Microsoft Agent Framework. Includes Se authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0" +version = "1.0.1" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/purview/pyproject.toml b/python/packages/purview/pyproject.toml index d2b121ef318..6cbf79e18b6 100644 --- a/python/packages/purview/pyproject.toml +++ b/python/packages/purview/pyproject.toml @@ -4,7 +4,7 @@ description = "Microsoft Purview (Graph dataSecurityAndGovernance) integration f authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260709" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://github.com/microsoft/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/redis/pyproject.toml b/python/packages/redis/pyproject.toml index f91d820d7dd..e5267d55f31 100644 --- a/python/packages/redis/pyproject.toml +++ b/python/packages/redis/pyproject.toml @@ -4,7 +4,7 @@ description = "Redis integration for Microsoft Agent Framework." authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0b260521" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" diff --git a/python/packages/tools/README.md b/python/packages/tools/README.md index fd58f134df7..2cc7ed6ad22 100644 --- a/python/packages/tools/README.md +++ b/python/packages/tools/README.md @@ -1,6 +1,6 @@ # agent-framework-tools -Alpha built-in tools for the Microsoft Agent Framework. A home for first-party +Beta built-in tools for the Microsoft Agent Framework. A home for first-party Python tools that plug into any chat client's shell / function surface. The first tool is `LocalShellTool`. @@ -16,7 +16,7 @@ pip install agent-framework-tools --pre import asyncio from agent_framework import Agent from agent_framework.openai import OpenAIChatClient -from agent_framework_tools.shell import LocalShellTool +from agent_framework.tools import LocalShellTool async def main() -> None: @@ -68,7 +68,7 @@ Defenses (in priority order): Override with `ShellPolicy`: ```python -from agent_framework_tools.shell import LocalShellTool, ShellPolicy +from agent_framework.tools import LocalShellTool, ShellPolicy shell = LocalShellTool( policy=ShellPolicy(allowlist=[r"^ls\b", r"^cat\b", r"^git status$"]), @@ -95,7 +95,7 @@ default) — and injects a system-prompt block describing the shell idiom to use and the available CLIs. ```python -from agent_framework_tools.shell import ( +from agent_framework.tools import ( LocalShellTool, ShellEnvironmentProvider, ShellEnvironmentProviderOptions, @@ -127,7 +127,7 @@ is the intended security boundary and approval gating becomes optional. ```python import asyncio -from agent_framework_tools.shell import DockerShellTool +from agent_framework.tools import DockerShellTool async def main() -> None: diff --git a/python/packages/tools/pyproject.toml b/python/packages/tools/pyproject.toml index 4ab82246477..32d7cd6921f 100644 --- a/python/packages/tools/pyproject.toml +++ b/python/packages/tools/pyproject.toml @@ -4,7 +4,7 @@ description = "Built-in tools for the Microsoft Agent Framework (local shell, an authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.0.0a260630" +version = "1.0.0b260721" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta urls.issues = "https://github.com/microsoft/agent-framework/issues" classifiers = [ "License :: OSI Approved :: MIT License", - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", diff --git a/python/pyproject.toml b/python/pyproject.toml index 7c2258b1c02..19420c1c501 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ description = "Microsoft Agent Framework for building AI Agents with Python. Thi authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}] readme = "README.md" requires-python = ">=3.10" -version = "1.11.0" +version = "1.12.0" license-files = ["LICENSE"] urls.homepage = "https://aka.ms/agent-framework" urls.source = "https://github.com/microsoft/agent-framework/tree/main/python" @@ -23,7 +23,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "agent-framework-core[all]==1.11.0", + "agent-framework-core[all]==1.12.0", ] [dependency-groups] diff --git a/python/samples/01-get-started/README.md b/python/samples/01-get-started/README.md index 61aefc65922..6079bdbd077 100644 --- a/python/samples/01-get-started/README.md +++ b/python/samples/01-get-started/README.md @@ -6,9 +6,11 @@ concepts of **Agent Framework** one step at a time. ## Prerequisites ```bash -pip install agent-framework +pip install agent-framework-foundry ``` +Sample 08 additionally requires `agent-framework-azurefunctions --pre`. + Set the required environment variables: ```bash diff --git a/python/samples/02-agents/context_providers/README.md b/python/samples/02-agents/context_providers/README.md index 6a776581e37..94b161fe71c 100644 --- a/python/samples/02-agents/context_providers/README.md +++ b/python/samples/02-agents/context_providers/README.md @@ -11,6 +11,7 @@ These samples demonstrate how to use context providers to enrich agent conversat | [`azure_ai_foundry_memory.py`](azure_ai_foundry_memory.py) | Use `FoundryMemoryProvider` to add semantic memory — automatically retrieves, searches, and stores memories via Microsoft Foundry. | | [`file_access_data_processing/`](file_access_data_processing/) | Use `FileAccessProvider` with `FileSystemAgentFileStore` to give an agent read/write/search access to a folder of CSV data files. See its own [README](file_access_data_processing/README.md). | | [`azure_ai_search/`](azure_ai_search/) | Retrieval Augmented Generation (RAG) with Azure AI Search in semantic and agentic modes. See its own [README](azure_ai_search/README.md). | +| [`azure_content_understanding/`](azure_content_understanding/) | Analyze documents, images, audio, and video with Azure Content Understanding and inject the extracted content into agent context. | | [`mem0/`](mem0/) | Memory-powered context using the Mem0 integration (open-source and managed). See its own [README](mem0/README.md). | | [`redis/`](redis/) | Redis-backed context providers for conversation memory and sessions. See its own [README](redis/README.md). | diff --git a/python/packages/azure-contentunderstanding/samples/01-get-started/01_document_qa.py b/python/samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py similarity index 93% rename from python/packages/azure-contentunderstanding/samples/01-get-started/01_document_qa.py rename to python/samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py index e77794e1e02..a8f039e89d5 100644 --- a/python/packages/azure-contentunderstanding/samples/01-get-started/01_document_qa.py +++ b/python/samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py @@ -4,10 +4,9 @@ # dependencies = [ # "agent-framework-azure-contentunderstanding", # "agent-framework-foundry", -# "azure-identity", # ] # /// -# Run with: uv run packages/azure-contentunderstanding/samples/01-get-started/01_document_qa.py +# Run with: uv run samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py import asyncio @@ -16,7 +15,7 @@ from agent_framework import Agent, Content, Message from agent_framework.foundry import ContentUnderstandingContextProvider, FoundryChatClient -from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential from dotenv import load_dotenv load_dotenv() @@ -37,7 +36,7 @@ # Path to a sample PDF — uses the shared sample asset if available, # otherwise falls back to a public URL -SAMPLE_PDF_PATH = Path(__file__).resolve().parents[1] / "shared" / "sample_assets" / "invoice.pdf" +SAMPLE_PDF_PATH = Path(__file__).resolve().parent / "sample_assets" / "invoice.pdf" async def main() -> None: @@ -61,7 +60,7 @@ async def main() -> None: # Create agent with CU context provider. # The provider extracts document content via CU and injects it into the # LLM context so the agent can answer questions about the document. - async with cu: + async with credential, cu: agent = Agent( client=client, name="DocumentQA", diff --git a/python/packages/azure-contentunderstanding/samples/01-get-started/02_multi_turn_session.py b/python/samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py similarity index 94% rename from python/packages/azure-contentunderstanding/samples/01-get-started/02_multi_turn_session.py rename to python/samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py index 8f61109e191..87a705dcd98 100644 --- a/python/packages/azure-contentunderstanding/samples/01-get-started/02_multi_turn_session.py +++ b/python/samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py @@ -4,10 +4,9 @@ # dependencies = [ # "agent-framework-azure-contentunderstanding", # "agent-framework-foundry", -# "azure-identity", # ] # /// -# Run with: uv run packages/azure-contentunderstanding/samples/01-get-started/02_multi_turn_session.py +# Run with: uv run samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py import asyncio @@ -16,7 +15,7 @@ from agent_framework import Agent, AgentSession, Content, Message from agent_framework.foundry import ContentUnderstandingContextProvider, FoundryChatClient -from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential from dotenv import load_dotenv load_dotenv() @@ -42,7 +41,7 @@ AZURE_CONTENTUNDERSTANDING_ENDPOINT — CU endpoint URL """ -SAMPLE_PDF_PATH = Path(__file__).resolve().parents[1] / "shared" / "sample_assets" / "invoice.pdf" +SAMPLE_PDF_PATH = Path(__file__).resolve().parent / "sample_assets" / "invoice.pdf" async def main() -> None: @@ -64,7 +63,7 @@ async def main() -> None: ) # 3. Create agent and persistent session - async with cu: + async with credential, cu: agent = Agent( client=client, name="DocumentQA", diff --git a/python/packages/azure-contentunderstanding/samples/01-get-started/03_multimodal_chat.py b/python/samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py similarity index 96% rename from python/packages/azure-contentunderstanding/samples/01-get-started/03_multimodal_chat.py rename to python/samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py index 3ff2c19e7eb..757bae1dc4b 100644 --- a/python/packages/azure-contentunderstanding/samples/01-get-started/03_multimodal_chat.py +++ b/python/samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py @@ -4,10 +4,9 @@ # dependencies = [ # "agent-framework-azure-contentunderstanding", # "agent-framework-foundry", -# "azure-identity", # ] # /// -# Run with: uv run packages/azure-contentunderstanding/samples/01-get-started/03_multimodal_chat.py +# Run with: uv run samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py import asyncio @@ -17,7 +16,7 @@ from agent_framework import Agent, AgentSession, Content, Message from agent_framework.foundry import ContentUnderstandingContextProvider, FoundryChatClient -from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential from dotenv import load_dotenv load_dotenv() @@ -41,7 +40,7 @@ """ # Local PDF from package assets -SAMPLE_PDF = Path(__file__).resolve().parents[1] / "shared" / "sample_assets" / "invoice.pdf" +SAMPLE_PDF = Path(__file__).resolve().parent / "sample_assets" / "invoice.pdf" # Public audio/video from Azure CU samples repo (raw GitHub URLs) _CU_ASSETS = "https://raw.githubusercontent.com/Azure-Samples/azure-ai-content-understanding-assets/main" @@ -71,7 +70,7 @@ async def main() -> None: ) # 3. Create agent and session - async with cu: + async with credential, cu: agent = Agent( client=client, name="MultiModalAgent", diff --git a/python/packages/azure-contentunderstanding/samples/01-get-started/04_invoice_processing.py b/python/samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py similarity index 95% rename from python/packages/azure-contentunderstanding/samples/01-get-started/04_invoice_processing.py rename to python/samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py index 3cb80b4b2cc..502cd328ca9 100644 --- a/python/packages/azure-contentunderstanding/samples/01-get-started/04_invoice_processing.py +++ b/python/samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py @@ -4,11 +4,10 @@ # dependencies = [ # "agent-framework-azure-contentunderstanding", # "agent-framework-foundry", -# "azure-identity", # "pydantic", # ] # /// -# Run with: uv run packages/azure-contentunderstanding/samples/01-get-started/04_invoice_processing.py +# Run with: uv run samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py import asyncio @@ -17,7 +16,7 @@ from agent_framework import Agent, AgentSession, Content, Message from agent_framework.foundry import ContentUnderstandingContextProvider, FoundryChatClient -from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential from dotenv import load_dotenv from pydantic import BaseModel, Field @@ -39,7 +38,7 @@ AZURE_CONTENTUNDERSTANDING_ENDPOINT — CU endpoint URL """ -SAMPLE_PDF_PATH = Path(__file__).resolve().parents[1] / "shared" / "sample_assets" / "invoice.pdf" +SAMPLE_PDF_PATH = Path(__file__).resolve().parent / "sample_assets" / "invoice.pdf" # Structured output model — the LLM will return JSON matching this schema @@ -103,7 +102,7 @@ async def main() -> None: ) # 3. Create agent and session - async with cu: + async with credential, cu: agent = Agent( client=client, name="InvoiceProcessor", diff --git a/python/packages/azure-contentunderstanding/samples/01-get-started/05_large_doc_file_search.py b/python/samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py similarity index 95% rename from python/packages/azure-contentunderstanding/samples/01-get-started/05_large_doc_file_search.py rename to python/samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py index 0520414bf25..39e4352eea5 100644 --- a/python/packages/azure-contentunderstanding/samples/01-get-started/05_large_doc_file_search.py +++ b/python/samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py @@ -4,10 +4,9 @@ # dependencies = [ # "agent-framework-azure-contentunderstanding", # "agent-framework-foundry", -# "azure-identity", # ] # /// -# Run with: uv run packages/azure-contentunderstanding/samples/01-get-started/05_large_doc_file_search.py +# Run with: uv run samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py import asyncio @@ -20,7 +19,7 @@ FileSearchConfig, FoundryChatClient, ) -from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential from dotenv import load_dotenv load_dotenv() @@ -60,7 +59,7 @@ AZURE_CONTENTUNDERSTANDING_ENDPOINT — CU endpoint URL """ -SAMPLE_PDF_PATH = Path(__file__).resolve().parents[1] / "shared" / "sample_assets" / "invoice.pdf" +SAMPLE_PDF_PATH = Path(__file__).resolve().parent / "sample_assets" / "invoice.pdf" async def main() -> None: @@ -101,7 +100,7 @@ async def main() -> None: pdf_bytes = SAMPLE_PDF_PATH.read_bytes() # The provider handles everything: CU extraction + vector store upload + file_search tool - async with cu: + async with credential, cu: agent = Agent( client=client, name="LargeDocAgent", diff --git a/python/samples/02-agents/context_providers/azure_content_understanding/README.md b/python/samples/02-agents/context_providers/azure_content_understanding/README.md new file mode 100644 index 00000000000..ffefee9d9e2 --- /dev/null +++ b/python/samples/02-agents/context_providers/azure_content_understanding/README.md @@ -0,0 +1,35 @@ +# Azure Content Understanding Samples + +These samples demonstrate how to use the `agent-framework-azure-contentunderstanding` package to add document, image, audio, and video understanding to your agents. + +## Prerequisites + +1. Azure CLI logged in: `az login` +2. Environment variables set (or `.env` file in the `python/` directory): + ``` + FOUNDRY_PROJECT_ENDPOINT=https://your-project.services.ai.azure.com + FOUNDRY_MODEL=gpt-4.1 + AZURE_CONTENTUNDERSTANDING_ENDPOINT=https://your-cu-resource.cognitiveservices.azure.com/ + ``` + +## Samples + +### Script samples (easy → advanced) + +| # | Sample | Description | Run | +|---|--------|-------------|-----| +| 01 | [Document Q&A](01_document_qa.py) | Upload a PDF, ask questions with CU-powered extraction | `uv run samples/02-agents/context_providers/azure_content_understanding/01_document_qa.py` | +| 02 | [Multi-Turn Session](02_multi_turn_session.py) | AgentSession persistence across turns | `uv run samples/02-agents/context_providers/azure_content_understanding/02_multi_turn_session.py` | +| 03 | [Multi-Modal Chat](03_multimodal_chat.py) | PDF + audio + video parallel analysis | `uv run samples/02-agents/context_providers/azure_content_understanding/03_multimodal_chat.py` | +| 04 | [Invoice Processing](04_invoice_processing.py) | Structured field extraction with prebuilt-invoice | `uv run samples/02-agents/context_providers/azure_content_understanding/04_invoice_processing.py` | +| 05 | [Large Doc + file_search](05_large_doc_file_search.py) | CU extraction + OpenAI vector store RAG | `uv run samples/02-agents/context_providers/azure_content_understanding/05_large_doc_file_search.py` | + +### Interactive web UI samples + +See the [DevUI sample index](../../devui/README.md) for the Azure Content Understanding agents. + +## Install (preview) + +```bash +pip install --pre agent-framework-azure-contentunderstanding +``` diff --git a/python/packages/azure-contentunderstanding/samples/shared/sample_assets/invoice.pdf b/python/samples/02-agents/context_providers/azure_content_understanding/sample_assets/invoice.pdf similarity index 100% rename from python/packages/azure-contentunderstanding/samples/shared/sample_assets/invoice.pdf rename to python/samples/02-agents/context_providers/azure_content_understanding/sample_assets/invoice.pdf diff --git a/python/samples/02-agents/context_providers/code_act/README.md b/python/samples/02-agents/context_providers/code_act/README.md index ea1ff3dc05f..4a9f490b41e 100644 --- a/python/samples/02-agents/context_providers/code_act/README.md +++ b/python/samples/02-agents/context_providers/code_act/README.md @@ -5,7 +5,7 @@ Demonstrates the provider-owned CodeAct flow with two backends: | File | Backend | Notes | |------|---------|-------| | [`code_act.py`](code_act.py) | [Hyperlight](https://github.com/hyperlight-dev/hyperlight) WASM sandbox via `HyperlightCodeActProvider` | Hardened sandbox with WASM isolation; sandbox tools called via `call_tool(...)`. | -| [`monty_code_act.py`](monty_code_act.py) | [Monty](https://github.com/pydantic/monty) Rust-based Python interpreter via `MontyCodeActProvider` (alpha) | Cross-platform pure interpreter; sandbox tools can be called as typed async functions (`await compute(...)`) or via `call_tool(...)`. | +| [`monty_code_act.py`](monty_code_act.py) | [Monty](https://github.com/pydantic/monty) Rust-based Python interpreter via `MontyCodeActProvider` (beta) | Cross-platform pure interpreter; sandbox tools can be called as typed async functions (`await compute(...)`) or via `call_tool(...)`. | Both providers inject an `execute_code` tool into the agent and keep the registered sandbox tools (`compute`, `fetch_data`) hidden from the model — the @@ -14,8 +14,8 @@ model invokes them from inside the sandbox. ## Installation ```bash -pip install agent-framework agent-framework-hyperlight --pre # Hyperlight sample -pip install agent-framework agent-framework-monty --pre # Monty sample +pip install agent-framework-hyperlight agent-framework-foundry --pre # Hyperlight sample +pip install agent-framework-monty agent-framework-foundry --pre # Monty sample ``` > The Hyperlight Wasm backend is currently published only for `linux/x86_64` and @@ -24,8 +24,7 @@ pip install agent-framework agent-framework-monty --pre # Monty sample > > Monty is cross-platform and has no hypervisor/WASM backend dependency, but it > interprets a Python subset (e.g. `os`/network/subprocess access is blocked). -> `agent-framework-monty` is an alpha package and is not yet part of -> `agent-framework[all]`; install it explicitly with `--pre`. +> The beta `agent-framework-monty` package is included in `agent-framework[all]`. ## Prerequisites diff --git a/python/samples/02-agents/context_providers/code_act/monty_code_act.py b/python/samples/02-agents/context_providers/code_act/monty_code_act.py index 862c92c1d72..e7fd85a598f 100644 --- a/python/samples/02-agents/context_providers/code_act/monty_code_act.py +++ b/python/samples/02-agents/context_providers/code_act/monty_code_act.py @@ -10,7 +10,7 @@ from agent_framework import Agent, FunctionInvocationContext, function_middleware, tool from agent_framework.foundry import FoundryChatClient -from agent_framework_monty import MontyCodeActProvider +from agent_framework.monty import MontyCodeActProvider from azure.identity import AzureCliCredential from dotenv import load_dotenv @@ -26,12 +26,13 @@ a Rust-based Python interpreter, so it runs cross-platform with no hypervisor/WASM backend dependency. -Note: `agent-framework-monty` is an alpha package and is not yet part of -`agent-framework[all]`. Install it explicitly with: +`agent-framework-monty` is a beta package included in `agent-framework[all]`. +Install the main package with: - pip install agent-framework agent-framework-monty --pre + pip install agent-framework-monty agent-framework-foundry --pre -It is imported as `agent_framework_monty` (no lazy-loading namespace yet). +It can be imported directly as `agent_framework_monty` or through the +`agent_framework.monty` lazy-loading namespace. """ load_dotenv() diff --git a/python/samples/02-agents/devui/README.md b/python/samples/02-agents/devui/README.md index 617deb7c33f..7a0019270f9 100644 --- a/python/samples/02-agents/devui/README.md +++ b/python/samples/02-agents/devui/README.md @@ -88,6 +88,9 @@ workflow_name/ | ------ | -------------------- | -------------------- | | [**agent_weather/**](agent_weather/) | A richer Foundry-backed weather agent that shows chat middleware, function middleware, tool calling, and an approval-required tool alongside auto-approved tools. | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL`, plus Azure CLI auth via `az login` | | [**agent_foundry/**](agent_foundry/) | A minimal Foundry-backed weather agent with current weather and forecast tools. Use this when you want the smallest possible directory-discovered agent sample. | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL`, plus Azure CLI auth via `az login` | +| [**agent_content_understanding/**](agent_content_understanding/) | Upload and analyze documents, images, audio, and video with Azure Content Understanding. | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL`, `AZURE_CONTENTUNDERSTANDING_ENDPOINT`, plus Azure CLI auth via `az login` | +| [**agent_content_understanding_file_search_azure_openai/**](agent_content_understanding_file_search_azure_openai/) | Combine Azure Content Understanding extraction with Azure OpenAI vector-store file search. | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL`, `AZURE_CONTENTUNDERSTANDING_ENDPOINT`, plus Azure CLI auth via `az login` | +| [**agent_content_understanding_file_search_foundry/**](agent_content_understanding_file_search_foundry/) | Combine Azure Content Understanding extraction with Foundry vector-store file search. | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL`, `AZURE_CONTENTUNDERSTANDING_ENDPOINT`, plus Azure CLI auth via `az login` | ### Workflows diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/README.md b/python/samples/02-agents/devui/agent_content_understanding/README.md similarity index 92% rename from python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/README.md rename to python/samples/02-agents/devui/agent_content_understanding/README.md index 12263ce50f7..a1baf0a5ce8 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/README.md +++ b/python/samples/02-agents/devui/agent_content_understanding/README.md @@ -18,7 +18,7 @@ Interactive web UI for uploading and chatting with documents, images, audio, and 3. Run with DevUI: ```bash - uv run poe devui --agent packages/azure-contentunderstanding/samples/devui_multimodal_agent + devui samples/02-agents/devui/agent_content_understanding ``` 4. Open the DevUI URL in your browser and start uploading files. diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/__init__.py b/python/samples/02-agents/devui/agent_content_understanding/__init__.py similarity index 63% rename from python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/__init__.py rename to python/samples/02-agents/devui/agent_content_understanding/__init__.py index 3ca9ea7e09b..4a62c13ce44 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/__init__.py +++ b/python/samples/02-agents/devui/agent_content_understanding/__init__.py @@ -1,6 +1,6 @@ # Copyright (c) Microsoft. All rights reserved. """DevUI Multi-Modal Agent with Azure Content Understanding.""" -from .agent import agent +from .agent import agent # ty: ignore[unresolved-import] # pyrefly: ignore __all__ = ["agent"] diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/agent.py b/python/samples/02-agents/devui/agent_content_understanding/agent.py similarity index 94% rename from python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/agent.py rename to python/samples/02-agents/devui/agent_content_understanding/agent.py index 8f49a6c49ad..d8f46155cec 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/01-multimodal_agent/agent.py +++ b/python/samples/02-agents/devui/agent_content_understanding/agent.py @@ -15,7 +15,7 @@ AZURE_CONTENTUNDERSTANDING_ENDPOINT — CU endpoint URL Run with DevUI: - uv run poe devui --agent packages/azure-contentunderstanding/samples/devui_multimodal_agent + devui samples/02-agents/devui/agent_content_understanding """ import os @@ -23,7 +23,7 @@ from agent_framework import Agent from agent_framework.foundry import ContentUnderstandingContextProvider, FoundryChatClient from azure.core.credentials import AzureKeyCredential -from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential from dotenv import load_dotenv load_dotenv() diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/README.md b/python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/README.md similarity index 93% rename from python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/README.md rename to python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/README.md index 0acb10a0d3d..7a72416b118 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/README.md +++ b/python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/README.md @@ -26,7 +26,7 @@ Interactive web UI for uploading and chatting with documents, images, audio, and 3. Run with DevUI: ```bash - devui packages/azure-contentunderstanding/samples/devui_azure_openai_file_search_agent + devui samples/02-agents/devui/agent_content_understanding_file_search_azure_openai ``` 4. Open the DevUI URL in your browser and start uploading files. @@ -40,7 +40,7 @@ Interactive web UI for uploading and chatting with documents, images, audio, and | Audio | WAV, MP3, FLAC, OGG, M4A | `prebuilt-audioSearch` | | Video | MP4, MOV, AVI, WebM | `prebuilt-videoSearch` | -## vs. devui_multimodal_agent +## Comparison with the multimodal agent | Feature | multimodal_agent | file_search_agent | |---------|-----------------|-------------------| diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/__init__.py b/python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/__init__.py similarity index 62% rename from python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/__init__.py rename to python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/__init__.py index 92f4181db41..60720f84899 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/__init__.py +++ b/python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/__init__.py @@ -1,6 +1,6 @@ # Copyright (c) Microsoft. All rights reserved. """DevUI Multi-Modal Agent with CU + file_search RAG.""" -from .agent import agent +from .agent import agent # ty: ignore[unresolved-import] # pyrefly: ignore __all__ = ["agent"] diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/agent.py b/python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/agent.py similarity index 93% rename from python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/agent.py rename to python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/agent.py index 2e3161fabd6..c5aa9fa1ade 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/azure_openai_backend/agent.py +++ b/python/samples/02-agents/devui/agent_content_understanding_file_search_azure_openai/agent.py @@ -27,7 +27,7 @@ AZURE_CONTENTUNDERSTANDING_ENDPOINT — CU endpoint URL Run with DevUI: - devui packages/azure-contentunderstanding/samples/devui_azure_openai_file_search_agent + devui samples/02-agents/devui/agent_content_understanding_file_search_azure_openai """ import os @@ -41,6 +41,7 @@ from azure.ai.projects import AIProjectClient from azure.core.credentials import AzureKeyCredential from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential as AsyncAzureCliCredential from dotenv import load_dotenv load_dotenv() @@ -48,7 +49,7 @@ # --- Auth --- _credential = AzureCliCredential() _cu_api_key = os.environ.get("AZURE_CONTENTUNDERSTANDING_API_KEY") -_cu_credential = AzureKeyCredential(_cu_api_key) if _cu_api_key else _credential +_cu_credential = AzureKeyCredential(_cu_api_key) if _cu_api_key else AsyncAzureCliCredential() _endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] @@ -63,7 +64,7 @@ ) _sync_project = AIProjectClient(endpoint=_endpoint, credential=_credential) # type: ignore[arg-type] -_sync_openai = _sync_project.get_openai_client() +_sync_openai = _sync_project.get_openai_client() # ty: ignore[unresolved-attribute] # pyrefly: ignore _vector_store = _sync_openai.vector_stores.create( name="devui_cu_file_search", expires_after={"anchor": "last_active_at", "days": 1}, diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/README.md b/python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/README.md similarity index 87% rename from python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/README.md rename to python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/README.md index b72ed623274..6f07c701b07 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/README.md +++ b/python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/README.md @@ -2,7 +2,8 @@ Interactive web UI for uploading and chatting with documents, images, audio, and video using Azure Content Understanding + Foundry file_search RAG. -This is the **Foundry** variant. For the Azure OpenAI Responses API variant, see `devui_azure_openai_file_search_agent`. +This is the **Foundry** variant. For the Azure OpenAI Responses API variant, see +`agent_content_understanding_file_search_azure_openai`. ## How It Works @@ -28,7 +29,7 @@ This is the **Foundry** variant. For the Azure OpenAI Responses API variant, see 3. Run with DevUI: ```bash - devui packages/azure-contentunderstanding/samples/devui_foundry_file_search_agent + devui samples/02-agents/devui/agent_content_understanding_file_search_foundry ``` 4. Open the DevUI URL in your browser and start uploading files. diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/__init__.py b/python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/__init__.py similarity index 100% rename from python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/__init__.py rename to python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/__init__.py diff --git a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/agent.py b/python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/agent.py similarity index 93% rename from python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/agent.py rename to python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/agent.py index 9b9c3820c15..3af2ebfe223 100644 --- a/python/packages/azure-contentunderstanding/samples/02-devui/02-file_search_agent/foundry_backend/agent.py +++ b/python/samples/02-agents/devui/agent_content_understanding_file_search_foundry/agent.py @@ -11,7 +11,8 @@ 4. Uploaded files are cleaned up on server shutdown This sample uses ``FoundryChatClient`` and ``FoundryFileSearchBackend``. -For the OpenAI Responses API variant, see ``devui_azure_openai_file_search_agent``. +For the OpenAI Responses API variant, see +``agent_content_understanding_file_search_azure_openai``. Analyzer auto-detection: When no analyzer_id is specified, the provider auto-selects the @@ -26,7 +27,7 @@ AZURE_CONTENTUNDERSTANDING_ENDPOINT — CU endpoint URL Run with DevUI: - devui packages/azure-contentunderstanding/samples/devui_foundry_file_search_agent + devui samples/02-agents/devui/agent_content_understanding_file_search_foundry """ import os @@ -39,6 +40,7 @@ ) from azure.core.credentials import AzureKeyCredential from azure.identity import AzureCliCredential +from azure.identity.aio import AzureCliCredential as AsyncAzureCliCredential from dotenv import load_dotenv from openai import AzureOpenAI @@ -48,7 +50,7 @@ # AzureCliCredential for Foundry. CU API key optional if on a different resource. _credential = AzureCliCredential() _cu_api_key = os.environ.get("AZURE_CONTENTUNDERSTANDING_API_KEY") -_cu_credential = AzureKeyCredential(_cu_api_key) if _cu_api_key else _credential +_cu_credential = AzureKeyCredential(_cu_api_key) if _cu_api_key else AsyncAzureCliCredential() # --- Foundry LLM client --- client = FoundryChatClient( diff --git a/python/samples/02-agents/harness/README.md b/python/samples/02-agents/harness/README.md index 2167db5ed45..a5215a22d68 100644 --- a/python/samples/02-agents/harness/README.md +++ b/python/samples/02-agents/harness/README.md @@ -59,8 +59,8 @@ uv run --with textual python samples/02-agents/harness/harness_data_processing.p ``` The workspace environment already provides the editable `agent-framework` -packages plus the samples' other dependencies (`rich`, `python-dotenv`, -`azure-identity`); only `textual` needs to be supplied with `--with`. +packages plus the samples' other dependencies (`rich`, `python-dotenv`); +only `textual` needs to be supplied with `--with`. > Note: invoking `uv run python