d08200d00e
* Bump Python package versions for 1.12.0 release Bump packages represented in the 1.12.0 changelog, promote Foundry Hosting, Azure Content Understanding, Gemini, Mistral, Monty, and Tools to beta, and apply the requested beta cohort date stamp. Root and core move to 1.12.0, released and RC packages use their selected increments, alpha packages including Hosting MCP use the 260721 stamp, and core floors are raised only for proven consumers. Copilot-Session: 2dd9980a-b869-4c16-8642-75b7a6d6ebdf * fix version in readme * Add Responses conversation ID changes to release notes Include the breaking Hosting Responses conversation ID helper changes from #7234 in the Python 1.12.0 changelog. Copilot-Session: 2dd9980a-b869-4c16-8642-75b7a6d6ebdf
3.5 KiB
3.5 KiB
Monty Package (agent-framework-monty)
Monty-backed CodeAct integrations for the Microsoft Agent Framework.
Note
Beta package. Included in
agent-framework[all]and available through the lazy-loading namespaceagent_framework.monty.
Core Classes
MontyCodeActProvider—ContextProviderthat injects a run-scopedexecute_codetool plus dynamic CodeAct instructions. Mirrors theHyperlightCodeActProviderAPI for the parts that apply to a non-sandboxed Python interpreter.MontyExecuteCodeTool—FunctionToolthat wraps the Monty interpreter. Use directly for mixed-tool agents or manual static wiring. MirrorsHyperlightExecuteCodeTool.
Public API
from agent_framework.monty import (
FileMount,
FileMountInput,
MontyCodeActProvider,
MontyExecuteCodeTool,
MountMode,
)
MontyCodeActProvider and MontyExecuteCodeTool both accept:
tools— host tool callables /FunctionToolsapproval_mode—"never_require"(default) or"always_require"workspace_root— host directory auto-mounted at/input(mirrorsHyperlightCodeActProvider.workspace_root)file_mounts— sequence ofFileMountInput(str shorthand,(host_path, mount_path)tuple, orFileMount)resource_limits— MontyResourceLimitsTypedDict
Tool-management methods on both classes: add_tools, get_tools,
remove_tool, clear_tools. Mount-management methods: add_file_mounts,
get_file_mounts, remove_file_mount, clear_file_mounts.
MontyExecuteCodeTool additionally exposes:
build_instructions(*, tools_visible_to_model: bool) -> strcreate_run_tool() -> MontyExecuteCodeToolbuild_serializable_state() -> dict[str, Any]workspace_root,resource_limitsproperties
Architecture
_types.py—FileMount,FileMountInput,MountMode(public)._provider.py—MontyCodeActProvider(thin wrapper around the tool)._execute_code_tool.py—MontyExecuteCodeToolplus tool / mount normalization, approval helpers, dynamicdescription/instructionsbuilders, and the post-execution file-capture flow that surfaces files written toread-writemounts asContent.from_dataitems._monty_bridge.py—InlineCodeBridgeandgenerate_type_stubs, adapted from the reference Monty CodeAct repo. Pauses onFunctionSnapshotto dispatch host calls, then resumes; supports direct typed tool calls, thecall_toolfallback,asyncio.gatherfan-out, and forwardsmount/limitstoMonty(...).start(...)._instructions.py— dynamic instruction / tool-description builders (include filesystem capability summaries when mounts are configured).
Not implemented (yet)
| Capability | Monty primitive | Status |
|---|---|---|
| Custom virtual filesystem | OSAccess subclass passed to Monty(...).start(os=...) |
Not exposed. Strictly more general than file mounts; useful when you want a fully synthetic FS. |
| Outbound URL allow-list | No Monty primitive — expose fetch_url as a host tool with the allow-list check in your tool function. |
Not exposed in this package; users add it as a regular tool. |
Out of scope (for now)
- Durable execution — the reference Monty CodeAct repo also offers a
Durable-Functions-backed mode (
DurableCodeBridge,register_durable_codeact,wait_for_external_event, per-tool approval via external events). That is intentionally not in this package yet.