o
    iK                     @  sv   d dl mZ d dlZd dlZd dlmZmZmZmZmZm	Z	m
Z
 d dlmZ er0d dlmZmZ e	dZdddZdS )    )annotationsN)TYPE_CHECKING	AwaitableCallableOptionalTypeTypeVarUnion)StartOperationContext)InputTOutputTServiceHandlerTstart^Callable[[ServiceHandlerT, StartOperationContext, InputT], Union[OutputT, Awaitable[OutputT]]]return6tuple[Optional[Type[InputT]], Optional[Type[OutputT]]]c                 C  s   zt | }W n ty   td|  d Y dS w |dd}t|dkrF|r.d| nd}td|  d	t| | d
 d}||fS | \}}t|t	s_td|  d| d
 d}||fS )zReturn operation input and output types.

    `start` must be a type-annotated start method that returns a synchronous result.
    z Expected decorated start method z to have type annotations)NNr   N   z:  zI to have exactly 2 type-annotated parameters (ctx and input), but it has .zExpected first parameter of z4 to be an instance of StartOperationContext, but is )
typingget_type_hints	TypeErrorwarningswarnpoplenvalues
issubclassr
   )r   type_annotationsoutput_typesuffix
input_typectx_type r#   \/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/nexusrpc/handler/_util.py2get_start_method_input_and_output_type_annotations   s:   

r%   )r   r   r   r   )
__future__r   r   r   r   r   r   r   r   r   r	   nexusrpc.handlerr
   nexusrpcr   r   r   r%   r#   r#   r#   r$   <module>   s    $
