Creating A New Chat
ReLLM can create and manage chats between your users and the LLM.
Context for the chat will be limited to the user's permissions. If you want to further restrict a chat, perhaps to a set of documents, you can use the options: permissions: argument to limit the context beyond just user permissions.
- URL: https://rellm.ai/api/chat (opens in a new tab)
- Method: POST
- Headers:
- Authorization: Bearer "Your api token"
- data:
- user_id: string representation of your user
- messages: array of initial messages for chat
- options?: optional argument
- permissions?: List of permissions to further restrict chats context
JS Package
import ReLLM from "rellm";
const rellm = new ReLLM(process.env.RELLM_API_KEY)
rellm.createChat(user_id, permission, {permissions: ['document 1', 'document 2']})