Skip to main content
POST
/
ragc
/
{version}
Rag Citation
curl --request POST \
  --url https://api.ragbuddy.ai/ragc/{version} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'helvia-rag-buddy-token: <helvia-rag-buddy-token>' \
  --data '
{
  "remote_llm_url": "<string>",
  "user_message": "<string>",
  "system_intro": "<string>",
  "articles": [
    {
      "ID": "<string>",
      "content": "<string>"
    }
  ],
  "system_instructions": "<string>"
}
'
import requests

url = "https://api.ragbuddy.ai/ragc/{version}"

payload = {
    "remote_llm_url": "<string>",
    "user_message": "<string>",
    "system_intro": "<string>",
    "articles": [
        {
            "ID": "<string>",
            "content": "<string>"
        }
    ],
    "system_instructions": "<string>"
}
headers = {
    "helvia-rag-buddy-token": "<helvia-rag-buddy-token>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'helvia-rag-buddy-token': '<helvia-rag-buddy-token>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    remote_llm_url: '<string>',
    user_message: '<string>',
    system_intro: '<string>',
    articles: [{ID: '<string>', content: '<string>'}],
    system_instructions: '<string>'
  })
};

fetch('https://api.ragbuddy.ai/ragc/{version}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.ragbuddy.ai/ragc/{version}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'remote_llm_url' => '<string>',
    'user_message' => '<string>',
    'system_intro' => '<string>',
    'articles' => [
        [
                'ID' => '<string>',
                'content' => '<string>'
        ]
    ],
    'system_instructions' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "helvia-rag-buddy-token: <helvia-rag-buddy-token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ragbuddy.ai/ragc/{version}"

	payload := strings.NewReader("{\n  \"remote_llm_url\": \"<string>\",\n  \"user_message\": \"<string>\",\n  \"system_intro\": \"<string>\",\n  \"articles\": [\n    {\n      \"ID\": \"<string>\",\n      \"content\": \"<string>\"\n    }\n  ],\n  \"system_instructions\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("helvia-rag-buddy-token", "<helvia-rag-buddy-token>")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.ragbuddy.ai/ragc/{version}")
  .header("helvia-rag-buddy-token", "<helvia-rag-buddy-token>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"remote_llm_url\": \"<string>\",\n  \"user_message\": \"<string>\",\n  \"system_intro\": \"<string>\",\n  \"articles\": [\n    {\n      \"ID\": \"<string>\",\n      \"content\": \"<string>\"\n    }\n  ],\n  \"system_instructions\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.ragbuddy.ai/ragc/{version}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["helvia-rag-buddy-token"] = '<helvia-rag-buddy-token>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"remote_llm_url\": \"<string>\",\n  \"user_message\": \"<string>\",\n  \"system_intro\": \"<string>\",\n  \"articles\": [\n    {\n      \"ID\": \"<string>\",\n      \"content\": \"<string>\"\n    }\n  ],\n  \"system_instructions\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "content": "<string>",
        "role": "<unknown>",
        "function_call": {
          "arguments": "<string>",
          "name": "<string>"
        },
        "tool_calls": [
          {
            "id": "<string>",
            "function": {
              "arguments": "<string>",
              "name": "<string>"
            },
            "type": "<unknown>"
          }
        ]
      }
    }
  ],
  "created": 123,
  "model": "<string>",
  "object": "<unknown>",
  "system_fingerprint": "<string>",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

helvia-rag-buddy-token
string
required

Path Parameters

version
string
required

Version of the API to use

Allowed value: "v1"

Body

application/json
remote_llm_url
string
required
user_message
string
required
system_intro
string
required
articles
Article · object[]
required
system_instructions
string | null

Response

Successful Response

id
string
required
choices
Choice · object[]
required
created
integer
required
model
string
required
object
any
required
system_fingerprint
string | null
usage
CompletionUsage · object | null