xtrace_sdk.utils.chunking ========================= .. py:module:: xtrace_sdk.utils.chunking Classes ------- .. autoapisummary:: xtrace_sdk.utils.chunking.ChunkingUtils Module Contents --------------- .. py:class:: ChunkingUtils A utility class for chunking text into smaller pieces. This class provides methods for splitting text into smaller chunks for embedding and encryption. A wrapper for langchain text splitters. .. py:method:: split_text(text_data, max_chunk_size = 300) :staticmethod: A helper method for splitting text data into smaller chunks. This method is used for splitting text data into smaller chunks for embedding and encryption. :param text_data: the text data to be split :type text_data: str :param max_chunk_size: the maximum size of each chunk, defaults to 300 :type max_chunk_size: int :return: a list of chunks :rtype: Iterable[str] .. py:method:: split_html(html_data) :staticmethod: A helper method for splitting HTML data into smaller chunks. This method is used for splitting HTML data into smaller chunks for embedding and encryption. :param html_data: the HTML data to be split :type html_data: str :param max_chunk_size: the maximum size of each chunk, defaults to 300 :type max_chunk_size: int :return: a list of chunks :rtype: Iterable[str] .. py:method:: split_json(json_data, max_chunk_size = 300) :staticmethod: A helper method for splitting JSON data into smaller chunks. This method is used for splitting JSON data into smaller chunks for embedding and encryption. :param json_data: the JSON data to be split :type json_data: str :param max_chunk_size: the maximum size of each chunk, defaults to 300 :type max_chunk_size: int :return: a list of chunks :rtype: Iterable[str] .. py:method:: split_markdown(markdown_data) :staticmethod: A helper method for splitting Markdown data into smaller chunks. This method is used for splitting Markdown data into smaller chunks for embedding and encryption. :param markdown_data: the Markdown data to be split :type markdown_data: str :return: a list of chunks :rtype: Iterable[str] .. py:method:: split_code(code_data, language, chunk_size) :staticmethod: A helper method for splitting code data into smaller chunks. This method is used for splitting code data into smaller chunks for embedding and encryption. :param code_data: the code data to be split :type code_data: str :param language: the language of the code data :type language: Language :return: a list of chunks :rtype: Iterable[str]