-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Python: Add Hyperlight CodeAct package and docs #5185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eavanvalkenburg
wants to merge
17
commits into
microsoft:main
Choose a base branch
from
eavanvalkenburg:code_mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
390d0ad
initial work on code_mode
eavanvalkenburg 4fbb5b2
updated samples
eavanvalkenburg 03a0bd7
updates to codeact
eavanvalkenburg 37106d9
udpated codeact
eavanvalkenburg f0ddf5d
Draft CodeAct ADR and sample updates
eavanvalkenburg f8d959e
initial implementation and adr and feature
eavanvalkenburg bc61298
Python: Limit Hyperlight wasm backend to Python <3.14
eavanvalkenburg 9f8e5f4
Python: Fix CI for Hyperlight CodeAct PR
eavanvalkenburg 2e0b8b7
Python: Run Hyperlight integration when available
eavanvalkenburg 48fc775
Python: Address Hyperlight review feedback
eavanvalkenburg 4b564cf
Python: Simplify Hyperlight file mount inputs
eavanvalkenburg e8eb62a
Python: Accept Path host paths in Hyperlight mounts
eavanvalkenburg 4c6f7da
Python: Fix Hyperlight mount typing for CI
eavanvalkenburg f89d65a
temp run integration test
eavanvalkenburg ef6e1b4
Python: Strengthen Hyperlight real sandbox tests
eavanvalkenburg 1867b4d
added additional tests
eavanvalkenburg 764c15a
Python: Simplify Hyperlight CodeAct API
eavanvalkenburg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # CodeAct .NET implementation | ||
|
|
||
| This document will describe the .NET realization of the CodeAct design in | ||
| [`docs/decisions/0024-codeact-integration.md`](../../decisions/0024-codeact-integration.md). | ||
|
|
||
| Coming soon. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) Microsoft Corporation. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # agent-framework-hyperlight | ||
|
|
||
| Alpha Hyperlight-backed CodeAct integrations for Microsoft Agent Framework. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install agent-framework-hyperlight --pre | ||
| ``` | ||
|
|
||
| This package depends on `hyperlight-sandbox`, the packaged Python guest, and the | ||
| Wasm backend package on supported platforms. If the backend is not published for | ||
| your current platform yet, `execute_code` will fail at runtime when it tries to | ||
| create the sandbox. | ||
|
|
||
| ## Public API | ||
|
|
||
| - `AllowedDomain` | ||
| - `AllowedDomainInput` | ||
| - `HyperlightCodeActProvider` | ||
| - `HyperlightExecuteCodeTool` | ||
| - `FileMount` | ||
| - `FileMountInput` | ||
|
|
||
| ## Notes | ||
|
|
||
| - This package is intentionally separate from `agent-framework-core` so CodeAct | ||
| usage and installation remain optional. | ||
| - Alpha-package samples live under `packages/hyperlight/samples/`. | ||
| - `file_mounts` accepts a single string shorthand, an explicit `(host_path, | ||
| mount_path)` pair, or a `FileMount` named tuple. The host-side path in the | ||
| explicit forms may be a `str` or `Path`. Use the explicit two-value form when | ||
| the host path differs from the sandbox path. | ||
| - `allowed_domains` accepts a single string target such as `"github.com"` to | ||
| allow all backend-supported methods, an explicit `(target, method_or_methods)` | ||
| tuple such as `("github.com", "GET")`, or an `AllowedDomain` named tuple. |
24 changes: 24 additions & 0 deletions
24
python/packages/hyperlight/agent_framework_hyperlight/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import importlib.metadata | ||
|
|
||
| from ._execute_code_tool import HyperlightExecuteCodeTool | ||
| from ._provider import HyperlightCodeActProvider | ||
| from ._types import AllowedDomain, AllowedDomainInput, FileMount, FileMountInput | ||
|
|
||
| try: | ||
| __version__ = importlib.metadata.version(__name__) | ||
| except importlib.metadata.PackageNotFoundError: | ||
| __version__ = "0.0.0" | ||
|
|
||
| __all__ = [ | ||
| "AllowedDomain", | ||
| "AllowedDomainInput", | ||
| "FileMount", | ||
| "FileMountInput", | ||
| "HyperlightCodeActProvider", | ||
| "HyperlightExecuteCodeTool", | ||
| "__version__", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.