Upload Text
This endpoint is used to directly upload text content to RAG API.
POST/upload_text
Request Body
- Name
contents- Required
Required- Type
- string
- Description
The text content to upload. Minimum length:
5.
- Name
name- Type
- string
- Description
The name of the content.
- Name
chunk_size- Type
- integer
- Description
The chunk size (in tokens) applied when splitting the document.
- Name
chunk_overlap- Type
- integer
- Description
The chunk overlap (in tokens) applied when splitting the document.
Before you can make requests to the AI Tutor RAG API, you will need to grab your API key from your dashboard.
JavaScript
const res = await fetch("hhttps://rag-api-beta-aitutor-server.up.railway.app/upload_text", {
method: "POST",
headers: {
"Content-Type": "application/json",
authorization: apiKey,
},
body: JSON.stringify({ name, contents }),
});
Response
{
"success": true,
"message": "Text uploaded and processed successfully",
"file_id": "939b2cd7-56d5-4c44-b491-14bfc202e9a0"
}
