The splitter.py
module#
Summary#
Endpoint for splitting text in a PowerPoint document into chunks. |
|
Endpoint for splitting Python code into chunks. |
|
Endpoint for splitting text in a PDF document into chunks. |
|
Process a PowerPoint document to split text into chunks. |
|
Process Python code to split text into chunks. |
|
Process a PDF document to split text into chunks. |
|
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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’
- api_key
str
The API key for authentication.
- request
- 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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’
- api_key
str
The API key for authentication.
- request
- 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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’.
- api_key
str
The API key for authentication.
- request
- 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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’
- request
- 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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’
- request
- 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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’
- request
- 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:
- request
SplitterRequest
An object containing ‘document_content’ in Base64, ‘chunk_size’, and ‘chunk_overlap’
- api_key
str
The API key for authentication.
- request
- 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#