How To
Update prompt
Adjust the context quality
If your chatbot is negatively affected by the provided context, you can adjust the context quality using the similarityThreshold
option. The similarityThreshold is a number between 0 and 1, with a default value of 0.5. Increasing this value will improve quality, but the chatbot may reject more queries due to lack of relevant data.
Disable RAG to bypass context
When RAG disabled, RAG chat skips the vector store and directly sends the question to the LLM model.
Enable debug logs
Access the context
You can access and update the context by using the onContextFetched
callback. This callback is called after the context is fetched from the vector store before the prompt is sent to the LLM.
Access the chat history
You can access chat history by using the onChatHistoryFetched
callback. This callback is called after the chat history is fetched from the Redis (or memory) before the prompt is sent to the LLM.
Add metadata into context
You can add metadata while you are inserting a message into the context. The array of metadata fetched from context will be returned with response.
Access the ratelimit details
You can see how much allowance a user has by using the ratelimitDetails hook.
Access the output during streaming
You can access, read, or modify your streamed data.