-
Notifications
You must be signed in to change notification settings - Fork 849
Expand file tree
/
Copy path__init__.py
More file actions
204 lines (195 loc) · 4.64 KB
/
__init__.py
File metadata and controls
204 lines (195 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
"""
Secure sandboxed cloud environments made for AI agents and AI apps.
Check docs [here](https://e2b.dev/docs).
E2B Sandbox is a secure cloud sandbox environment made for AI agents and AI
apps.
Sandboxes allow AI agents and apps to have long running cloud secure environments.
In these environments, large language models can use the same tools as humans do.
E2B Python SDK supports both sync and async API:
```py
from e2b import Sandbox
# Create sandbox
sandbox = Sandbox.create()
```
```py
from e2b import AsyncSandbox
# Create sandbox
sandbox = await AsyncSandbox.create()
```
"""
from .api import (
ApiClient,
client,
)
from .connection_config import (
ConnectionConfig,
ProxyTypes,
)
from .exceptions import (
AuthenticationException,
GitAuthException,
GitUpstreamException,
BuildException,
FileUploadException,
InvalidArgumentException,
NotEnoughSpaceException,
NotFoundException,
SandboxException,
TemplateException,
TimeoutException,
TimeoutType,
)
from .sandbox.commands.command_handle import (
CommandExitException,
CommandResult,
PtyOutput,
PtySize,
Stderr,
Stdout,
)
from .sandbox.commands.main import ProcessInfo
from .sandbox.filesystem.filesystem import EntryInfo, FileType, WriteInfo
from .sandbox.filesystem.watch_handle import (
FilesystemEvent,
FilesystemEventType,
)
from .sandbox._git import GitBranches, GitFileStatus, GitStatus
from .sandbox.network import ALL_TRAFFIC
from .sandbox.sandbox_api import (
GitHubMcpServer,
GitHubMcpServerConfig,
McpServer,
SandboxInfo,
SandboxMetrics,
SandboxLifecycle,
SandboxNetworkOpts,
SandboxQuery,
SandboxState,
SnapshotInfo,
)
from .sandbox_async.commands.command_handle import AsyncCommandHandle
from .sandbox_async.filesystem.watch_handle import AsyncWatchHandle
from .sandbox_async.main import AsyncSandbox
from .sandbox_async.paginator import AsyncSandboxPaginator, AsyncSnapshotPaginator
from .sandbox_async.utils import OutputHandler
from .sandbox_sync.commands.command_handle import CommandHandle
from .sandbox_sync.filesystem.watch_handle import WatchHandle
from .sandbox_sync.main import Sandbox
from .sandbox_sync.paginator import SandboxPaginator, SnapshotPaginator
from .template.logger import (
LogEntry,
LogEntryEnd,
LogEntryLevel,
LogEntryStart,
default_build_logger,
)
from .template.main import TemplateBase, TemplateClass
from .template.readycmd import (
ReadyCmd,
wait_for_file,
wait_for_port,
wait_for_process,
wait_for_timeout,
wait_for_url,
)
from .template.types import (
BuildInfo,
BuildStatusReason,
CopyItem,
TemplateBuildStatus,
TemplateBuildStatusResponse,
TemplateTag,
TemplateTagInfo,
)
from .template_async.main import AsyncTemplate
from .template_sync.main import Template
__all__ = [
# API
"ApiClient",
"client",
# Connection config
"ConnectionConfig",
"ProxyTypes",
# Exceptions
"SandboxException",
"TimeoutException",
"TimeoutType",
"NotFoundException",
"AuthenticationException",
"GitAuthException",
"GitUpstreamException",
"InvalidArgumentException",
"NotEnoughSpaceException",
"TemplateException",
"BuildException",
"FileUploadException",
# Sandbox API
"SandboxInfo",
"SandboxMetrics",
"ProcessInfo",
"SandboxQuery",
"SandboxState",
"SandboxMetrics",
"GitStatus",
"GitBranches",
"GitFileStatus",
# Command handle
"CommandResult",
"Stderr",
"Stdout",
"CommandExitException",
"PtyOutput",
"PtySize",
# Filesystem
"FilesystemEvent",
"FilesystemEventType",
"EntryInfo",
"WriteInfo",
"FileType",
# Network
"SandboxNetworkOpts",
"SandboxLifecycle",
"ALL_TRAFFIC",
# Snapshot
"SnapshotInfo",
"SnapshotPaginator",
"AsyncSnapshotPaginator",
# Sync sandbox
"Sandbox",
"SandboxPaginator",
"WatchHandle",
"CommandHandle",
# Async sandbox
"OutputHandler",
"AsyncSandboxPaginator",
"AsyncSandbox",
"AsyncWatchHandle",
"AsyncCommandHandle",
# Template
"Template",
"AsyncTemplate",
"TemplateBase",
"TemplateClass",
"CopyItem",
"BuildInfo",
"BuildStatusReason",
"TemplateBuildStatus",
"TemplateBuildStatusResponse",
"TemplateTag",
"TemplateTagInfo",
"ReadyCmd",
"wait_for_file",
"wait_for_url",
"wait_for_port",
"wait_for_process",
"wait_for_timeout",
"LogEntry",
"LogEntryStart",
"LogEntryEnd",
"LogEntryLevel",
"default_build_logger",
# MCP
"McpServer",
"GitHubMcpServer",
"GitHubMcpServerConfig",
]