
    .`i                     d    d Z ddlZddlmZ d Zedk    r ej         e                       dS dS )a  
Compile vLLM protobuf definitions into Python code.

This script uses grpcio-tools to generate *_pb2.py, *_pb2_grpc.py, and
*_pb2.pyi (type stubs) files from the vllm_engine.proto definition.

NOTE: Proto compilation happens automatically during package build (via setup.py).
This script is provided for developers who want to regenerate protos manually,
e.g., after modifying vllm_engine.proto.

Usage:
    python vllm/grpc/compile_protos.py

Requirements:
    pip install grpcio-tools
    N)Pathc                     t          t                    j        } | j        j        }| dz  }|                                st	          d|            dS t	          d|            t	          d|             	 ddlm} |                    dd	| d
| d| d| t          | dz            g          }|dk    rd}| dz  | dz  | dz  fD ]\}|                                rF|	                                }|
                    d          s|dz   }|                    ||z              ]t	          d           t	          d| dz              t	          d| dz              t	          d| dz   d           dS t	          d|            |S # t          $ r" t	          d           t	          d           Y dS t          $ r}	t	          d|	            Y d}	~	dS d}	~	ww xY w)zCompile protobuf definitions.zvllm_engine.protozError: Proto file not found at    zCompiling protobuf: zOutput directory: r   )protoczgrpc_tools.protocz--proto_path=z--python_out=z--grpc_python_out=z
--pyi_out=zk# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
zvllm_engine_pb2.pyzvllm_engine_pb2_grpc.pyzvllm_engine_pb2.pyiz# SPDX-License-Identifierz# mypy: ignore-errors
u$   ✓ Protobuf compilation successful!z  Generated: z (type stubs)zError: protoc returned z!Error: grpcio-tools not installedz&Install with: pip install grpcio-toolszError during compilation: N)r   __file__parentexistsprint
grpc_toolsr   mainstr	read_text
startswith
write_textImportError	Exception)

script_dirvllm_package_root
proto_filer   resultspdx_headergenerated_filecontentheaderes
             l/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/grpc/compile_protos.pycompile_protosr      s    h&J")011J <
<<===q	
-
-
-...	
+z
+
+,,,0%%%%%%#3 1333 1338%6880.00J!4455	
 	
 Q;;Y  116622# 
D 
D
 "((** D,6688G"--.IJJ D!,/H!H&11&72BCCC8999E*/C"CEEFFFJ*/H"HJJKKKS*/D"DSSSTTT14F44555M   12226777qq   .1..///qqqqqs%   8C?F 9F (G8	GGG__main__)__doc__syspathlibr   r   __name__exit     r   <module>r&      st    " 


      A A AH zCH^^ r%   