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:
Header
Required
Example Value
Description
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
Parameter
Type
Required
Description
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.
Description: Deletes an active session identified by the provided session ID, ending any ongoing session-interactions with SLM.
Headers:
Header
Required
Example Value
Description
X-Api-Key
Yes
your_token
API Key for authentication.
Path Parameters:
Parameter
Type
Required
Description
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
API Button
Copy your personal token by clicking copy button
Token
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.
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.
curl -X POST "https://api.assisterr.ai/api/v1/slm/solana_assistant/session/1234567891234/chat/"
-H "X-Api-Key: <your-token>"
-H "Content-Type: application/json" -d '{
"query": "What is Solana?"
}'
{
"message":"Solana is a blockchain built for mass adoption. It's a high-performance network that is utilized for a range of use cases, including finance, NFTs, payments, and gaming. Solana operates as a single global state machine and is open, interoperable and decentralized.\n\nYou can learn more about Solana from the official Solana documentation: https://docs.solana.com/",
"message_at":"2024-12-11T19:01:16.972013",
"is_user":false
}
curl -X POST "https://api.assisterr.ai/api/v1/slm/solana_assistant/session/1234567891234/chat/"
-H "X-Api-Key: <your-token>"
-H "Content-Type: application/json" -d '{
"query": "What was my first question?"
}'
{
"message":"Your first question was \"What is Solana?\"",
"message_at":"2024-12-11T19:02:18.205151",
"is_user":false
}
curl -X GET "https://api.assisterr.ai/api/v1/slm/solana_assistant/session/list/"
-H "X-Api-Key: <your-token>"
-H "Content-Type: application/json"
curl -X GET "https://api.assisterr.ai/api/v1/slm/solana_assistant/session/1234567891234/history/"
-H "X-Api-Key: <your-token>"
-H "Content-Type: application/json"
[
{
"_id":"message_id",
"slm_agent_id":"slm_agent_id",
"uid":"user_id",
"is_user":false,
"slm_session_id":"slm_session_id",
"ident":"private_api",
"source":"web",
"query":"Your first question was \"What is Solana?\"",
"created_at":"2024-12-11T19:02:18.198000"
},
{
"_id":"message_id",
"slm_agent_id":"slm_agent_id",
"uid":"user_id",
"is_user":true,
"slm_session_id":"slm_session_id",
"ident":"public_api",
"source":"web",
"query":"What was my first question?",
"created_at":"2024-12-11T19:02:18.185000"
},
{
"_id":"message_id",
"slm_agent_id":"slm_agent_id",
"uid":"user_id",
"is_user":false,
"slm_session_id":"slm_session_id",
"ident":"private_api",
"source":"web",
"query":"Solana is a blockchain built for mass adoption. It's a high-performance network that is utilized for a range of use cases, including finance, NFTs, payments, and gaming. Solana operates as a single global state machine and is open, interoperable and decentralized.\n\nYou can learn more about Solana from the official Solana documentation: https://docs.solana.com/",
"created_at":"2024-12-11T19:01:16.967000"
},
{
"_id":"message_id",
"slm_agent_id":"slm_agent_id",
"uid":"user_id",
"is_user":true,
"slm_session_id":"slm_session_id",
"ident":"public_api",
"source":"web",
"query":"What is Solana?",
"created_at":"2024-12-11T19:01:16.957000"
}
]