Ë
    ²ŒjJx  ã                  ó”  — d dl mZ d dlZd dlmZmZmZ d dlmZ d dlZddl	m
Z
 ddlmZmZmZmZmZmZmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZmZ ddlmZm Z  ddl!m"Z"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gZ0 G d„ de«      Z1 G d„ de«      Z2 G d„ d«      Z3 G d„ d«      Z4 G d„ d«      Z5 G d„ d«      Z6y)é    )ÚannotationsN)ÚUnionÚIterableÚOptional)ÚLiteralé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)Úmessage_list_paramsÚmessage_create_paramsÚmessage_update_params)ÚMessage)ÚMetadata)ÚMessageDeleted)ÚMessageContentPartParamÚMessagesÚAsyncMessagesc                  ó  — e Zd Zedd„«       Zedd„«       Z ej                  d«      eeddde	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z
 ej                  d«      ddde	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z ej                  d«      eddde	d	œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„«       Z ej                  d«      eeeeeddde	dœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z ej                  d«      ddde	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Zy)r#   c                ó   — t        | «      S ©a  
        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
        )ÚMessagesWithRawResponse©Úselfs    úp/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/openai/resources/beta/threads/messages.pyÚwith_raw_responsezMessages.with_raw_response    s   € ô ' tÓ,Ð,ó    c                ó   — t        | «      S ©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
        )ÚMessagesWithStreamingResponser)   s    r+   Úwith_streaming_responsez Messages.with_streaming_response*   s   € ô -¨TÓ2Ð2r-   ú>The Assistants API is deprecated in favor of the Responses APIN©ÚattachmentsÚmetadataÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc          
     óÄ   — |st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d�t        ||||dœt        j                  «      t        ||||	¬«      t        ¬«      S )	á/  
        Create a message.

        Args:
          content: The text contents of the message.

          role:
              The role of the entity that is creating the message. Allowed values include:

              - `user`: Indicates the message is sent by an actual user and should be used in
                most cases to represent user-generated messages.
              - `assistant`: Indicates the message is generated by the assistant. Use this
                value to insert messages from the assistant into the conversation.

          attachments: A list of files attached to the message, and the tools they should be added to.

          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format, and
              querying for objects via API or the dashboard.

              Keys are strings with a maximum length of 64 characters. Values are strings with
              a maximum length of 512 characters.

          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
        ú8Expected a non-empty value for `thread_id` but received úOpenAI-Betaúassistants=v2ú	/threads/ú	/messages©ÚcontentÚroler4   r5   ©r6   r7   r8   r9   ©ÚbodyÚoptionsÚcast_to)Ú
ValueErrorÚ_postr   r   ÚMessageCreateParamsr   r   ©
r*   Ú	thread_idrB   rC   r4   r5   r6   r7   r8   r9   s
             r+   ÚcreatezMessages.create3   s‘   € ñ^ ÜÐWÐXaÐWdÐeÓfÐfØ&¨ÐQ¸MÒ<OÈRÐQˆØ�z‰zØ˜	�{ )Ð,Ü à&Ø Ø#.Ø (ñ	ô &×9Ñ9óô )Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r-   rD   c          	     ó¬   — |st        d|›�«      ‚|st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d|› �t        ||||¬«      t        ¬«      S )	áG  
        Retrieve a message.

        Args:
          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
        r<   ú9Expected a non-empty value for `message_id` but received r=   r>   r?   ú
/messages/rD   ©rG   rH   ©rI   Ú_getr   r   ©r*   Ú
message_idrM   r6   r7   r8   r9   s          r+   ÚretrievezMessages.retrievev   s†   € ñ2 ÜÐWÐXaÐWdÐeÓfÐfÙÜÐXÐYcÐXfÐgÓhÐhØ&¨ÐQ¸MÒ<OÈRÐQˆØ�y‰yØ˜	�{ *¨Z¨LÐ9Ü(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r-   ©r5   r6   r7   r8   r9   c          
     óâ   — |st        d|›�«      ‚|st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d|› �t        d|it        j                  «      t        ||||¬«      t        ¬	«      S )
áÙ  
        Modifies a message.

        Args:
          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format, and
              querying for objects via API or the dashboard.

              Keys are strings with a maximum length of 64 characters. Values are strings with
              a maximum length of 512 characters.

          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
        r<   rQ   r=   r>   r?   rR   r5   rD   rE   )rI   rJ   r   r   ÚMessageUpdateParamsr   r   ©r*   rW   rM   r5   r6   r7   r8   r9   s           r+   ÚupdatezMessages.updateœ   s�   € ñB ÜÐWÐXaÐWdÐeÓfÐfÙÜÐXÐYcÐXfÐgÓhÐhØ&¨ÐQ¸MÒ<OÈRÐQˆØ�z‰zØ˜	�{ *¨Z¨LÐ9Ü  *¨hÐ!7Ô9N×9bÑ9bÓcÜ(Ø+¸ÐQ[Ðelôô ð ó 
ð 	
r-   ©	ÚafterÚbeforeÚlimitÚorderÚrun_idr6   r7   r8   r9   c       	        óÞ   — |st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d�t        t           t	        |||	|
t        |||||dœt        j                  «      ¬«      t        ¬«      S ©	ah  
        Returns a list of messages for a given thread.

        Args:
          after: A cursor for use in pagination. `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          before: A cursor for use in pagination. `before` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              starting with obj_foo, your subsequent call can include before=obj_foo in order
              to fetch the previous page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `desc` for descending order.

          run_id: Filter messages by the run ID that generated them.

          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
        r<   r=   r>   r?   r@   )r`   ra   rb   rc   rd   )r6   r7   r8   r9   Úquery)ÚpagerG   Úmodel)rI   Ú_get_api_listr   r   r   r   r   ÚMessageListParams©r*   rM   r`   ra   rb   rc   rd   r6   r7   r8   r9   s              r+   ÚlistzMessages.listË   s�   € ñ^ ÜÐWÐXaÐWdÐeÓfÐfØ&¨ÐQ¸MÒ<OÈRÐQˆØ×!Ñ!Ø˜	�{ )Ð,Ü¤Ñ(Ü(Ø+Ø'Ø%ØÜ%à!&Ø"(Ø!&Ø!&Ø"(ñô (×9Ñ9ó	ôô  ð' "ó 
ð 	
r-   c          	     ó¬   — |st        d|›�«      ‚|st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d|› �t        ||||¬«      t        ¬«      S )	áF  
        Deletes a message.

        Args:
          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
        r<   rQ   r=   r>   r?   rR   rD   rS   ©rI   Ú_deleter   r!   rV   s          r+   ÚdeletezMessages.delete  s†   € ñ2 ÜÐWÐXaÐWdÐeÓfÐfÙÜÐXÐYcÐXfÐgÓhÐhØ&¨ÐQ¸MÒ<OÈRÐQˆØ�|‰|Ø˜	�{ *¨Z¨LÐ9Ü(Ø+¸ÐQ[Ðelôô #ð ó 
ð 	
r-   )Úreturnr(   )rs   r0   ©rM   ÚstrrB   z-Union[str, Iterable[MessageContentPartParam]]rC   zLiteral['user', 'assistant']r4   z;Optional[Iterable[message_create_params.Attachment]] | Omitr5   úOptional[Metadata] | Omitr6   úHeaders | Noner7   úQuery | Noner8   úBody | Noner9   ú'float | httpx.Timeout | None | NotGivenrs   r   ©rW   ru   rM   ru   r6   rw   r7   rx   r8   ry   r9   rz   rs   r   ©rW   ru   rM   ru   r5   rv   r6   rw   r7   rx   r8   ry   r9   rz   rs   r   )rM   ru   r`   ú
str | Omitra   r}   rb   ú
int | Omitrc   úLiteral['asc', 'desc'] | Omitrd   r}   r6   rw   r7   rx   r8   ry   r9   rz   rs   zSyncCursorPage[Message]©rW   ru   rM   ru   r6   rw   r7   rx   r8   ry   r9   rz   rs   r!   ©Ú__name__Ú
__module__Ú__qualname__r   r,   r1   Útyping_extensionsÚ
deprecatedr   r   rN   rX   r^   rm   rr   © r-   r+   r#   r#      s  „ Øò-ó ð-ð ò3ó ð3ð "Ð×!Ñ!Ð"bÓcð TXØ.2ð )-Ø$(Ø"&Ø;Dñ@
àð@
ð ?ð	@
ð
 +ð@
ð Qð@
ð ,ð@
ð &ð@
ð "ð@
ð  ð@
ð 9ð@
ð 
ò@
ó dð@
ðD "Ð×!Ñ!Ð"bÓcð )-Ø$(Ø"&Ø;Dñ#
àð#
ð ð	#
ð &ð#
ð "ð#
ð  ð#
ð 9ð#
ð 
ò#
ó dð#
ðJ "Ð×!Ñ!Ð"bÓcð /3ð )-Ø$(Ø"&Ø;Dñ,
àð,
ð ð	,
ð
 ,ð,
ð &ð,
ð "ð,
ð  ð,
ð 9ð,
ð 
ò,
ó dð,
ð\ "Ð×!Ñ!Ð"bÓcð
 !Ø!Ø Ø/3Ø!ð )-Ø$(Ø"&Ø;DñE
àðE
ð ð	E
ð
 ðE
ð ðE
ð -ðE
ð ðE
ð &ðE
ð "ðE
ð  ðE
ð 9ðE
ð 
!òE
ó dðE
ðN "Ð×!Ñ!Ð"bÓcð )-Ø$(Ø"&Ø;Dñ#
àð#
ð ð	#
ð &ð#
ð "ð#
ð  ð#
ð 9ð#
ð 
ò#
ó dñ#
r-   c                  ó  — e Zd Zedd„«       Zedd„«       Z ej                  d«      eeddde	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z
 ej                  d«      ddde	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z ej                  d«      eddde	d	œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„«       Z ej                  d«      eeeeeddde	dœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z ej                  d«      ddde	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Zy)r$   c                ó   — t        | «      S r'   )ÚAsyncMessagesWithRawResponser)   s    r+   r,   zAsyncMessages.with_raw_response;  s   € ô ,¨DÓ1Ð1r-   c                ó   — t        | «      S r/   )Ú"AsyncMessagesWithStreamingResponser)   s    r+   r1   z%AsyncMessages.with_streaming_responseE  s   € ô 2°$Ó7Ð7r-   r2   Nr3   c          
   ƒ  óô   K  — |st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d�t        ||||dœt        j                  «      ƒ d{  –—† t        ||||	¬«      t        ¬	«      ƒ d{  –—† S 7 Œ$7 Œ­w)
r;   r<   r=   r>   r?   r@   rA   NrD   rE   )rI   rJ   r   r   rK   r   r   rL   s
             r+   rN   zAsyncMessages.createN  sª   è ø€ ñ^ ÜÐWÐXaÐWdÐeÓfÐfØ&¨ÐQ¸MÒ<OÈRÐQˆØ—Z‘ZØ˜	�{ )Ð,Ü,à&Ø Ø#.Ø (ñ	ô &×9Ñ9ó÷ ô )Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
ðøð
ús$   ‚AA8ÁA4
ÁA8Á/A6Á0A8Á6A8rD   c          	   ƒ  óÈ   K  — |st        d|›�«      ‚|st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d|› �t        ||||¬«      t        ¬«      ƒ d	{  –—† S 7 Œ­w)
rP   r<   rQ   r=   r>   r?   rR   rD   rS   NrT   rV   s          r+   rX   zAsyncMessages.retrieve‘  s”   è ø€ ñ2 ÜÐWÐXaÐWdÐeÓfÐfÙÜÐXÐYcÐXfÐgÓhÐhØ&¨ÐQ¸MÒ<OÈRÐQˆØ—Y‘YØ˜	�{ *¨Z¨LÐ9Ü(Ø+¸ÐQ[Ðelôô ð ó 
÷ 
ð 	
ð 
úó   ‚AA"ÁA ÁA"rY   c          
   ƒ  ó  K  — |st        d|›�«      ‚|st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d|› �t        d|it        j                  «      ƒ d{  –—† t        ||||¬	«      t        ¬
«      ƒ d{  –—† S 7 Œ$7 Œ­w)r[   r<   rQ   r=   r>   r?   rR   r5   NrD   rE   )rI   rJ   r   r   r\   r   r   r]   s           r+   r^   zAsyncMessages.update·  s²   è ø€ ñB ÜÐWÐXaÐWdÐeÓfÐfÙÜÐXÐYcÐXfÐgÓhÐhØ&¨ÐQ¸MÒ<OÈRÐQˆØ—Z‘ZØ˜	�{ *¨Z¨LÐ9Ü,¨j¸(Ð-CÔEZ×EnÑEnÓo×oÜ(Ø+¸ÐQ[Ðelôô ð  ó 
÷ 
ð 	
àoøð
ús$   ‚ABÁB
ÁBÁ>BÁ?BÂBr_   c       	        óÞ   — |st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d�t        t           t	        |||	|
t        |||||dœt        j                  «      ¬«      t        ¬«      S rf   )rI   rj   r   r   r   r   r   rk   rl   s              r+   rm   zAsyncMessages.listæ  s�   € ñ^ ÜÐWÐXaÐWdÐeÓfÐfØ&¨ÐQ¸MÒ<OÈRÐQˆØ×!Ñ!Ø˜	�{ )Ð,Ü ¤Ñ)Ü(Ø+Ø'Ø%ØÜ%à!&Ø"(Ø!&Ø!&Ø"(ñô (×9Ñ9ó	ôô  ð' "ó 
ð 	
r-   c          	   ƒ  óÈ   K  — |st        d|›�«      ‚|st        d|›�«      ‚ddi|xs i ¥}| j                  d|› d|› �t        ||||¬«      t        ¬«      ƒ d	{  –—† S 7 Œ­w)
ro   r<   rQ   r=   r>   r?   rR   rD   rS   Nrp   rV   s          r+   rr   zAsyncMessages.delete.  s”   è ø€ ñ2 ÜÐWÐXaÐWdÐeÓfÐfÙÜÐXÐYcÐXfÐgÓhÐhØ&¨ÐQ¸MÒ<OÈRÐQˆØ—\‘\Ø˜	�{ *¨Z¨LÐ9Ü(Ø+¸ÐQ[Ðelôô #ð "ó 
÷ 
ð 	
ð 
úr�   )rs   rŠ   )rs   rŒ   rt   r{   r|   )rM   ru   r`   r}   ra   r}   rb   r~   rc   r   rd   r}   r6   rw   r7   rx   r8   ry   r9   rz   rs   z1AsyncPaginator[Message, AsyncCursorPage[Message]]r€   r�   r‡   r-   r+   r$   r$   :  s  „ Øò2ó ð2ð ò8ó ð8ð "Ð×!Ñ!Ð"bÓcð TXØ.2ð )-Ø$(Ø"&Ø;Dñ@
àð@
ð ?ð	@
ð
 +ð@
ð Qð@
ð ,ð@
ð &ð@
ð "ð@
ð  ð@
ð 9ð@
ð 
ò@
ó dð@
ðD "Ð×!Ñ!Ð"bÓcð )-Ø$(Ø"&Ø;Dñ#
àð#
ð ð	#
ð &ð#
ð "ð#
ð  ð#
ð 9ð#
ð 
ò#
ó dð#
ðJ "Ð×!Ñ!Ð"bÓcð /3ð )-Ø$(Ø"&Ø;Dñ,
àð,
ð ð	,
ð
 ,ð,
ð &ð,
ð "ð,
ð  ð,
ð 9ð,
ð 
ò,
ó dð,
ð\ "Ð×!Ñ!Ð"bÓcð
 !Ø!Ø Ø/3Ø!ð )-Ø$(Ø"&Ø;DñE
àðE
ð ð	E
ð
 ðE
ð ðE
ð -ðE
ð ðE
ð &ðE
ð "ðE
ð  ðE
ð 9ðE
ð 
;òE
ó dðE
ðN "Ð×!Ñ!Ð"bÓcð )-Ø$(Ø"&Ø;Dñ#
àð#
ð ð	#
ð &ð#
ð "ð#
ð  ð#
ð 9ð#
ð 
ò#
ó dñ#
r-   c                  ó   — e Zd Zdd„Zy)r(   c                óz  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        t        j                  |j                  «      | _        y ©N)Ú	_messagesr	   Úto_raw_response_wrapperrN   rX   r^   rm   rr   ©r*   Úmessagess     r+   Ú__init__z MessagesWithRawResponse.__init__V  s¡   € Ø!ˆŒô ×4Ñ4Ø—‘óð 	Œô ×4Ñ4Ø×!Ñ!óð 	Œô ×4Ñ4Ø—‘óð 	Œô ×4Ñ4Ø—‘óð 	Œ	ô ×4Ñ4Ø—‘óð 	�r-   N©r™   r#   rs   ÚNone©r‚   rƒ   r„   rš   r‡   r-   r+   r(   r(   U  ó   „ ô
r-   r(   c                  ó   — e Zd Zdd„Zy)rŠ   c                óz  — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        t        j                  |j                  «      | _        t        j                  |j                  «      | _        y r•   )r–   r	   Úasync_to_raw_response_wrapperrN   rX   r^   rm   rr   r˜   s     r+   rš   z%AsyncMessagesWithRawResponse.__init__u  s¡   € Ø!ˆŒô ×:Ñ:Ø—‘óð 	Œô ×:Ñ:Ø×!Ñ!óð 	Œô ×:Ñ:Ø—‘óð 	Œô ×:Ñ:Ø—‘óð 	Œ	ô ×:Ñ:Ø—‘óð 	�r-   N©r™   r$   rs   rœ   r�   r‡   r-   r+   rŠ   rŠ   t  rž   r-   rŠ   c                  ó   — e Zd Zdd„Zy)r0   c                ó  — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        t        |j                  «      | _        y r•   )r–   r   rN   rX   r^   rm   rr   r˜   s     r+   rš   z&MessagesWithStreamingResponse.__init__”  sƒ   € Ø!ˆŒô )Ø—‘óð 	Œô )Ø×!Ñ!óð 	Œô )Ø—‘óð 	Œô )Ø—‘óð 	Œ	ô )Ø—‘óð 	�r-   Nr›   r�   r‡   r-   r+   r0   r0   “  rž   r-   r0   c                  ó   — e Zd Zdd„Zy)rŒ   c                ó  — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        t        |j
                  «      | _        t        |j                  «      | _        y r•   )r–   r   rN   rX   r^   rm   rr   r˜   s     r+   rš   z+AsyncMessagesWithStreamingResponse.__init__³  sƒ   € Ø!ˆŒô /Ø—‘óð 	Œô /Ø×!Ñ!óð 	Œô /Ø—‘óð 	Œô /Ø—‘óð 	Œ	ô /Ø—‘óð 	�r-   Nr¢   r�   r‡   r-   r+   rŒ   rŒ   ²  rž   r-   rŒ   )7Ú
__future__r   r…   Útypingr   r   r   r   ÚhttpxÚ r	   Ú_typesr
   r   r   r   r   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.threadsr   r   r   Útypes.beta.threads.messager   Útypes.shared_params.metadatar    Ú"types.beta.threads.message_deletedr!   Ú-types.beta.threads.message_content_part_paramr"   Ú__all__r#   r$   r(   rŠ   r0   rŒ   r‡   r-   r+   Ú<module>r¸      sŸ   ðõ #ã ß ,Ñ ,Ý %ã å !ß L× LÑ Lß =Ý 'ß ;ß Zß :÷÷ eÑ dÝ 2Ý 5Ý AÝ Uà�Ð
'€ôX
ˆô X
ôvX
Ð$ô X
÷v
ñ 
÷>
ñ 
÷>
ñ 
÷>
ò 
r-   