
    .h                        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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j                  Z G d dej                  ZdS )    )annotationsN)AsyncIterator)TYPE_CHECKING   )AgentOutputSchemaBase)Handoff)ModelResponseTResponseInputItemTResponseStreamEvent)Tool)ModelSettingsc                  0    e Zd ZdZ	 dZ	 dZ	 d	dZd	dZdS )
ModelTracingr      r   returnboolc                "    | t           j        k    S N)r   DISABLEDselfs    T/var/www/FlaskApp/flask-venv/lib/python3.11/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)r   r   )__name__
__module____qualname__r   r   ENABLED_WITHOUT_DATAr   r    r   r   r   r      sU        H'G7B- - - -, , , , , ,r   r   c                  V    e Zd ZdZej        dd            Zej        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_idr   r	   c               
   K   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.

        Returns:
            The full model response.
        Nr"   	r   r%   r'   r)   r*   r,   r.   r0   r1   s	            r   get_responsezModel.get_response%   s      : 	r   #AsyncIterator[TResponseStreamEvent]c                   dS )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.

        Returns:
            An iterator of response stream events, in OpenAI Responses format.
        Nr"   r3   s	            r   stream_responsezModel.stream_responseD   s	    : 	r   N)r%   r&   r'   r(   r)   r   r*   r+   r,   r-   r.   r/   r0   r   r1   r&   r   r	   )r%   r&   r'   r(   r)   r   r*   r+   r,   r-   r.   r/   r0   r   r1   r&   r   r5   )r   r   r    __doc__abcabstractmethodr4   r7   r"   r   r   r$   r$   "   s`        00   < 	     r   r$   c                  4    e Zd ZdZej        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                    dS )zGet a model by name.

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

        Returns:
            The model.
        Nr"   )r   r=   s     r   	get_modelzModelProvider.get_modelj   s      r   N)r=   r&   r   r$   )r   r   r    r8   r9   r:   r?   r"   r   r   r<   r<   d   sB         
 	     r   r<   )
__future__r   r9   enumcollections.abcr   typingr   agent_outputr   r.   r   itemsr	   r
   r   toolr   r)   r   Enumr   ABCr$   r<   r"   r   r   <module>rI      sJ   " " " " " " 



  ) ) ) ) ) )             0 0 0 0 0 0       K K K K K K K K K K       /......, , , , ,49 , , ,"? ? ? ? ?CG ? ? ?D    CG     r   