o
    áÙ·iý  ã                   @   sž   d Z ddlmZ ddlZddlZddlmZmZmZ G dd„ dej	ƒZ
G dd„ dej	ƒZG d	d
„ d
ej	ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z"
Engine components for vLLM-Omni.
é    )ÚAnyN)ÚEngineCoreOutputÚEngineCoreOutputsÚEngineCoreRequestc                   @   s.   e Zd ZU dZeed< ee ed< eed< dS )ÚPromptEmbedsPayloadzÏSerialized prompt embeddings payload for direct transfer.

    data: raw bytes of the tensor in row-major order
    shape: [seq_len, hidden_size]
    dtype: torch dtype name (e.g., "float16", "float32")
    ÚdataÚshapeÚdtypeN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚbytesÚ__annotations__ÚlistÚintÚstr© r   r   úM/home/ubuntu/.local/lib/python3.10/site-packages/vllm_omni/engine/__init__.pyr      s
   
 r   c                   @   sZ   e Zd ZU dZdZedB ed< dZee	 dB ed< dZ
edB ed< dZee dB ed< dS )ÚAdditionalInformationEntryzãOne entry of additional_information.

    Two supported forms are encoded:
      - tensor: data/shape/dtype
      - list: a Python list (msgspec-serializable)
    Exactly one of (tensor_data, list_data) should be non-None.
    NÚtensor_dataÚtensor_shapeÚtensor_dtypeÚ	list_data)r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   
 	r   c                   @   s"   e Zd ZU dZeeef ed< dS )ÚAdditionalInformationPayloadz‡Serialized dictionary payload for additional_information.

    Keys are strings; values are encoded as AdditionalInformationEntry.
    ÚentriesN)r
   r   r   r   Údictr   r   r   r   r   r   r   r   /   s   
 r   c                   @   s2   e Zd ZU dZdZedB ed< dZedB ed< dS )ÚOmniEngineCoreRequesta(  Engine core request for omni models with embeddings support.

    Extends the base EngineCoreRequest with support for prompt embeddings
    and additional information payloads, enabling direct transfer of
    pre-computed embeddings between pipeline stages.

    Attributes:
        prompt_embeds: Optional serialized prompt embeddings payload for
            direct transfer between stages
        additional_information: Optional serialized additional information
            dictionary containing tensors or lists to pass along with the request
    NÚprompt_embedsÚadditional_information)	r
   r   r   r   r   r   r   r   r   r   r   r   r   r   8   s   
 r   c                   @   s(   e Zd ZU dZeeejf dB ed< dS )ÚOmniEngineCoreOutputNÚpooling_output)	r
   r   r   r!   r   r   ÚtorchÚTensorr   r   r   r   r   r    L   s   
 r    c                   @   s   e Zd ZU g Zee ed< dS )ÚOmniEngineCoreOutputsÚoutputsN)r
   r   r   r%   r   r    r   r   r   r   r   r$   P   s   
 r$   )r   Útypingr   Úmsgspecr"   Úvllm.v1.enginer   r   r   ÚStructr   r   r   r   r    r$   r   r   r   r   Ú<module>   s    	