
    Cj                    $   S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  SSK
Jr  SSKJr  SS	KJrJrJr  SS
KJr  \(       a  SSKJr  SSKJrJr   " S S\R2                  5      r " S S\R6                  5      r " S S\R6                  5      rg)    )annotationsN)AsyncIterator)TYPE_CHECKING)ResponsePromptParam   )AgentOutputSchemaBase)Handoff)ModelResponseTResponseInputItemTResponseStreamEvent)Tool)ModelSettings)ModelRetryAdviceModelRetryAdviceRequestc                  :    \ rS rSrSr Sr Sr S	S jrS	S jrSr	g)
ModelTracing   r      r   c                (    U [         R                  :H  $ N)r   DISABLEDselfs    i/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/agents/models/interface.pyis_disabledModelTracing.is_disabled   s    |,,,,    c                (    U [         R                  :H  $ r   )r   ENABLEDr   s    r   include_dataModelTracing.include_data!   s    |++++r    N)returnbool)
__name__
__module____qualname____firstlineno__r   r   ENABLED_WITHOUT_DATAr   r    __static_attributes__r"   r   r   r   r      s%    H'G7B-,r   r   c                      \ rS rSrSrS	S jrS
S jr\R                                        SS j5       r	\R                                        SS j5       r
Srg)Model%   z&The base interface for calling an LLM.c                   #    g7f)zRelease any resources held by the model.

Models that maintain persistent connections can override this. The default implementation
is a no-op.
Nr"   r   s    r   closeModel.close(   
         c                    g)zReturn provider-specific retry guidance for a failed model request.

Models can override this to surface transport- or provider-specific hints such as replay
safety, retry-after delays, or explicit server retry guidance.
Nr"   )r   requests     r   get_retry_adviceModel.get_retry_advice0   s     r   c                  #    g7f)a  Get a response from the model.

Args:
    system_instructions: The system instructions to use.
    input: The input items to the model, in OpenAI Responses format.
    model_settings: The model settings to use.
    tools: The tools available to the model.
    output_schema: The output schema to use.
    handoffs: The handoffs available to the model.
    tracing: Tracing configuration.
    previous_response_id: the ID of the previous response. Generally not used by the model,
        except for the OpenAI Responses API.
    conversation_id: The ID of the stored conversation, if any.
    prompt: The prompt config to use for the model.

Returns:
    The full model response.
Nr"   r   system_instructionsinputmodel_settingstoolsoutput_schemahandoffstracingprevious_response_idconversation_idprompts              r   get_responseModel.get_response8   s     B 	r2   c                   g)a  Stream a response from the model.

Args:
    system_instructions: The system instructions to use.
    input: The input items to the model, in OpenAI Responses format.
    model_settings: The model settings to use.
    tools: The tools available to the model.
    output_schema: The output schema to use.
    handoffs: The handoffs available to the model.
    tracing: Tracing configuration.
    previous_response_id: the ID of the previous response. Generally not used by the model,
        except for the OpenAI Responses API.
    conversation_id: The ID of the stored conversation, if any.
    prompt: The prompt config to use for the model.

Returns:
    An iterator of response stream events, in OpenAI Responses format.
Nr"   r8   s              r   stream_responseModel.stream_response[   s    B 	r   r"   Nr#   None)r4   r   r#   zModelRetryAdvice | None)r9   
str | Noner:   str | list[TResponseInputItem]r;   r   r<   
list[Tool]r=   AgentOutputSchemaBase | Noner>   list[Handoff]r?   r   r@   rJ   rA   rJ   rB   ResponsePromptParam | Noner#   r
   )r9   rJ   r:   rK   r;   r   r<   rL   r=   rM   r>   rN   r?   r   r@   rJ   rA   rJ   rB   rO   r#   z#AsyncIterator[TResponseStreamEvent])r%   r&   r'   r(   __doc__r/   r5   abcabstractmethodrC   rF   r*   r"   r   r   r,   r,   %   s   0 	 '  .  &	 
   4       )  $  +  
   D 	 '  .  &	 
   4       )  $  +  
-   r   r,   c                  J    \ rS rSrSr\R                  SS j5       rSS jrSr	g)	ModelProvider   zgThe base interface for a model provider.

Model provider is responsible for looking up Models by name.
c                    g)zcGet a model by name.

Args:
    model_name: The name of the model to get.

Returns:
    The model.
Nr"   )r   
model_names     r   	get_modelModelProvider.get_model   s    r   c                   #    g7f)zRelease any resources held by the provider.

Providers that cache persistent models or network connections can override this. The
default implementation is a no-op.
Nr"   r   s    r   acloseModelProvider.aclose   r1   r2   r"   N)rW   rJ   r#   r,   rH   )
r%   r&   r'   r(   rP   rQ   rR   rX   r[   r*   r"   r   r   rT   rT      s&    
 	 r   rT   )
__future__r   rQ   enumcollections.abcr   typingr   ,openai.types.responses.response_prompt_paramr   agent_outputr   r>   r	   itemsr
   r   r   toolr   r;   r   retryr   r   Enumr   ABCr,   rT   r"   r   r   <module>rh      sb    " 
  )   L 0  K K .A,499 ,"WCGG WtCGG r   