This section guides you through integrating RAG-Buddy into your LLM pipeline using the REST API Endpoint, detailing the steps for a more customized and controlled implementation.
/ragc
Endpointhttps://api.ragbuddy.ai/ragc/v1
/ragc
Endpoint/ragc
endpoint implements versioning in its URL path, ensuring stable and predictable interactions with the RAG-Buddy service. The current version, designated as /ragc/v1
, is established to be backward-compatible. This means that the v1
interface, encompassing its features and functionalities, will remain consistent and unchanged.As RAG-Buddy evolves, new versions may be introduced to include advanced features or improvements. These will be accessible under different version paths (e.g., /ragc/v2
). Importantly, new versions will not affect the existing v1
endpoint, allowing your current integrations to continue operating seamlessly.We are dedicated to keeping our users informed about updates. New version releases and significant changes will be communicated through email notifications and posts on our blog, enabling users to stay updated and plan their transition to newer versions at their convenience./ragc
Endpoint - Request/ragc
endpoint in RAG-Buddy’s REST API is designed for handling requests specific to a RAG with citations use case.A complete request to the /ragc
endpoint consists of the following elements:messages
fields of the LLM.https://api.openai.com/v1/chat/completions
You are a customer support agent of the e-banking application called Piggy Bank Extraordinaire.
What are the interest rates for the Gold Plus Savings Account?
/ragc
Endpoint - Responseanswer
and article_id
.answer
and article_id
are not returned explicitely for a streaming response. In that case these values need to be parsed by the client from the choices.message.content
response field./ragc
endpoint:model
and messages
. The messages
field is constructed from the fields in the previous section. Don’t send the messages
field explicitly in the request body.
model
field you probably want to send the temperature
field as well. This field controls the randomness of the LLM. The higher the temperature, the more random the LLM will respond. To make use of the RAG-Buddy Cache, we recommend setting the temperature
to 0.0.
RAG-Buddy supports streaming responses from the LLM. To enable this, set the stream
field to true
.
Content-Type: application/json
Authorization: Bearer $OPENAI_API_KEY
Helvia-RAG-Buddy-Token: RAG_CA_**********
Helvia-RAG-Buddy-Cache-Control: <...>
Set this header to no-cache
to disable reading from the RAG-Buddy Cache. To disable writing set it to no-write
; disable both set it to no-cache, no-write
. By default, reading and writing from/to the RAG-Buddy Cache is enabled.Helvia-RAG-Buddy-Cache-Status
. This header indicates whether the RAG-Buddy Cache was used for this request. If the header is returned it means there was a cache hit. The actual value of the header is the (internally used) cache key that was used to retrieve the context from the cache.