POST
/
v1
/
tools
/
context-aware-splitting
curl --location --request POST https://api.writer.com/v1/tools/context-aware-splitting \
 --header "Authorization: Bearer <token>" \
 --header "Content-Type: application/json" \
--data-raw '{"text":"text to split","strategy":"llm_split"}'
{
  "chunks": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
text
string
required

The text to be split into chunks.

strategy
enum<string>
required

The strategy to be used for splitting the text into chunks. llm_split uses the language model to split the text, fast_split uses a fast heuristic-based approach, and hybrid_split combines both strategies.

Available options:
llm_split,
fast_split,
hybrid_split

Response

200 - application/json
chunks
string[]
required

An array of text chunks generated by splitting the input text based on the specified strategy.