cURL
curl --request POST \ --url https://api.example.com/v1/pipeline/{slug}
{ "chunks": [ { "text": "<string>", "start_index": 123, "end_index": 123, "token_count": 123, "context": "<string>", "embedding": [ {} ] } ] }
Execute a pipeline on text or file input
from chonkie.cloud import Pipeline # Execute with text pipeline = Pipeline.get("my-rag-pipeline") chunks = pipeline.run(text="Your document text here...") # Execute with multiple texts chunks = pipeline.run(text=["First document", "Second document"]) # Execute with file (auto-uploaded) chunks = pipeline.run(file="document.pdf") # Access chunk data for chunk in chunks: print(f"Text: {chunk.text[:100]}...") print(f"Tokens: {chunk.token_count}")
Show child attributes
text
file
Was this page helpful?