
    .Ui                    |   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             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d              Z e G d! d"             Z!e G d# d$             Z"e G d% d&             Z#e G d' d(             Z$e G d) d*             Z%eeeeeeeeee e!e"e#e$e%f   Z&d+e'd,<   y-).    )annotations)	dataclass)AnyLiteralUnion)	TypeAlias   )OutputGuardrailResult)RunContextWrapper)Tool   )RealtimeAgent)RealtimeItem)RealtimeModelAudioEventRealtimeModelEventc                      e Zd ZU ded<   y)RealtimeEventInfor   contextN)__name__
__module____qualname____annotations__     r/home/jay/workspace/tools/ai-image-gen/jaaz-app/server/venv/lib/python3.12/site-packages/agents/realtime/events.pyr   r      s    $r   r   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y	)
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      s"    "
:#0D
 0r   r   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y	)
RealtimeAgentEndEventzAn agent has ended.r   r   r   r   	agent_endzLiteral['agent_end']r!   Nr"   r   r   r   r%   r%   #   s"    
:!,D
,r   r%   c                  D    e Zd ZU dZded<   	 ded<   	 ded<   	 dZded	<   y
)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   s+    3$+
:(D
(r   r(   c                  B    e Zd ZU dZded<   	 ded<   ded<   	 dZd	ed
<   y)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'    +!
J
:".D
.r   r-   c                  P    e Zd ZU dZded<   	 ded<   	 ded<   	 ded	<   	 d
Zded<   y)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   r1   r1   O   s2    )-
J#K&
: *D
*r   r1   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y	)
RealtimeRawModelEventz)Forwards raw events from the model layer.r   datar   r   raw_model_eventzLiteral['raw_model_event']r!   Nr"   r   r   r   r5   r5   b   s"    3
,
:'8D
$8r   r5   c                  D    e Zd ZU dZded<   	 ded<   	 ded<   	 dZd	ed
<   y)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   r9   r9   o   s*    :
:L.:!,D
,r   r9   c                  P    e Zd ZU dZded<   	 ded<   	 ded<   	 ded	<   	 dZd
ed<   y)RealtimeAudioz:Triggered when the agent generates new audio to be played.r   audior:   r;   r<   r=   r   r   zLiteral['audio']r!   Nr"   r   r   r   r@   r@      s3    D""/L.:
:$D
$r   r@   c                  D    e Zd ZU dZded<   	 ded<   	 ded<   	 dZd	ed
<   y)RealtimeAudioInterruptedzTriggered 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   r:   r;   r<   r=   audio_interruptedzLiteral['audio_interrupted']r!   Nr"   r   r   r   rC   rC      s.     :L.:)<D
&<r   rC   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y)	RealtimeErrorzAn error has occurred.r   errorr   r   zLiteral['error']r!   Nr"   r   r   r   rF   rF      s!     J"
:$D
$r   rF   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y	)
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   rI   rI      s"    Q*
:'8D
$8r   rI   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y	)
RealtimeHistoryAddedz)A new item has been added to the history.r   itemr   r   history_addedzLiteral['history_added']r!   Nr"   r   r   r   rM   rM      s"    3
5
:%4D
"4r   rM   c                  D    e Zd ZU dZded<   	 ded<   	 ded<   	 dZd	ed
<   y)RealtimeGuardrailTrippedz@A guardrail has been tripped and the agent has been interrupted.zlist[OutputGuardrailResult]guardrail_resultsr:   messager   r   guardrail_trippedzLiteral['guardrail_tripped']r!   Nr"   r   r   r   rQ   rQ      s*    J224LP
:)<D
&<r   rQ   c                  ,    e Zd ZU dZded<   	 dZded<   y)"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   rV   rV      s    U
:5TD
2Tr   rV   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-   r1   r5   r9   r@   rC   rF   rI   rM   rQ   rV   rX   r   r   r   r   <module>ra      s   " ! & & ' - +     E % % %
 	1 	1 	1 	- 	- 	- ) ) ) / / / + + +$ 	9 	9 	9 - - - % % %$ = = =" 	% 	% 	% 	9 	9 	9 	5 	5 	5 = = = U U U #(&(# i   0r   