Skip to main content
The get_file() method retrieves a file from your sandbox’s filesystem and returns its contents.
Depending on the type of file, you can read the data as text, binary bytes, or even parse it as JSON.
All file paths must start with the absolute path /home/damner to ensure access is limited to the sandbox’s isolated workspace.
If the requested file doesn’t exist or the path is invalid, an error will be raised.

async get_file(path: str) -> httpx.Response

Description:
Retrieves a file from the sandbox filesystem. Returns an httpx.Response object that you can use to read the content as text, bytes, or parse as JSON.

Parameters:
Returns:
httpx.Response: Response object with the following methods:
  • .text - Read as string (property)
  • .content - Read as bytes (property)
  • .read() - Read as bytes (method)
  • .json() - Parse as JSON (method)
Raises an exception if the file does not exist or the path is invalid.
Examples