o
    *iN                     @   s2   d e e dedede ee e ef  fddZdS )tokensbegin_think_token_idend_think_token_idreturnc                 C   s   | sg S g }g }d}| D ]C}||kr|rt d||kr/|r'||df g }d}|| q||krJ|s9t d|| ||df g }d}q|| q|rY|||f |S )a  Split the content and think chunks from a list of tokens.

    Args:
        tokens: list of tokens.
        begin_think_token_id: The token id for the begin think token.
        end_think_token_id: The token id for the end think token.

    Returns:
        list of tuples, where each tuple contains a list of tokens and a boolean indicating if the chunk is a think
        chunk.
    Fz$Nested think chunks are not allowed.Tz2End think token found without a begin think token.)
ValueErrorappend)r   r   r   content_chunkscurrent_contentin_think_chunktoken r   ^/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/mistral_common/experimental/think.py_split_content_and_think_chunks   s2   
r   N)listinttupleboolr   r   r   r   r   <module>   s    