The splitter.py module#

Summary#

split_ppt

Endpoint for splitting text in a PowerPoint document into chunks.

split_py

Endpoint for splitting Python code into chunks.

split_pdf

Endpoint for splitting text in a PDF document into chunks.

process_ppt

Process a PowerPoint document to split text into chunks.

process_python_code

Process Python code to split text into chunks.

process_pdf

Process a PDF document to split text into chunks.

validate_request

Validate the splitter request and API key.

Description#

Module for splitting text into chunks.

Module detail#

async splitter.split_ppt(request: allie.flowkit.models.splitter.SplitterRequest, api_key: str = Header(...)) allie.flowkit.models.splitter.SplitterResponse#

Endpoint for splitting text in a PowerPoint document into chunks.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’

api_keystr

The API key for authentication.

async splitter.split_py(request: allie.flowkit.models.splitter.SplitterRequest, api_key: str = Header(...)) allie.flowkit.models.splitter.SplitterResponse#

Endpoint for splitting Python code into chunks.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’

api_keystr

The API key for authentication.

Returns:
SplitterResponse

An object containing a list of text chunks.

async splitter.split_pdf(request: allie.flowkit.models.splitter.SplitterRequest, api_key: str = Header(...)) allie.flowkit.models.splitter.SplitterResponse#

Endpoint for splitting text in a PDF document into chunks.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’.

api_keystr

The API key for authentication.

Returns:
SplitterResponse

An object containing a list of text chunks.

splitter.process_ppt(request: allie.flowkit.models.splitter.SplitterRequest) allie.flowkit.models.splitter.SplitterResponse#

Process a PowerPoint document to split text into chunks.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’

Returns:
SplitterResponse

An object containing a list of text chunks.

splitter.process_python_code(request: allie.flowkit.models.splitter.SplitterRequest) allie.flowkit.models.splitter.SplitterResponse#

Process Python code to split text into chunks.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’

Returns:
SplitterResponse

An object containing a list of text chunks.

splitter.process_pdf(request: allie.flowkit.models.splitter.SplitterRequest) allie.flowkit.models.splitter.SplitterResponse#

Process a PDF document to split text into chunks.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’

Returns:
SplitterResponse

An object containing a list of text chunks.

splitter.validate_request(request: allie.flowkit.models.splitter.SplitterRequest, api_key: str)#

Validate the splitter request and API key.

Parameters:
requestSplitterRequest

An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’

api_keystr

The API key for authentication.

Raises:
HTTPException

If the API key is invalid or if any of the request parameters are invalid.

splitter.TOKEN_TO_CHARACTER_MULTIPLIER = 4#
splitter.router#