Entities
Entities are the SDK’s interface to the Rhesis platform. They provide typed Python objects that map directly to platform resources, enabling you to create, read, update, and delete data programmatically. Entities are used throughout the SDK—for example, synthesizers generate a TestSet entity that contains multiple Test entities.
Prerequisites: To work with entities from app.rhesis.ai , ensure you have configured the SDK with your API key.
Available Entities
| Entity | Description |
|---|---|
| Behavior | Expected behaviors with associated metrics |
| Category | Test categorization |
| Topic | Subject matter classification |
| Status | Entity state tracking |
| Test | Individual test cases with prompts |
| TestSet | Collections of tests for evaluation |
| TestRun | Execution records for test batches |
| TestResult | Individual test execution results |
| TestConfiguration | Settings for test execution |
| Endpoint | AI services to test against |
Entity vs Collection Classes
The SDK uses two class patterns:
- Entity classes (
TestSet,Test,Endpoint): Represent single records. Use for creating, updating, and deleting individual items. - Collection classes (
TestSets,Tests,Endpoints): Provide query methods. Use for fetching and searching records.
Common Operations
All entities share a consistent interface for CRUD operations. Each entity class has a corresponding collection class (e.g., TestSet and TestSets) for querying multiple records.
Fetching Entities
Retrieve entities from the platform using the collection class:
Filtering Results
Use OData filter syntax to query specific records:
Creating Entities
Create new entities locally and save them to the platform with push():
Updating Entities
Modify entity attributes and call push() to save changes:
Refreshing from Platform
Use pull() on an instance to refresh its data from the platform:
Deleting Entities
Remove entities from the platform:
Checking Existence
Verify if an entity exists without fetching full data:
Data Export
Entities support conversion to dictionaries and CSV files: