Galtea
TheGaltea class is the main entry point for the Galtea SDK. It provides access to all the functionalities of the SDK.
Initialization
To initialize theGaltea class, you need to provide your API key obtained in the settings page of the Galtea platform.
Services
TheGaltea class provides access to the following services:
products: Access product related functionalities.endpoint_connections: Access endpoint connection related functionalities.phone_connections: Access phone connection related functionalities.web_rtc_connections: Access WebRTC connection related functionalities.storage: Move files between this machine and the platform’s object storage.versions: Access version related functionalities.datasets: Access dataset related functionalities.test_cases: Access test cases related functionalities.metrics: Access metric related functionalities.models: Access model related functionalities.sessions: Access session related functionalities.traces: Access trace related functionalities.spans: Access span collection and management.evaluations: Access evaluation related functionalities.runs: Group the sessions and evaluations of one launch into a run.jobs: Inspect and cancel async jobs (e.g. inference batches started byevaluations.run()).simulator: Access conversation simulator related functionalities.
Example
Errors
Every call reaches the platform over HTTP, so a failure arrives as arequests exception.
When the platform holds nothing under the id or name you passed, the SDK raises
EntityNotFoundException. It covers every service: products.get, versions.get_by_name,
sessions.get_by_custom_id and the rest all report a missing entity the same way.
Import it with from galtea import EntityNotFoundException.
EntityNotFoundException is the name to catch. It covers both ways the SDK learns that nothing
matched, so you never have to know which one happened.
One lookup can also fail the opposite way. When a version name matches more than one version in the
product, versions.get_by_name raises AmbiguousVersionNameException
instead of picking one. Import it with from galtea import AmbiguousVersionNameException. The
message lists each match, so you can call galtea.versions.get with the ID
you want. No other service raises it.
Only a 404 that names an entity becomes
EntityNotFoundException. A 404 for a path the API does
not serve stays a plain requests.HTTPError, so a typo in a base URL never reads as a missing
record. Every other status stays a plain requests.HTTPError too.e.status_code. It is always 404.
When you need the response
The SDK learns that an entity is missing two ways, and raises a different class for each. Both areEntityNotFoundException, so catching that name is enough unless you want the difference.
EntityNotFoundHTTPError also derives from requests.HTTPError, so a program that already catches
requests.HTTPError around a get() call keeps catching it. Nothing forces you to migrate.
The plain EntityNotFoundException is not a requests.HTTPError, because no request failed: the
API answered normally and the name was simply not in the result. Reach for response only after
catching EntityNotFoundHTTPError, where it is always present.