File Attachments in SDK Connector Endpoints
Rhesis passes file attachments through SDK connector executions as metadata-rich references instead of embedding raw bytes in the WebSocket payload. Use FileReference when your endpoint needs uploaded images, PDFs, audio, or other supported files during test execution.
Prefer extracted_text when it is enough for your use case. Fetch raw bytes only when your endpoint must inspect the original file.
How files reach your function
Add files to your endpoint’s request mapping and type the function argument as a list of FileReference objects:
FileReference fields
| Field | Type | Description |
|---|---|---|
id | str | File identifier in Rhesis |
filename | str | Original filename |
content_type | str | MIME type such as image/png or application/pdf |
size_bytes | int | File size in bytes |
content_hash | str | SHA-256 digest of the file bytes |
storage_path | str | None | Internal object-storage path when available |
signed_url | str | None | Temporary URL for raw byte reads |
extracted_text | str | None | Text or image description extracted at upload time |
Reading bytes on demand
Most endpoints should use extracted_text. If you need the original bytes, call read_bytes() from synchronous code or aread_bytes() from async code.
read_bytes() and aread_bytes() require a populated signed_url. During platform-initiated test execution, the backend signs URLs before passing FileReference objects to SDK code that needs raw bytes.