
    .Ui                    
   d dl mZ d dl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 dd	lmZmZmZ dd
lmZ erddlmZ  G d dej,                        Z G d dej0                        Z G d dej0                        Zy)    )annotationsN)AsyncIterator)TYPE_CHECKING)ResponsePromptParam   )AgentOutputSchemaBase)Handoff)ModelResponseTResponseInputItemTResponseStreamEvent)Tool)ModelSettingsc                  .    e Zd ZdZ	 dZ	 dZ	 ddZddZy)ModelTracingr      r   c                (    | t         j                  k(  S N)r   DISABLEDselfs    s/home/jay/workspace/tools/ai-image-gen/jaaz-app/server/venv/lib/python3.12/site-packages/agents/models/interface.pyis_disabledzModelTracing.is_disabled   s    |,,,,    c                (    | t         j                  k(  S r   )r   ENABLEDr   s    r   include_datazModelTracing.include_data    s    |++++r   N)returnbool)__name__
__module____qualname__r   r   ENABLED_WITHOUT_DATAr   r    r   r   r   r      s%    H'G7B-,r   r   c                      e Zd ZdZej
                  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Zej
                  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Zy)Modelz&The base interface for calling an LLM.c                  K   yw)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_responsezModel.get_response'   s     B 	s   c                    y)aM  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#   r'   s              r   stream_responsezModel.stream_responseJ   s    B 	r   N)r(   
str | Noner)   str | list[TResponseInputItem]r*   r   r+   
list[Tool]r,   AgentOutputSchemaBase | Noner-   list[Handoff]r.   r   r/   r5   r0   r5   r1   ResponsePromptParam | Noner   r
   )r(   r5   r)   r6   r*   r   r+   r7   r,   r8   r-   r9   r.   r   r/   r5   r0   r5   r1   r:   r   z#AsyncIterator[TResponseStreamEvent])r   r    r!   __doc__abcabstractmethodr2   r4   r#   r   r   r%   r%   $   s   0 '  .  &	 
   4       )  $  +  
   D 	 '  .  &	 
   4       )  $  +  
-   r   r%   c                  6    e Zd ZdZej
                  dd       Zy)ModelProviderzoThe base interface for a model provider.

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

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

        Returns:
            The model.
        Nr#   )r   
model_names     r   	get_modelzModelProvider.get_modelt   s    r   N)rA   r5   r   r%   )r   r    r!   r;   r<   r=   rB   r#   r   r   r?   r?   n   s!    
 	 r   r?   )
__future__r   r<   enumcollections.abcr   typingr   ,openai.types.responses.response_prompt_paramr   agent_outputr   r-   r	   itemsr
   r   r   toolr   r*   r   Enumr   ABCr%   r?   r#   r   r   <module>rM      s_    " 
  )   L 0  K K .,499 ,"GCGG GTCGG r   