Connection of Caila services
All services in Caila are primarily intended for use through the API for integration into applications.
Connection methods
Access to Caila services can be obtained in several ways:
- via HTTP through Caila API;
- via GRPC;
- through adapters simulating APIs of widely known cloud services:
- OpenAI API;
- OpenAI-direct API;
- Yandex SpeechKit API for TTS services;
- using Python SDK;
- using Java SDK.
See detailed descriptions of each option on the nested pages.
General conditions
To access any ML service, you will need the following elements:
- Service identifier, for example,
just-ai/claude
. The identifier always consists of two parts:<author>/<service>
. The service identifier can be found on the page in the Catalogue or by copying the last two elements from the URL of the service page. - API key. Keys are created in the Workspace.
- The type of request and response data, as well as examples of request. This information is usually provided on the service page in the Catalogue.
Contract for Caila service
Common to all ML services is that all services implement a single method, predict. The method signature, simplified, looks like this:
fun <PredictRequest, PredictConfig, PredictResponse>
predict(request: PredictRequest, config: PredictConfig?): PredictResponse
The data types PredictRequest
, PredictConfig
, PredictResponse
are template types. I.e. the predict method is named the same across all services and has the same number of parameters, but the specific request and response types may vary for each service.
The specification for the predict method can be found in the Caila API. The specification includes several variations of the /predict method. They differ only in the way parameters are passed, but essentially perform the same operation.
The specifications for types PredictRequest
, PredictConfig
, PredictResponse
for each specific service can be found on its page in the Catalogue. For example: https://caila.io/catalog/just-ai/openai-proxy.
Task types
The concept of task-type in Caila defines the structure of the PredictRequest
and PredictResponse
types. Services of a given
task-type must use the data types specified in that task-type.