
    .`i                        U d dl mZmZ d dlmZmZmZ d dlmZ d dl	m
Z
 d dlmZ  G d de          Z G d d	e          Zeez  Zeed
<    G d de          Z G d de          Z G d de          Z G d de          ZdS )    )Any	TypeAlias)
ConfigDictFieldmodel_validator)ChatCompletionMessageParam)ChatCompletionToolsParam)OpenAIBaseModelc                   |    e Zd ZU dZedz  ed<   eed<    edd          Zeed<    edd	          Z	edz  ed
<   dS )TokenizeCompletionRequestNmodelpromptTzMIf true (the default), special tokens (e.g. BOS) will be added to the prompt.defaultdescriptionadd_special_tokensFFIf true, also return the token strings corresponding to the token ids.return_token_strs)
__name__
__module____qualname__r   str__annotations__r   r   boolr        |/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/entrypoints/serve/tokenize/protocol.pyr   r      s         E3:KKK$u         &+UT& & &td{     r   r   c                      e Zd ZU dZedz  ed<   ee         ed<    edd          Z	e
ed<    edd	          Ze
dz  ed
<    edd          Ze
ed<    edd          Ze
ed<    edd          Zedz  ed<    edd          Zeeef         dz  ed<    edd          Zeeef         dz  ed<    edd          Zee         dz  ed<    ed          ed                         ZdS )TokenizeChatRequestNr   messagesTzIf true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.r   add_generation_promptFr   r   a:  If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model's response for it. Cannot be used at the same time as `add_generation_prompt`.continue_final_messagezIf true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).r   zA Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.chat_templatezbAdditional keyword args to pass to the template renderer. Will be accessible by the chat template.chat_template_kwargsz.Additional kwargs to pass to the HF processor.mm_processor_kwargsz#A list of tools the model may call.toolsbefore)modec                 x    |                     d          r$|                     d          rt          d          |S )Nr"   r!   zMCannot set both `continue_final_message` and `add_generation_prompt` to True.)get
ValueError)clsdatas     r   check_generation_promptz+TokenizeChatRequest.check_generation_promptf   sK     88,-- 	$((;R2S2S 	3   r   )r   r   r   r   r   r   listr   r   r!   r   r   r"   r   r#   r$   dictr   r%   r&   r	   r   classmethodr.   r   r   r   r   r   '   s#        E3:-...."'%# # #4    &+UT& & &td{    $)5J	$ 	$ 	$D 	 	 	  %u	  	  	  	 	 	 !&#! ! !M3:    38%73 3 3$sCx.4/    27D2 2 2c3h$.    49594 4 4E4()D0   
 _(###  [ $#  r   r   TokenizeRequestc                   Z    e Zd ZU eed<   eed<   ee         ed<   dZee         dz  ed<   dS )TokenizeResponsecountmax_model_lentokensN
token_strs)r   r   r   intr   r/   r8   r   r   r   r   r4   r4   t   sP         JJJI#'JS	D '''''r   r4   c                   :    e Zd ZU dZedz  ed<   ee         ed<   dS )DetokenizeRequestNr   r7   )r   r   r   r   r   r   r/   r9   r   r   r   r;   r;   {   s6         E3:Ir   r;   c                       e Zd ZU eed<   dS )DetokenizeResponser   N)r   r   r   r   r   r   r   r   r=   r=      s         KKKKKr   r=   c                   6    e Zd ZU dZ ed          Zeed<   dS )TokenizerInfoResponsez]
    Response containing tokenizer configuration
    equivalent to tokenizer_config.json
    allow)extratokenizer_classN)r   r   r   __doc__r   model_configr   r   r   r   r   r?   r?      s<          
 :G,,,Lr   r?   N)typingr   r   pydanticr   r   r   vllm.entrypoints.chat_utilsr   0vllm.entrypoints.openai.chat_completion.protocolr	   'vllm.entrypoints.openai.engine.protocolr
   r   r   r2   r   r4   r;   r=   r?   r   r   r   <module>rJ      s  
 " ! ! ! ! ! ! ! ! 7 7 7 7 7 7 7 7 7 7               
       &G G G G G/ G G GT 79LL L L L( ( ( ( ( ( ( (       
           O     r   