Assisterr SLM Integration
The Assisterr SLM Integration allows users to interact with the Small Language Model (SLM) through a set of API endpoints.
You can check API documenation here.
Base URL
All requests should be made to the following base URL:
Authentication
To authenticate API requests, you must include your API key in the X-Api-Key header for each request.
Endpoints
[POST] /api/v1/slm/{handle_name}/chat/
Description: Sends a query to SLM (Stateful Language Model) and retrieves a response without maintaining any session history.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the slm.
Request Body (JSON):
[POST] /api/v1/slm/{handle_name}/chat/stream/
Description: Sends a query to SLM and retrieves a streaming response (via SSE), without maintaining any session history.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the slm.
Request Body (JSON):
[POST] /api/v1/slm/{handle_name}/session/create/
Description: Creates a new session and returns a unique session ID for further interaction with SLM.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the slm.
Respponse Body (JSON):
[POST] /api/v1/slm/{handle_name}/session/{slm_session_id}/chat/
Description: Sends a query to SLM within a specific session, receiving a response while maintaining session history.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the slm.
slm_session_id
string
Yes
Unique session identifier.
Request Body (JSON):
[POST] /api/v1/slm/{handle_name}/session/{slm_session_id}/chat/stream/
Description: Sends a query to SLM within a specific session and retrieves a streaming response (via SSE), while maintaining session history for context during the interaction.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the SLM.
slm_session_id
string
Yes
Unique session identifier.
Request Body (JSON):
[GET] /api/v1/slm/{handle_name}/session/list/
Description: Retrieves a list of all active sessions associated with the given handle name.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the SLM.
slm_session_id
string
Yes
Unique session identifier.
[GET] /api/v1/slm/{handle_name}/session/{slm_session_id}/history/
Description: Retrieves the conversation history for a specific session, providing context for the ongoing interactions.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the SLM.
slm_session_id
string
Yes
Unique session identifier.
[DELETE] /api/v1/slm/{handle_name}/session/{slm_session_id}/
Description: Deletes an active session identified by the provided session ID, ending any ongoing session-interactions with SLM.
Headers:
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
handle_name
string
Yes
Unique identifier for the SLM.
slm_session_id
string
Yes
Unique session identifier.
Example
To obtain your personal token, follow these steps:
Navigate to the AI Lab page:
Go to the AI Lab page.
Click on API button
Click on API Button to obtain your personal token
Copy your personal token by clicking copy button
To obtain the handle_name
, follow these steps:
Navigate to the SLM page:
Go to the SLM page.
Extract
handle_name
:Inside the URL, you will find a parameter called
handle_name
.
Send a query
Sends a question to Solana Assistant API to get a response.
Example curl
Create a session
Starts a new session with the Solana Assistant API for tracking conversation.
Example curl
Send a query using sessions
Sends a query to an active session, maintaining conversation context.
Example curl
Response
Example curl
Response
Retrieve list of sessions
Fetches all active sessions for the Solana Assistant.
Example curl
Response
Retrieve history
Retrieves the history of interactions for a specific session.
Example curl
Response
Delete session
Deletes an existing session with the Solana Assistant API.
Example curl
Response
Conclusion
Assisterr SLM Integration makes it easy for developers to use the Small Language Model in their applications. With simple API endpoints for querying, session management, and streaming responses, it provides a powerful and straightforward way to enhance app functionality.
Last updated