aws / aws/bedrock-agentcore-sdk-python

[FEATURE] Support offline custom dependencies for Code Interpreter sessions

未关闭
#657 0 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
761
派生
147
平均合并
1 天 23 小时
30 天内合并 PR
7

描述

**Is your feature request related to a problem? Please describe.**

AgentCore Code Interpreter provides a fixed set of pre-installed libraries. The
SDK's `install_packages()` helper runs a normal `pip install`, which requires
access to PyPI or another package index.

Code Interpreter sessions running in an isolated VPC without NAT cannot use
this mechanism. Enabling public internet access solely to install dependencies
increases cost and weakens the sandbox's network isolation.

Code Interpreter supports mounting S3 Files and EFS through
`filesystemConfigurations`, but there is no first-class way to declare an
offline dependency bundle or initialization step. Applications must currently:

1. Mount or upload a wheelhouse.
2. Execute `pip install --no-index` manually after every session starts.
3. Configure `sys.path` and `PYTHONPATH` separately for `executeCode` and
`executeCommand`.
4. Detect initialization failures themselves before allowing agent code to run.

This creates duplicated bootstrap logic and makes session readiness ambiguous.

**Describe the solution you'd like**

Add first-class support for application-defined, offline dependencies when
creating a Code Interpreter or starting a session.

One possible API shape would be:

```python
client.start(
identifier=interpreter_id,
filesystem_configurations=[dependency_mount],
dependency_configuration={
"python": {
"requirementsPath": "/mnt/dependencies/requirements.txt",
"wheelhousePath": "/mnt/dependencies/wheels",
"offline": True,
}
},
)

贡献指南

打开贡献指南

调研方向

从 Code Interpreter 会话创建路径和 SDK 的 install_packages() helper 开始,然后比较 filesystemConfigurations 如何传递给会话。完成的标准是:应用可以声明离线依赖配置,会话无需访问公共包索引即可初始化该配置,并且初始化失败会在 agent 代码运行前被报告。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
backend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
活跃
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。