Beta The Limina container introduced a websocket endpoint in versionDocumentation Index
Fetch the complete documentation index at: https://docs.getlimina.ai/llms.txt
Use this file to discover all available pages before exploring further.
3.6.0 to allow users to send requests and receive responses with a single connection. Read more about Websockets here.
It is recommended to use the REST endpoints unless there are specific requirements for websocket.Websockets are available on the Limina container only.
How to use the websocket endpoint
The websocket endpoint can be used directly from the container if it is deployed as a single instance. The websocket endpoint requires additional setup and consideration in your infrastructure to be usable when the container is served behind a production load balancer. The websocket endpoint is available in the container by sending a connection request to the/ws endpoint. This can be done with a websocket library such as websocket-client for Python, or simply by utilizing the Websockets API directly in Javascript.
Quickstart example
The following is a simple example written in Python to use the websocket endpoint:Websocket Example
Example Output
Websocket Payloads
The websocket endpoint expects a JSON payload just like the REST API in exactly the same format with all the of the parameters from the REST API supported in the same way. The main difference with the websocket endpoint is that thetext parameter does NOT support a list; we’re expecting single request and response exchanges with the container!
Below are some examples of payloads and their expected outputs:
Websocket Call With JSON payload
Websocket Call with Masked Entities