Utils
get_sentence_based_splitter
get_sentence_based_splitter(
min_sentence_length: int = 20,
) -> Callable[[str], tuple[str, str]]
Returns a function that splits text into chunks based on sentence boundaries.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_sentence_length
|
int
|
The minimum length of a sentence to be included in a chunk. |
20
|
Returns:
Type | Description |
---|---|
Callable[[str], tuple[str, str]]
|
A function that splits text into chunks based on sentence boundaries. |
Source code in src/cai/sdk/agents/voice/utils.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|