GET /v1/rag-chunkRAG text chunker advanced
Agent Tools lf-agent-tools
Cuts long text into smaller pieces an AI can search through. Chunks by word, sentence, paragraph, or semantic using chunk_size and overlap. Returns chunks with metadata, total_chunks, total_tokens, and recommended_model.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to chunk |
chunk_size | integer | No | Target chunk size |
overlap | integer | No | Overlap size |
chunk_by | string | No | word, sentence, paragraph, or semantic |
Response Schema
chunks (array): Chunks with metadata
total_chunks (integer): Chunk count
total_tokens (integer): Total token estimate
recommended_model (string): Suggested model
cURL Example
curl 'https://lf-agent-tools.laminarforge.dev/v1/rag-chunk?text=<text>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-agent-tools.laminarforge.dev/v1/rag-chunk'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'text': '<text>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())