o
    ưi                 >   @   s
  d dl Z d dlZd dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZmZ d dlZd dlmZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d d	lmZmZ d d
l m!Z! d dl"m#Z# d dl$m%Z% d dl&m'Z' d dl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 erd dl(m1Z1 ne2Z1d dl3m4Z4 d dl5m6Z6 d dl7T d dl8m9Z9 d dl:m;Z;m<Z< erd dl=m>Z? neZ?ddl@mAZA e# ZBe% ZC	dgde2fddZD																							dhdee2e,f de2dee
e+  dee2 d eeE d!ee) d"eee2ef  d#eeF d$ee2 d%ee* d&eeF d'eeF d(eeF d)eeG d*ed+ d,ee/ d-ee	e0  d.eeG d/eed0  d1ee2 d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7ee.eAf f4d8d9ZIe<																										didee2e,f de2dee
e+  dee2 d eeE d!ee) d"eee2ef  d#eeF d$ee2 d%ee* d&eeF d'eeF d(eeF d)eeG d*ed+ d:eeed; eJf  d,ee/ d-ee	e0  d.eeG d/eed0  d1ee2 d<ee2 d=ee2 d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7ee.eAf f:d>d?ZKe<																											djdee2e,f de2dee
e+  dee2 d eeE d!ee) d"eee2ef  d#eeF d$ee2 d%ee* d&eeF d'eeF d(eeF d)eeG d*ed+ d:eeed; eJf  d,ee/ d-ee	e0  d.eeG d/eed0  d1ee2 d<ee2 d=ee2 d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d@ee
e2  d6ee2 f:dAdBZLe<					dkdCe2d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7eMfdDdEZNe<					dkdCe2d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7eeMeeeeMf f fdFdGZOe<					dkdCe2d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7e.fdHdIZPe<					dkdCe2d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7ee.eeee.f f fdJdKZQe<				L	M			dldCe2dNee2 dOee2 dee
e2  dPeEdQedR d2eee2ef  d5eeeGejHf  d6ee2 d7efdSdTZRe<				L	M			dldCe2dNee2 dOee2 dee
e2  dPeEdQedR d2eee2ef  d5eeeGejHf  d6ee2 d7eeeeeef f fdUdVZSe<					dkdCe2d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7e.fdWdXZTe<					dkdCe2d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7ee.eeee.f f fdYdZZUe<							dmdee2e,f de2dee2 d$ee2 d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7e.fd[d\ZVe<							dmdee2e,f de2dee2 d$ee2 d2eee2ef  d3eee2ef  d4eee2ef  d5eeeGejHf  d6ee2 d7ee.eeee.f f fd]d^ZWd_eJd7eJfd`daZXe<			dnde2dbedcee2 ddee2 d5eeG f
dedfZYdS )o    N)partial)TYPE_CHECKINGAny	CoroutineDictIterableListLiteralOptionalTypeUnioncast)	BaseModel)verbose_logger)%LiteLLMResponsesTransformationHandler)request_timeout)Logging)*update_responses_input_with_model_file_ids*update_responses_tools_with_model_file_ids)BaseResponsesAPIConfig)BaseLLMHTTPHandler)&LiteLLMCompletionTransformationHandler)ResponsesAPIRequestUtils)PromptObject	ReasoningResponseIncludableResponseInputParam!ResponsesAPIOptionalRequestParamsResponsesAPIResponse
ToolChoice	ToolParam)ResponseText)get_litellm_params)get_secret_str)*)GenericLiteLLMParams)ProviderConfigManagerclient)Tool   )!BaseResponsesAPIStreamingIterator  In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.mock_responsec                 C   s   t d,i i ddddddddd	d d
d dd dd dddddddd| g dgdgdddd dd d dddddddd diid!d"g dd#d$d%d&id'd(d&id)d*d i d+S )-NidZ5resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795bobjectresponseZ
created_atigstatus	completederrorZincomplete_detailsinstructionsmax_output_tokensmodelzgpt-4.1-2025-04-14outputmessageZ4msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795bZ	assistantZoutput_text)typetextannotations)r8   r-   r0   Zrolecontentparallel_tool_callsTprevious_response_id	reasoning)Zeffortsummarystoretemperatureg      ?r9   formatr8   tool_choiceautodisabled$   Zcached_tokensr   W   Zreasoning_tokens{   )Zinput_tokensZinput_tokens_detailsZoutput_tokensZoutput_tokens_detailsZtotal_tokens)toolstop_p
truncationusageusermetadata )r   r,   rO   rO   M/home/app/Keep/.python/lib/python3.10/site-packages/litellm/responses/main.pymock_responses_api_responseJ   sx   	

 rR   inputr5   includer3   r4   promptrN   r<   r=   r>   r@   
backgroundstreamrA   r9   r!   rC   rI   rJ   rK   )rD   rE   rM   extra_headersextra_query
extra_bodytimeoutcustom_llm_providerreturnc           8         sT  ddl m} ||\}}|dp|di d}d}d}|d} | r7t| tr7tj| |d\}}}!}!|j|||d||d	I dH \}"}#|	|"}$|$sR|rV|$| nd}%i d
|d|d|d|d|d|d|	d|
d|d|d|d|d|d|d|d|d|||||d|}&|r|rddl
m}' ddlm}( d|' jdd  })|(|||)|"d I dH }*|jd4| ||%||*|&||#d!|S t|o|j|d"}+|j|&|+d#},td4| ||%|d$|,I dH }-td%|- |+rt|-tr|j|-d&}.|.r|di d}|d} tj| |d\}}}/}0|j|#|.||||/|0|d'|dd(	I dH }1|1r|j|-|1| d)}2|j|&|pHd*d+}3g }4|rW|j|.|1d,}4|jd4|2||%|-jd-|3I dH }5|r|4rt|5d.szt|5d/rdd0lm }6 |6|#|5|4|d1}5|5S t|5tr|j||||d2I dH \}7}!|j!|5|7|1d3}5|5S |-S )5a}  
    Async version of responses API with MCP integration.

    When MCP tools with server_url="litellm_proxy" are provided, this function will:
    1. Get available tools from the MCP server manager
    2. Insert the tools into the messages/input
    3. Call the standard responses API
    4. If require_approval="never" and tool calls are returned, automatically execute them
    r   LiteLLM_Proxy_MCP_Handleruser_api_key_authlitellm_metadataNsecret_fields)rb   rI   litellm_trace_id)r`   mcp_tools_with_litellm_proxyrc   mcp_auth_headermcp_server_auth_headersrT   r3   r4   rU   rN   r<   r>   r@   rV   rW   rA   r9   rC   rJ   rK   rM   rX   )rY   rZ   r[   r\   )uuid)create_mcp_list_tools_eventsZmcp_   )rd   r`   base_item_idZpre_processed_mcp_tools)rS   r5   	all_toolsrd   mcp_discovery_eventscall_paramsr=   tool_server_map)rd   )rm   should_auto_execute)rS   r5   rI   r=   zInitial response %s)r/   litellm_call_id)	rn   
tool_callsr`   re   rf   oauth2_headersZraw_headersrp   rc   )r/   tool_resultsZoriginal_inputF)rm   Zoriginal_stream_setting)rq   rs   )follow_up_inputr5   rk   response_id	__aiter____iter__)MCPEnhancedStreamingIterator)rn   Zbase_iteratorZ
mcp_eventsr`   )r`   rd   re   rf   )r/   Zmcp_tools_fetchedrs   rO   )"/litellm.responses.mcp.litellm_proxy_mcp_handlerr_   Z_parse_mcp_toolsget
isinstancedictr   Z extract_mcp_headers_from_requestZ+_process_mcp_tools_without_openai_transformZ_transform_mcp_tools_to_openaiZlitellm._uuidrg   Z,litellm.responses.mcp.mcp_streaming_iteratorrh   uuid4hexZ_create_mcp_streaming_responseboolZ_should_auto_execute_toolsZ_prepare_initial_call_params
aresponsesr   debugr   Z!_extract_tool_calls_from_responseZ_execute_tool_callsZ_create_follow_up_inputZ_prepare_follow_up_call_paramsZ_create_tool_execution_eventsZ_make_follow_up_callr-   hasattrrx   Z$_add_mcp_output_elements_to_response)8rS   r5   rT   r3   r4   rU   rN   r<   r=   r>   r@   rV   rW   rA   r9   rC   rI   rJ   rK   rM   rX   rY   rZ   r[   r\   kwargsr_   rd   Zother_toolsr`   re   rf   rb   _Zoriginal_mcp_toolsrn   Zopenai_toolsrk   rm   rg   rh   rj   rl   ro   Zinitial_call_paramsr/   rq   rr   Zraw_headers_from_requestrs   rt   Zfollow_up_call_paramsZtool_execution_eventsZfinal_responserx   Zmcp_tools_for_outputrO   rO   rQ   aresponses_api_with_mcp~   s  (



	
	



r   text_formatr   service_tiersafety_identifierc           &   
      s  t  }zt }d|d< tj||d}|dur||d< |du r3tj||ddd\}}}}||d< tt	fi d	| d
|d|d|d|d|d|d|d|d|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d |d!||} t
 }!t|!j| }"|d|"I dH }#t|#r|#I dH }$n|#}$t|$trtj|$|d"i |d#}$|$du rtd$|$ |$W S  ty }% z
tj|||%||d%d}%~%ww )&zS
    Async: Handles responses API requests by reusing the synchronous function
    Tr   r   r9   Nr9   base_urlr5   api_baser\   rS   r5   rT   r3   r4   rU   rN   r<   r=   r>   r@   rV   rW   rA   rC   rI   rJ   rK   rM   rX   rY   rZ   r[   r   r   ra   Zresponses_api_responsera   r\   z8Got an unexpected None response from the Responses API: r5   r\   Zoriginal_exceptionZcompletion_kwargsextra_kwargs)localsasyncioget_event_loopr   !convert_text_format_to_text_paramlitellmget_llm_providerrz   r   	responsescontextvarscopy_contextrunrun_in_executoriscoroutiner{   r   /_update_responses_api_response_id_with_model_id
ValueError	Exceptionexception_type)&rS   r5   rT   r3   r4   rU   rN   r<   r=   r>   r@   rV   rW   rA   r9   r   rC   rI   rJ   rK   rM   r   r   rX   rY   rZ   r[   r\   r   
local_varsloopr   funcctxfunc_with_contextinit_responser/   erO   rO   rQ   r     s   &	
 


r   allowed_openai_paramsc           /      K   s  t  }ddlm} z|d} |dd}!|dddu }"tj||d	}|dur-||d
< td8i |}#|#jrDt	|#jt
rDt|#jdW S tj|||#j|#jd\}}}$}%||d< |$dur^|$|#_|%dure|%|#_|d}&t	|dtr{|di dnd}'ttt
tf t| |'|&d} | |d< |rtttt  tttttt
tf   ||'|&d}||d< |j|drtd8i d| d|d|d|d|d|d|d|d|d|	d|
d |d!|d"|d
|d#|d|d$|d%|d&|d'|d(|d)|d*|d||W S tj|t |d+}(|!| |	du r5d,|v r5t" #|d,})|)dur5|)}	|)|d< t$|}*|(du rQt%j&d8|| |*||"|||d-|W S tj'||(|*|d.}+|pd|d/pdi },| j(||t|+i |+|"|!|,d0|d1 t)| } t*j&|| |(|+||#| |||pt+|"|d2|(j,|||d3|d/i |d4d5}-t	|-t-rtj.|-|d/i |d6}-|-W S  t/y }. z
tj0|||.||d7d}.~.ww )9zk
    Synchronous version of the Responses API.
    Uses the synchronous HTTP handler to make requests.
    r   r^   litellm_logging_objrp   Nr   FTr   r9   rP   r5   r\   r   api_keyr\   model_file_id_mappingZ
model_infor-   )rS   model_idr   rS   )rI   r   r   rI   )rI   r5   rT   r3   r4   rU   rN   r<   r=   r>   r@   rV   rW   rA   rC   rJ   rK   rM   rX   rY   rZ   r[   r5   providerZreasoning_effort)r5   rS   Zresponses_api_requestr\   	_is_asyncrW   rX   rZ   r5   responses_api_provider_configresponse_api_optional_paramsr   ra   )r   rp   rN   r5   rM   optional_paramslitellm_paramsr\   r'   )r5   rW   r\   shared_session)r5   rS   r   $response_api_optional_request_paramsr\   r   logging_objrX   rZ   r[   r   r'   Zfake_streamra   r   r   r   rO   )1r   ry   r_   rz   popr   r   r%   r,   r{   strrR   r   r   r   r   r|   r   r   r   r   r
   r   r    r   r   r   r   Z_should_use_litellm_mcp_gatewayr   r&   !get_provider_responses_api_configLlmProvidersupdater   Z_map_reasoning_effort)get_requested_response_api_optional_param)litellm_completion_transformation_handlerZresponse_api_handler!get_optional_params_responses_apiupdate_environment_variables,_restore_encrypted_content_item_ids_in_inputbase_llm_http_handlerr   Zshould_fake_streamr   r   r   r   )/rS   r5   rT   r3   r4   rU   rN   r<   r=   r>   r@   rV   rW   rA   r9   r   rC   rI   rJ   rK   rM   r   r   rX   rY   rZ   r[   r   r\   r   r   r_   r   rp   r   r   dynamic_api_keydynamic_api_baser   Zmodel_info_idr   Z_mappedr   responses_api_request_paramsZmetadata_for_callbacksr/   r   rO   rO   rQ   r     s  (
		


	
 


	

r   ru   c              
         t  }zPt }d|d< tj| d}	|	dp| } |	dp |}ttf| |||||d|}
t	 }t|j
|
}|d|I dH }t|rP|I dH }|W S |}|W S  tyj } z
tjd||||dd}~ww )	zz
    Async version of the DELETE Responses API

    DELETE /v1/responses/{response_id} endpoint in the responses API

    Tadelete_responsesru   ru   r\   ru   r\   rX   rY   rZ   r[   Nr   )r   r   r   r   !_decode_responses_api_response_idrz   r   delete_responsesr   r   r   r   r   r   r   r   ru   rX   rY   rZ   r[   r\   r   r   r   decoded_response_idr   r   r   r   r/   r   rO   rO   rQ   r     T   

r   c                 K   $  t  }zx|d}|dd}	|dddu }
tdi |}tj| d}|dp*| } |d	p1|}|du r:td
tjdt	
|d}|du rOtd| || |jdd| id|	i|d tj| |||||||pmt|
|d|dd}|W S  ty } z
t	jd||||dd}~ww )z
    Synchronous version of the DELETE Responses API

    DELETE /v1/responses/{response_id} endpoint in the responses API

    r   rp   Nr   FTr   ru   r\   2custom_llm_provider is required but passed as Noner   z&DELETE responses is not supported for r5   r   r   r\   r'   r   ru   r\   r   r   r   rX   rZ   r[   r   r'   r   r   rO   )r   rz   r   r%   r   r   r   r&   r   r   r   r   r   r   Zdelete_response_api_handlerr   r   r   ru   rX   rY   rZ   r[   r\   r   r   r   rp   r   r   r   r   r/   r   rO   rO   rQ   r   Z  r   

r   c              
      s   t  }z_t }d|d< tj| d}	|	dp| } |	dp |}ttf| |||||d|}
t	 }t|j
|
}|d|I dH }t|rN|I dH }n|}t|tratj||di |d	}|W S  tyy } z
tjd||||d
d}~ww )ax  
    Async: Fetch a response by its ID.

    GET /v1/responses/{response_id} endpoint in the responses API

    Args:
        response_id: The ID of the response to fetch.
        custom_llm_provider: Optional provider name. If not specified, will be decoded from response_id.

    Returns:
        The response object with complete information about the stored response.
    Taget_responsesr   ru   r\   r   Nra   r   r   )r   r   r   r   r   rz   r   get_responsesr   r   r   r   r   r{   r   r   r   r   r   r   rO   rO   rQ   r     s^   


r   c                 K   sF  t  }z|d}|dd}	|dddu }
tdi |}tj| d}|dp*| } |d	p1|}|du r:td
tjdt	
|d}|du rOtd| || |jdd| id|	i|d tj| |||||||pmt|
|d|dd}t|trtj||di |d}|W S  ty } z
t	jd||||dd}~ww )aq  
    Fetch a response by its ID.

    GET /v1/responses/{response_id} endpoint in the responses API

    Args:
        response_id: The ID of the response to fetch.
        custom_llm_provider: Optional provider name. If not specified, will be decoded from response_id.

    Returns:
        The response object with complete information about the stored response.
    r   rp   Nr   FTr   ru   r\   r   r   z#GET responses is not supported for r   r'   r   r   ra   r   r   rO   )r   rz   r   r%   r   r   r   r&   r   r   r   r   r   r   r   r   r{   r   r   r   r   r   rO   rO   rQ   r     s~   



r      descafterbeforelimitorder)ascr   c	                    s   t  }
zSt }d|	d< tj| d}|dp| } |dp |}ttf| ||||||||d	|	}t	 }t|j
|}|d|I dH }t|rS|I dH }|W S |}|W S  tym } z
tjd|||
|	dd}~ww )	z&Async: List input items for a responseTalist_input_itemsr   ru   r\   )	ru   r   r   rT   r   r   rX   r[   r\   Nr   )r   r   r   r   r   rz   r   list_input_itemsr   r   r   r   r   r   r   r   )ru   r   r   rT   r   r   rX   r[   r\   r   r   r   r   r   r   r   r   r/   r   rO   rO   rQ   r   u  sZ   

r   c	                 K   s,  t  }
z||	d}|	dd}|	dddu }tdi |	}tj| d}|dp*| } |d	p1|}|du r:td
tjdt	
|d}|du rOtd| |
|	 |jdd| id|i|d tj| |||||||||||pqt||	d|	dd}|W S  ty } z
t	jd|||
|	dd}~ww )zList input items for a responser   rp   Nr   FTr   ru   r\   r   r   z&list_input_items is not supported for r   r'   r   )ru   r\   r   r   r   r   r   rT   r   r   rX   r[   r   r'   r   r   rO   )r   rz   r   r%   r   r   r   r&   r   r   r   r   r   r   Zlist_responses_input_itemsr   r   r   )ru   r   r   rT   r   r   rX   r[   r\   r   r   r   rp   r   r   r   r   r/   r   rO   rO   rQ   r     sv   

r   c              
      r   )	z
    Async version of the POST Cancel Responses API

    POST /v1/responses/{response_id}/cancel endpoint in the responses API

    Tacancel_responsesr   ru   r\   r   Nr   )r   r   r   r   r   rz   r   cancel_responsesr   r   r   r   r   r   r   r   r   rO   rO   rQ   r     r   r   c                 K   r   )z
    Synchronous version of the POST Responses API

    POST /v1/responses/{response_id}/cancel endpoint in the responses API

    r   rp   Nr   FTr   ru   r\   r   r   z&CANCEL responses is not supported for r   r'   r   r   r   rO   )r   rz   r   r%   r   r   r   r&   r   r   r   r   r   r   Zcancel_response_api_handlerr   r   r   r   rO   rO   rQ   r   I  r   r   c	                    s   t  }
zet }d|	d< |du r$tj||
ddd\}}}}||
d< ttf| ||||||||d	|	}t	 }t|j
|}|d|I dH }t|rT|I dH }n|}t|trgtj||	di |d	}|W S  ty } z
tj||||
|	d
d}~ww )z
    Async version of the POST Compact Responses API

    POST /v1/responses/compact endpoint in the responses API

    Runs a compaction pass over a conversation, returning encrypted, opaque items.
    Tacompact_responsesNr   r   r\   )	rS   r5   r3   r=   rX   rY   rZ   r[   r\   ra   r   r   )r   r   r   r   r   rz   r   compact_responsesr   r   r   r   r   r{   r   r   r   r   r   )rS   r5   r3   r=   rX   rY   rZ   r[   r\   r   r   r   r   r   r   r   r   r/   r   rO   rO   rQ   r     s`   


r   c	                 K   s  t  }
z|	d}|	dd}|	dddu }tdi |	}tj|||j|jd\}}}}||
d< |dur8||_|dur?||_|du rGtd	t	j
|t|d
}|du r\td| |
|	 t|
}tj|||dd}|j|t|i |d|i|d t| } tj|| ||||||||pt||	d|	dd}t|trtj||	di |d}|W S  ty } z
tj||||
|	dd}~ww )z
    Synchronous version of the POST Compact Responses API

    POST /v1/responses/compact endpoint in the responses API

    Runs a compaction pass over a conversation, returning encrypted, opaque items.
    r   rp   Nr   FTr   r\   r   r   z'COMPACT responses is not supported for r   r   r'   r   )r5   rS   r   r   r   r   r\   rX   rZ   r[   r   r'   r   ra   r   r   rO   )r   rz   r   r%   r   r   r   r   r   r&   r   r   r   r   r   r   r   r|   r   r   Zcompact_response_api_handlerr   r{   r   r   r   r   )rS   r5   r3   r=   rX   rY   rZ   r[   r\   r   r   r   rp   r   r   r   r   r   r   r   r/   r   rO   rO   rQ   r     s   
	



r   r   c                 C   sD   i |  dpi }|  dpi  dp|  dpg }|r ||d< |S )Nra   rN   
guardrails)rz   )r   rN   r   rO   rO   rQ   _build_litellm_metadata_for_ws  s   r   	websocketr   r   c                    s   | d}| dd}tdi |}tdi |}	tj| ||d\} }
}}|j| |i |	|
d d}|
dur@tj| t|
d}|pI|j	pItj	pId}|pX|j
pXtj
pXtjpXtd}dd	 | D }tjd| ||||||| d
t||
d
|I dH  dS )a  
    Private function to handle the Responses API WebSocket mode.

    For PROXY use only.

    Resolves the LLM provider from ``model``, looks up the matching
    ``BaseResponsesAPIConfig``, and hands off to
    ``BaseLLMHTTPHandler.async_responses_websocket``.
    r   rM   N)r5   r   r   r   r   ZOPENAI_API_KEYc                 S   s   i | ]\}}|d vr||qS )>   ra   user_api_key_dictrO   ).0kvrO   rO   rQ   
<dictcomp>  s    z)_aresponses_websocket.<locals>.<dictcomp>r   )
r5   r   r   r   r   r   r[   r   ra   r\   rO   )rz   r%   r"   r   r   r   r&   r   r   r   r   Z
openai_keyr#   itemsr   Zasync_responses_websocketr   )r5   r   r   r   r[   r   r   rM   r   Zlitellm_params_dictZ_custom_llm_providerr   r   r   Zresolved_api_baseZresolved_api_keyZremaining_kwargsrO   rO   rQ   _aresponses_websocket  sp   

	r   )r+   )NNNNNNNNNNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNNNNNN)NNNNN)NNNr   r   NNN)NNNNNNN)NNN)Zr   r   	functoolsr   typingr   r   r   r   r   r   r	   r
   r   r   r   ZhttpxZpydanticr   r   Zlitellm._loggingr   ZIlitellm.completion_extras.litellm_responses_transformation.transformationr   Zlitellm.constantsr   Z*litellm.litellm_core_utils.litellm_loggingr   ZLiteLLMLoggingObjZ8litellm.litellm_core_utils.prompt_templates.common_utilsr   r   Z.litellm.llms.base_llm.responses.transformationr   Z*litellm.llms.custom_httpx.llm_http_handlerr   Z;litellm.responses.litellm_completion_transformation.handlerr   Zlitellm.responses.utilsr   Zlitellm.types.llms.openair   r   r   r   r   r   r   r    r!   r   Z-litellm.litellm_core_utils.get_litellm_paramsr"   Zlitellm.secret_managers.mainr#   Zlitellm.types.responses.mainZlitellm.types.routerr%   Zlitellm.utilsr&   r'   Z	mcp.typesr(   ZMCPToolZstreaming_iteratorr*   r   r   rR   intr   floatTimeoutr   r|   r   r   ZDeleteResponseResultr   r   r   r   r   r   r   r   r   r   r   r   rO   rO   rO   rQ   <module>   sJ   4(
7

	




  

	



!{

	



   	@	^	N	l
	=
	T	@	^
	
M
	
 