Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6a4132

Browse files
init commit
0 parents commit c6a4132

23 files changed

+1831
-0
lines changed

‎.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
# Ignore the virtual environment directory
3+
venv/
4+
# process
5+
*.pid
6+
# Ignore compiled Python files
7+
*.pyc
8+
*.pyo
9+
*.pyd
10+
*.pyc
11+
12+
# Ignore the pycache directory
13+
__pycache__/
14+
*/__pycache__/
15+
16+
# Ignore macOS system files
17+
.DS_Store
18+
19+
# Ignore logs files
20+
*.log
21+
22+
# Ignore database files
23+
*.sqlite3
24+
25+
# Ignore IDE-specific files (e.g., for VSCode, PyCharm, etc.)
26+
.vscode/
27+
.idea/
28+
29+
# Ignore any compiled binaries or executables
30+
*.exe
31+
*.dll
32+
*.so
33+
*.out
34+
35+
# Ignore the output of your build tools
36+
/build/
37+
38+
# Ignore any dependency lock files
39+
*.lock
40+
41+
# Ignore any temporary files or backups
42+
*.tmp
43+
*~
44+
*.bak
45+
46+
# Ignore node_modules directory (if using Node.js)
47+
node_modules/
48+
49+
# Ignore .env files with sensitive data
50+
.env
51+
52+
# Ignore any compiled CSS or JavaScript files (if applicable)
53+
*.css
54+
*.js

‎LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Zhejian Zhang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md

Whitespace-only changes.

‎README_zh.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Codeinterpreter-codebox
2+
3+
这是一个通过docker构建的云服务,实现了code interpreter的后端功能,以便部署调用。Sandbox环境语言独立,可以用其他编程语言重写。
4+
实现了企业化的code interpreter代码执行的自我部署的实现,提供了更好的信息安全性和基于云的可拓展性和可用性。
5+
## 相关项目和差异
6+
1. [Code Interpreter api](https://github.com/shroominic/codeinterpreter-api)提供了基于langchain的agent调用,但是codebox为闭源收费。
7+
2. [open-interpreter](https://github.com/KillianLucas/open-interpreter) 提供了更多的编程语言支持,但是支持本地化运行,不支持远程调用。在商业化或者企业化的项目中无法应用
8+
3. [E2B](https://github.com/e2b-dev/e2b) 支持更多编程语言的云服务,闭源
9+
10+
11+
12+
## 功能描述
13+
1. 通过支持启动、运行、上传文件、安装python package、结束等接口,方便客户端对于codeinterpreter-codebox的调用
14+
2. 提供了docker化的虚拟环境作为代码执行的沙盒环境
15+
3. 可以增加调用管理的数据库模块功能
16+
17+
## 部署
18+
[docker compose](./app/docker_dev.yml)中使用自己的文件路径替代'CODEBOX_ROOT_PATH'和 'YOUR_MNT_PATH:/codebox' 中的'YOUR_MNT_PATH'来挂载自己的文件路径
19+
## 代码示例
20+
21+
1. [jupyter server communicate](./examples/jupyter/jupyter_api_test.ipynb) 中展示了server和jupyter container交互的细节
22+
2. [jupyter 调用](./examples/jupyter/execute_dynamic_code.ipynb)中展示了如何通过http request的方式调用web服务,执行代码获取结果
23+
3. [client session调用](./examples/client/codeinterpreter_session.py)中展示了在项目中如何以session和http request的方式让LLM调用执行代码。
24+
25+
26+
27+
28+
## 联系方式
29+
微信:zjajzzj1996
30+
Email: [zhangzhehian@gmail.com](zhangzhehian@gmail.com)

‎app/Dockerfile_server

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.11-slim AS build
2+
3+
# RUN apt-get update
4+
RUN apt-get update && apt-get install -y gcc python3-dev
5+
RUN apt-get install net-tools
6+
RUN pip install --upgrade pip
7+
8+
COPY . /app
9+
# COPY ./script/findport.sh /app/findport.sh
10+
11+
WORKDIR /app
12+
13+
RUN pip install -e .
14+
15+
WORKDIR /app
16+
17+
18+

‎app/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /