Abstract
swerex.runtime.abstract.AbstractRuntime
AbstractRuntime(*args: Any, **kwargs: Any)
Bases: ABC
This is the main entry point for running stuff.
It keeps track of all the sessions (individual repls) that are currently open.
Source code in swerex/runtime/abstract.py
240 241 |
|
logger
instance-attribute
logger: Logger
close
abstractmethod
async
close() -> CloseResponse
Closes the runtime.
Source code in swerex/runtime/abstract.py
285 286 287 288 |
|
close_session
abstractmethod
async
close_session(request: CloseSessionRequest) -> CloseSessionResponse
Closes a shell session (e.g., a bash shell that we started earlier).
Source code in swerex/runtime/abstract.py
260 261 262 263 |
|
create_session
abstractmethod
async
create_session(request: CreateSessionRequest) -> CreateSessionResponse
Creates a new session (e.g., a bash shell).
Source code in swerex/runtime/abstract.py
248 249 250 251 |
|
execute
abstractmethod
async
execute(command: Command) -> CommandResponse
Executes a command (in a sub-shell, similar to subprocess.run()
).
Source code in swerex/runtime/abstract.py
265 266 267 268 |
|
is_alive
abstractmethod
async
is_alive(*, timeout: float | None = None) -> IsAliveResponse
Checks if the runtime is alive and running.
Source code in swerex/runtime/abstract.py
243 244 245 246 |
|
read_file
abstractmethod
async
read_file(request: ReadFileRequest) -> ReadFileResponse
Reads a file and returns the content as a string.
Source code in swerex/runtime/abstract.py
270 271 272 273 |
|
run_in_session
abstractmethod
async
run_in_session(action: Action) -> Observation
Runs a command in a session (e.g., a bash shell).
The name of the session is determined by the session
field in the Action
.
Source code in swerex/runtime/abstract.py
253 254 255 256 257 258 |
|
upload
abstractmethod
async
upload(request: UploadRequest) -> UploadResponse
Uploads a file from the local machine to the remote machine.
Source code in swerex/runtime/abstract.py
280 281 282 283 |
|
write_file
abstractmethod
async
write_file(request: WriteFileRequest) -> WriteFileResponse
Writes a string to a file.
Source code in swerex/runtime/abstract.py
275 276 277 278 |
|