
    *`iN                     R    d e e         dedede ee e         ef                  fdZdS )tokensbegin_think_token_idend_think_token_idreturnc                    | sg S g }g }d}| D ]}||k    r|rt          d          ||k    r3|r|                    |df           g }d}|                    |           R||k    rB|st          d          |                    |           |                    |df           g }d}|                    |           |r|                    ||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tokens          u/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/mistral_common/experimental/think.py_split_content_and_think_chunksr      s9     	35N!#ON * *(((^(CDDD*** %%%&>???"$!N""5))))(((! W !UVVV""5)))!!?D"9::: O"NN""5)))) A?@@@    N)listinttupleboolr    r   r   <module>r      sY   +I+-0+FI+	%S	4
 !+ + + + + +r   