o
    h                     @  s   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rDddlmZ G dd dejZG dd dejZG dd dejZdS )    )annotationsN)AsyncIterator)TYPE_CHECKING)ResponsePromptParam   )AgentOutputSchemaBase)Handoff)ModelResponseTResponseInputItemTResponseStreamEvent)Tool)ModelSettingsc                   @  s2   e Zd ZdZ	 dZ	 dZ	 dddZddd	Zd
S )ModelTracingr      r   returnboolc                 C  
   | t jkS N)r   DISABLEDself r   X/var/www/html/openai_agents/venv/lib/python3.10/site-packages/agents/models/interface.pyis_disabled      
zModelTracing.is_disabledc                 C  r   r   )r   ENABLEDr   r   r   r   include_data    r   zModelTracing.include_dataN)r   r   )__name__
__module____qualname__r   r   ENABLED_WITHOUT_DATAr   r   r   r   r   r   r      s    
r   c                   @  s0   e Zd ZdZejdddZejdddZdS )Modelz&The base interface for calling an LLM.system_instructions
str | Noneinputstr | list[TResponseInputItem]model_settingsr   tools
list[Tool]output_schemaAgentOutputSchemaBase | Nonehandoffslist[Handoff]tracingr   previous_response_idconversation_idpromptResponsePromptParam | Noner   r	   c                  s   dS )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   r"   r$   r&   r'   r)   r+   r-   r.   r/   r0   r   r   r   get_response'   s   !zModel.get_response#AsyncIterator[TResponseStreamEvent]c                C     dS )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   r2   r   r   r   stream_responseJ   s   !zModel.stream_responseN)r"   r#   r$   r%   r&   r   r'   r(   r)   r*   r+   r,   r-   r   r.   r#   r/   r#   r0   r1   r   r	   )r"   r#   r$   r%   r&   r   r'   r(   r)   r*   r+   r,   r-   r   r.   r#   r/   r#   r0   r1   r   r4   )r   r   r   __doc__abcabstractmethodr3   r6   r   r   r   r   r!   $   s    "r!   c                   @  s    e Zd ZdZejd	ddZdS )
ModelProviderzoThe base interface for a model provider.

    Model provider is responsible for looking up Models by name.
    
model_namer#   r   r!   c                 C  r5   )zGet a model by name.

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

        Returns:
            The model.
        Nr   )r   r;   r   r   r   	get_modelt   s    zModelProvider.get_modelN)r;   r#   r   r!   )r   r   r   r7   r8   r9   r<   r   r   r   r   r:   n   s    r:   )
__future__r   r8   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   r   <module>   s    J