o
    õæh  ã                   @  sÄ  U d dl mZ d dlmZ d dlmZ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 d	dlmZ d	dlmZmZ eG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd „ d ƒƒZ eG d!d"„ d"ƒƒZ!eG d#d$„ d$ƒƒZ"eG d%d&„ d&ƒƒZ#eG d'd(„ d(ƒƒZ$eG d)d*„ d*ƒƒZ%eeeeeeeeee e!e"e#e$e%f Z&d+e'd,< d-S ).é    )Úannotations)Ú	dataclass)ÚAnyÚLiteralÚUnion)Ú	TypeAliasé   )ÚOutputGuardrailResult)ÚRunContextWrapper)ÚToolé   )ÚRealtimeAgent)ÚRealtimeItem)ÚRealtimeModelAudioEventÚRealtimeModelEventc                   @  s   e Zd ZU ded< dS )ÚRealtimeEventInfor
   ÚcontextN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© r   r   úW/var/www/html/openai_agents/venv/lib/python3.10/site-packages/agents/realtime/events.pyr      s   
 r   c                   @  ó2   e Zd ZU dZded< 	 ded< 	 dZded< d	S )
ÚRealtimeAgentStartEventzA new agent has started.r   Úagentr   ÚinfoÚagent_startzLiteral['agent_start']ÚtypeN©r   r   r   Ú__doc__r   r   r   r   r   r   r      ó   
 r   c                   @  r   )
ÚRealtimeAgentEndEventzAn agent has ended.r   r   r   r   Ú	agent_endzLiteral['agent_end']r   Nr   r   r   r   r   r"   #   r!   r"   c                   @  s<   e Zd ZU dZded< 	 ded< 	 ded< 	 dZded	< d
S )ÚRealtimeHandoffEventz)An agent has handed off to another agent.r   Ú
from_agentÚto_agentr   r   ÚhandoffzLiteral['handoff']r   Nr   r   r   r   r   r$   0   ó   
 r$   c                   @  s:   e Zd ZU dZded< 	 ded< ded< 	 dZd	ed
< dS )ÚRealtimeToolStartz!An agent is starting a tool call.r   r   r   Útoolr   r   Ú
tool_startzLiteral['tool_start']r   Nr   r   r   r   r   r)   @   s   
 r)   c                   @  sF   e Zd ZU dZded< 	 ded< 	 ded< 	 ded	< 	 d
Zded< dS )ÚRealtimeToolEndzAn agent has ended a tool call.r   r   r   r*   r   Úoutputr   r   Útool_endzLiteral['tool_end']r   Nr   r   r   r   r   r,   O   ó   
 r,   c                   @  r   )
ÚRealtimeRawModelEventz)Forwards raw events from the model layer.r   Údatar   r   Úraw_model_eventzLiteral['raw_model_event']r   Nr   r   r   r   r   r0   b   r!   r0   c                   @  ó<   e Zd ZU dZded< 	 ded< 	 ded< 	 dZd	ed
< dS )ÚRealtimeAudioEndz0Triggered when the agent stops generating audio.r   r   ÚstrÚitem_idÚintÚcontent_indexÚ	audio_endzLiteral['audio_end']r   Nr   r   r   r   r   r4   o   r(   r4   c                   @  sF   e Zd ZU dZded< 	 ded< 	 ded< 	 ded	< 	 dZd
ed< dS )ÚRealtimeAudioz:Triggered when the agent generates new audio to be played.r   Úaudior5   r6   r7   r8   r   r   zLiteral['audio']r   Nr   r   r   r   r   r:      r/   r:   c                   @  r3   )ÚRealtimeAudioInterruptedzŽTriggered when the agent is interrupted. Can be listened to by the user to stop audio
    playback or give visual indicators to the user.
    r   r   r5   r6   r7   r8   Úaudio_interruptedzLiteral['audio_interrupted']r   Nr   r   r   r   r   r<   ’   s   
 r<   c                   @  s2   e Zd ZU dZded< 	 ded< 	 dZded< dS )	ÚRealtimeErrorzAn error has occurred.r   Úerrorr   r   zLiteral['error']r   Nr   r   r   r   r   r>   ¤   r!   r>   c                   @  r   )
ÚRealtimeHistoryUpdatedzGThe history has been updated. Contains the full history of the session.zlist[RealtimeItem]Úhistoryr   r   Úhistory_updatedzLiteral['history_updated']r   Nr   r   r   r   r   r@   ±   r!   r@   c                   @  r   )
ÚRealtimeHistoryAddedz)A new item has been added to the history.r   Úitemr   r   Úhistory_addedzLiteral['history_added']r   Nr   r   r   r   r   rC   ¾   r!   rC   c                   @  r3   )ÚRealtimeGuardrailTrippedz@A guardrail has been tripped and the agent has been interrupted.zlist[OutputGuardrailResult]Úguardrail_resultsr5   Úmessager   r   Úguardrail_trippedzLiteral['guardrail_tripped']r   Nr   r   r   r   r   rF   Ë   r(   rF   c                   @  s(   e Zd ZU dZded< 	 dZded< dS )Ú"RealtimeInputAudioTimeoutTriggeredzKCalled when the model detects a period of inactivity/silence from the user.r   r   Úinput_audio_timeout_triggeredz(Literal['input_audio_timeout_triggered']r   Nr   r   r   r   r   rJ   Û   s
   
 rJ   r   ÚRealtimeSessionEventN)(Ú
__future__r   Údataclassesr   Útypingr   r   r   Útyping_extensionsr   Ú	guardrailr	   Úrun_contextr
   r*   r   r   r   Úitemsr   Úmodel_eventsr   r   r   r   r"   r$   r)   r,   r0   r4   r:   r<   r>   r@   rC   rF   rJ   rL   r   r   r   r   r   Ú<module>   st    	óÿ