
    hqN                    D   S SK Jr  S SKJrJrJr  S SKJr  S SKrSSK	J
r
  SSKJrJrJrJrJr  SSKJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSKJr  SSKJr  SSK J!r!  SS/r" " S S\5      r# " S S\5      r$ " S S5      r% " S S5      r& " S S5      r' " S S5      r(g)    )annotations)ListUnionIterable)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)make_request_options)session_create_params)SessionCreateResponseSessionsAsyncSessionsc                      \ rS rSr\SS j5       r\S	S j5       r\\\\\\\\\\\\\SSS\S.                                   S
S jjrSr	g)r      c                    [        U 5      $ z
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
)SessionsWithRawResponseselfs    Y/var/www/html/env/lib/python3.13/site-packages/openai/resources/beta/realtime/sessions.pywith_raw_responseSessions.with_raw_response   s     't,,    c                    [        U 5      $ z
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/openai/openai-python#with_streaming_response
)SessionsWithStreamingResponser    s    r"   with_streaming_response Sessions.with_streaming_response%   s     -T22r%   Ninput_audio_formatinput_audio_noise_reductioninput_audio_transcriptioninstructionsmax_response_output_tokens
modalitiesmodeloutput_audio_formattemperaturetool_choicetoolsturn_detectionvoiceextra_headersextra_query
extra_bodytimeoutc                   SS0U=(       d    0 EnU R                  S[        UUUUUUUUU	U
UUUS.[        R                  5      [	        XUUS9[
        S9$ )f  
Create an ephemeral API token for use in client-side applications with the
Realtime API. Can be configured with the same session parameters as the
`session.update` client event.

It responds with a session object, plus a `client_secret` key which contains a
usable ephemeral API token that can be used to authenticate browser clients for
the Realtime API.

Args:
  input_audio_format: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
      `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
      (mono), and little-endian byte order.

  input_audio_noise_reduction: Configuration for input audio noise reduction. This can be set to `null` to turn
      off. Noise reduction filters audio added to the input audio buffer before it is
      sent to VAD and the model. Filtering the audio can improve VAD and turn
      detection accuracy (reducing false positives) and model performance by improving
      perception of the input audio.

  input_audio_transcription: Configuration for input audio transcription, defaults to off and can be set to
      `null` to turn off once on. Input audio transcription is not native to the
      model, since the model consumes audio directly. Transcription runs
      asynchronously through
      [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
      and should be treated as guidance of input audio content rather than precisely
      what the model heard. The client can optionally set the language and prompt for
      transcription, these offer additional guidance to the transcription service.

  instructions: The default system instructions (i.e. system message) prepended to model calls.
      This field allows the client to guide the model on desired responses. The model
      can be instructed on response content and format, (e.g. "be extremely succinct",
      "act friendly", "here are examples of good responses") and on audio behavior
      (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
      instructions are not guaranteed to be followed by the model, but they provide
      guidance to the model on the desired behavior.

      Note that the server sets default instructions which will be used if this field
      is not set and are visible in the `session.created` event at the start of the
      session.

  max_response_output_tokens: Maximum number of output tokens for a single assistant response, inclusive of
      tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
      `inf` for the maximum available tokens for a given model. Defaults to `inf`.

  modalities: The set of modalities the model can respond with. To disable audio, set this to
      ["text"].

  model: The Realtime model used for this session.

  output_audio_format: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
      For `pcm16`, output audio is sampled at a rate of 24kHz.

  temperature: Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
      temperature of 0.8 is highly recommended for best performance.

  tool_choice: How the model chooses tools. Options are `auto`, `none`, `required`, or specify
      a function.

  tools: Tools (functions) available to the model.

  turn_detection: Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
      set to `null` to turn off, in which case the client must manually trigger model
      response. Server VAD means that the model will detect the start and end of
      speech based on audio volume and respond at the end of user speech. Semantic VAD
      is more advanced and uses a turn detection model (in conjuction with VAD) to
      semantically estimate whether the user has finished speaking, then dynamically
      sets a timeout based on this probability. For example, if user audio trails off
      with "uhhm", the model will score a low probability of turn end and wait longer
      for the user to continue speaking. This can be useful for more natural
      conversations, but may have a higher latency.

  voice: The voice the model uses to respond. Voice cannot be changed during the session
      once the model has responded with audio at least once. Current voice options are
      `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
      `shimmer`, and `verse`.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
OpenAI-Betaassistants=v2/realtime/sessionsr,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   bodyoptionscast_to)_postr   r   SessionCreateParamsr   r   r!   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   s                     r"   createSessions.create.   s    l 'QM<ORQzz  *<3N1J$02L","+>#.#."&4" &99!$ )+Q[el */  
 	
r%    )returnr   )rN   r(   $r,   5Literal['pcm16', 'g711_ulaw', 'g711_alaw'] | NotGivenr-   z9session_create_params.InputAudioNoiseReduction | NotGivenr.   z8session_create_params.InputAudioTranscription | NotGivenr/   str | NotGivenr0   z%Union[int, Literal['inf']] | NotGivenr1   z)List[Literal['text', 'audio']] | NotGivenr2   zLiteral['gpt-4o-realtime-preview', 'gpt-4o-realtime-preview-2024-10-01', 'gpt-4o-realtime-preview-2024-12-17', 'gpt-4o-mini-realtime-preview', 'gpt-4o-mini-realtime-preview-2024-12-17'] | NotGivenr3   rP   r4   zfloat | NotGivenr5   rQ   r6   z/Iterable[session_create_params.Tool] | NotGivenr7   z.session_create_params.TurnDetection | NotGivenr8   z~Union[str, Literal['alloy', 'ash', 'ballad', 'coral', 'echo', 'fable', 'onyx', 'nova', 'sage', 'shimmer', 'verse']] | NotGivenr9   zHeaders | Noner:   zQuery | Noner;   zBody | Noner<   z'float | httpx.Timeout | None | NotGivenrN   r   
__name__
__module____qualname____firstlineno__r   r#   r)   r
   rK   __static_attributes__rM   r%   r"   r   r      s?   - - 3 3 U^aj^g'0LU@I U^(1&/AJIR  )-$("&;D?O
 RO
 &_	O

 $\O
 %O
 %JO
 >O
O
" S#O
$ &%O
& $'O
( ?)O
* G+O
,-O
8 &9O
: ";O
<  =O
> 9?O
@ 
AO
 O
r%   c                      \ rS rSr\SS j5       r\S	S j5       r\\\\\\\\\\\\\SSS\S.                                   S
S jjrSr	g)r      c                    [        U 5      $ r   )AsyncSessionsWithRawResponser    s    r"   r#   AsyncSessions.with_raw_response   s     ,D11r%   c                    [        U 5      $ r'   )"AsyncSessionsWithStreamingResponser    s    r"   r)   %AsyncSessions.with_streaming_response   s     2$77r%   Nr+   c                  #    SS0U=(       d    0 EnU R                  S[        UUUUUUUUU	U
UUUS.[        R                  5      I Sh  vN [	        XUUS9[
        S9I Sh  vN $  N N7f)r>   r?   r@   rA   rB   NrC   rD   )rH   r   r   rI   r   r   rJ   s                     r"   rK   AsyncSessions.create   s     l 'QM<ORQZZ ,*<3N1J$02L","+>#.#."&4" &99! $ )+Q[el */   
 
 	

s$   AA+	A'

A+"A)#A+)A+rM   )rN   r[   )rN   r^   rO   rR   rM   r%   r"   r   r      s?   2 2 8 8 U^aj^g'0LU@I U^(1&/AJIR  )-$("&;D?O
 RO
 &_	O

 $\O
 %O
 %JO
 >O
O
" S#O
$ &%O
& $'O
( ?)O
* G+O
,-O
8 &9O
: ";O
<  =O
> 9?O
@ 
AO
 O
r%   c                      \ rS rSrSS jrSrg)r   if  c                Z    Xl         [        R                  " UR                  5      U l        g N)	_sessionsr	   to_raw_response_wrapperrK   r!   sessionss     r"   __init__ SessionsWithRawResponse.__init__g  s     !&>>OO
r%   re   rK   Nrh   r   rN   NonerS   rT   rU   rV   ri   rW   rM   r%   r"   r   r   f      
r%   r   c                      \ rS rSrSS jrSrg)r[   io  c                Z    Xl         [        R                  " UR                  5      U l        g rd   )re   r	   async_to_raw_response_wrapperrK   rg   s     r"   ri   %AsyncSessionsWithRawResponse.__init__p  s     !&DDOO
r%   rk   Nrh   r   rN   rm   rn   rM   r%   r"   r[   r[   o  ro   r%   r[   c                      \ rS rSrSS jrSrg)r(   ix  c                D    Xl         [        UR                  5      U l        g rd   )re   r   rK   rg   s     r"   ri   &SessionsWithStreamingResponse.__init__y  s    !2OO
r%   rk   Nrl   rn   rM   r%   r"   r(   r(   x  ro   r%   r(   c                      \ rS rSrSS jrSrg)r^   i  c                D    Xl         [        UR                  5      U l        g rd   )re   r   rK   rg   s     r"   ri   +AsyncSessionsWithStreamingResponse.__init__  s    !8OO
r%   rk   Nrt   rn   rM   r%   r"   r^   r^     ro   r%   r^   ))
__future__r   typingr   r   r   typing_extensionsr   httpx r	   _typesr
   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   _base_clientr   types.beta.realtimer   +types.beta.realtime.session_create_responser   __all__r   r   r   r[   r(   r^   rM   r%   r"   <module>r      s    # ( ( %  ! @ @ ( ; Z 1 9 Q
'c
 c
Lc
$ c
L
 

 

 

 
r%   