v21

latestOpenAPI 3.1.0raw.githubusercontent.com2025-05-22122299.2 KB

Overlap Refinery

Adds overlapping context (prefix or suffix) to a list of provided chunks based on specified arguments.

post/v1/refine/overlap

Request body

tokenizer_or_token_counterstring

Tokenizer identifier (e.g., 'gpt2') or 'character' for character counting.

mode'token' | 'recursive'

Mode for calculating overlap ('token' or 'recursive').

method'suffix' | 'prefix'

Method for adding context ('suffix' from next, 'prefix' from previous).

rulesobject

Recursive rules definition (object representation) if mode is 'recursive'.

mergeboolean

If true, merge context into chunk text; otherwise, store in 'context' field.

Response

Successful Response: A list of Chunk objects with added overlap context.

textstring

The actual text content of the chunk.

start_indexinteger

The starting character index of the chunk within the original input text.

end_indexinteger

The ending character index (exclusive) of the chunk within the original input text.

token_countinteger

The number of tokens in this specific chunk, according to the tokenizer used.

contextstring nullable

Chunk context.