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
227 228 |
|
logger
instance-attribute
logger: Logger
close
abstractmethod
async
close() -> CloseResponse
Closes the runtime.
Source code in swerex/runtime/abstract.py
272 273 274 275 |
|
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
247 248 249 250 |
|
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
235 236 237 238 |
|
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
252 253 254 255 |
|
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
230 231 232 233 |
|
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
257 258 259 260 |
|
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
240 241 242 243 244 245 |
|
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
267 268 269 270 |
|
write_file
abstractmethod
async
write_file(request: WriteFileRequest) -> WriteFileResponse
Writes a string to a file.
Source code in swerex/runtime/abstract.py
262 263 264 265 |
|