Sending And Retrieving Chat Messages
When your user sends a new message to the chat, ReLLM will handle the conversation with the LLM, provide context, and respond with the LLM's answer to your user.
- URL: https://rellm.ai/api/chat/chat_id (opens in a new tab)
- Method: PATCH
- Headers:
- Authorization: Bearer "Your api token"
- data:
- message: "Your user's message"
- user_id: string representation for your user
- threshold: value between 0 and 1 to tell the AI how random to be. 0 is lowest, 1 is max
JS Package
import ReLLM from "rellm";
const rellm = new ReLLM(process.env.RELLM_API_KEY)
rellm.chat(user_message, user_id, threshold, chat_id)