
    .h]                       d dl mZ d dlmZ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/m0Z0 ddl1m2Z2 ddgZ3 G d de      Z4 G d de      Z5 G d d      Z6 G d d      Z7 G d d      Z8 G d d      Z9y)     )annotations)AnyListIterablecast)LiteralN   )_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)SyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)item_list_paramsitem_create_paramsitem_retrieve_params)Conversation)ResponseIncludable)ConversationItem)ResponseInputItemParam)ConversationItemListItems
AsyncItemsc            	         e Zd Zedd       Zedd       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
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
        )ItemsWithRawResponseselfs    e/var/www/html/axiom-chatbot/venv/lib/python3.12/site-packages/openai/resources/conversations/items.pywith_raw_responsezItems.with_raw_response   s     $D))    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
        )ItemsWithStreamingResponser+   s    r-   with_streaming_responsezItems.with_streaming_response'   s     *$//r/   Nincludeextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  d| dt        d|it        j                        t        ||||t        d|it        j                              t              S )  
        Create items in a conversation with the given ID.

        Args:
          items: The items to add to the conversation. You may add up to 20 items at a time.

          include: Additional fields to include in the response. See the `include` parameter for
              [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
              for more information.

          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
        >Expected a non-empty value for `conversation_id` but received /conversations//itemsitemsr5   r6   r7   r8   r9   querybodyoptionscast_to)
ValueError_postr   r   ItemCreateParamsr   r$   r,   conversation_idr?   r5   r6   r7   r8   r9   s           r-   createzItems.create0   s    > ]^m]pqrrzzo.f5 '5!13E3V3VW(+'%%y'&:<N<_<_` )  
 	
r/   c                  |st        d|      |st        d|      t        t        | j                  d| d| t	        ||||t        d|it        j                              t        t        t                          S )  
        Get a single item from a conversation with the given IDs.

        Args:
          include: Additional fields to include in the response. See the `include` parameter for
              [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
              for more information.

          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<   6Expected a non-empty value for `item_id` but received r=   /items/r5   r@   rD   rE   )	rF   r   r"   _getr   r   r   ItemRetrieveParamsr   r,   item_idrJ   r5   r6   r7   r8   r9   s           r-   retrievezItems.retrieve^   s    : ]^m]pqrrUV]U`abbII!/!2''C,"/ +)#)9g*>@T@g@gh S"23  

 	
r/   afterr5   limitorderr6   r7   r8   r9   c                   |st        d|      | j                  d| dt        t           t	        ||||	t        ||||dt        j                              t        t        t                    S a  
        List all items for a conversation with the given ID.

        Args:
          after: An item ID to list items after, used in pagination.

          include: Specify additional output data to include in the model response. Currently
              supported values are:

              - `web_search_call.action.sources`: Include the sources of the web search tool
                call.
              - `code_interpreter_call.outputs`: Includes the outputs of python code execution
                in code interpreter tool call items.
              - `computer_call_output.output.image_url`: Include image urls from the computer
                call output.
              - `file_search_call.results`: Include the search results of the file search tool
                call.
              - `message.input_image.image_url`: Include image urls from the input message.
              - `message.output_text.logprobs`: Include logprobs with assistant messages.
              - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
                tokens in reasoning item outputs. This enables reasoning items to be used in
                multi-turn conversations when using the Responses API statelessly (like when
                the `store` parameter is set to `false`, or when an organization is enrolled
                in the zero data retention program).

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

          order: The order to return the input items in. Default is `desc`.

              - `asc`: Return the input items in ascending order.
              - `desc`: Return the input items in descending order.

          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>   )rW   r5   rX   rY   r@   )pagerD   model)
rF   _get_api_listr   r"   r   r   r   ItemListParamsr   r   
r,   rJ   rW   r5   rX   rY   r6   r7   r8   r9   s
             r-   listz
Items.list   s    p ]^m]pqrr!!o.f5+,<=(+'%%!&#*!&!&	 %33 s,-% " 
 	
r/   r6   r7   r8   r9   c          	         |st        d|      |st        d|      | j                  d| d| t        ||||      t              S )j  
        Delete an item from a conversation with the given IDs.

        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<   rN   r=   rO   rb   rP   rF   _deleter   r    r,   rT   rJ   r6   r7   r8   r9   s          r-   deletezItems.delete   ss    0 ]^m]pqrrUV]U`abb||o.ggY?(+Q[el !  
 	
r/   )returnr*   )ri   r2   rJ   strr?   z Iterable[ResponseInputItemParam]r5   List[ResponseIncludable] | Omitr6   Headers | Noner7   Query | Noner8   Body | Noner9   'float | httpx.Timeout | None | NotGivenri   r$   rT   rk   rJ   rk   r5   rl   r6   rm   r7   rn   r8   ro   r9   rp   ri   r"   )rJ   rk   rW   
str | Omitr5   rl   rX   
int | OmitrY   Literal['asc', 'desc'] | Omitr6   rm   r7   rn   r8   ro   r9   rp   ri   z,SyncConversationCursorPage[ConversationItem]rT   rk   rJ   rk   r6   rm   r7   rn   r8   ro   r9   rp   ri   r    __name__
__module____qualname__r   r.   r3   r   r   rK   rU   ra   rh    r/   r-   r%   r%      s   * * 0 0 48 )-$("&;D,
,
 0	,

 1,
 &,
 ",
  ,
 9,
 
,
f 48 )-$("&;D.
.
 	.

 1.
 &.
 ".
  .
 9.
 
.
h !37 /3 )-$("&;DM
M
 	M

 1M
 M
 -M
 &M
 "M
  M
 9M
 
6M
l )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
r/   c            	         e Zd Zedd       Zedd       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
ddded		 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zy)r&   c                    t        |       S r)   )AsyncItemsWithRawResponser+   s    r-   r.   zAsyncItems.with_raw_response  s     )..r/   c                    t        |       S r1   )AsyncItemsWithStreamingResponser+   s    r-   r3   z"AsyncItems.with_streaming_response  s     /t44r/   Nr4   c               $  K   |st        d|      | j                  d| dt        d|it        j                         d{   t        ||||t        d|it        j                         d{         t               d{   S 7 G7 7 w)	r;   r<   r=   r>   r?   Nr5   r@   rB   )rF   rG   r   r   rH   r   r$   rI   s           r-   rK   zAsyncItems.create  s     > ]^m]pqrrZZo.f5,gu-=?Q?b?bcc(+'%19g2FHZHkHkll )   
 
 	
c m
s6   A BB

+B.B/BBBBBc               6  K   |st        d|      |st        d|      t        t        | j                  d| d| t	        ||||t        d|it        j                         d{         t        t        t                     d{         S 7 -7 
w)	rM   r<   rN   r=   rO   r5   Nr@   rP   )	rF   r   r"   rQ   r   r   r   rR   r   rS   s           r-   rU   zAsyncItems.retrieveD  s     : ]^m]pqrrUV]U`abb))!/!2''C,"/ +)# 5y'6JL`LsLs tt S"23  
 

 	
 u
s$   A%B'B($BB
	BBrV   c                   |st        d|      | j                  d| dt        t           t	        ||||	t        ||||dt        j                              t        t        t                    S r[   )
rF   r^   r   r"   r   r   r   r_   r   r   r`   s
             r-   ra   zAsyncItems.listt  s    p ]^m]pqrr!!o.f5,-=>(+'%%!&#*!&!&	 %33 s,-% " 
 	
r/   rb   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rd   r<   rN   r=   rO   rb   rP   Nre   rg   s          r-   rh   zAsyncItems.delete  s     0 ]^m]pqrrUV]U`abb\\o.ggY?(+Q[el ! " 
 
 	
 
s   AAAA)ri   r}   )ri   r   rj   rq   )rJ   rk   rW   rr   r5   rl   rX   rs   rY   rt   r6   rm   r7   rn   r8   ro   r9   rp   ri   zOAsyncPaginator[ConversationItem, AsyncConversationCursorPage[ConversationItem]]ru   rv   rz   r/   r-   r&   r&     s   / / 5 5 48 )-$("&;D,
,
 0	,

 1,
 &,
 ",
  ,
 9,
 
,
f 48 )-$("&;D.
.
 	.

 1.
 &.
 ".
  .
 9.
 
.
h !37 /3 )-$("&;DM
M
 	M

 1M
 M
 -M
 &M
 "M
  M
 9M
 
YM
l )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
r/   c                      e Zd ZddZy)r*   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y N)_itemsr
   to_raw_response_wrapperrK   rU   ra   rh   r,   r?   s     r-   __init__zItemsWithRawResponse.__init__  ss    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r/   Nr?   r%   ri   Nonerw   rx   ry   r   rz   r/   r-   r*   r*         
r/   r*   c                      e Zd ZddZy)r}   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r   )r   r
   async_to_raw_response_wrapperrK   rU   ra   rh   r   s     r-   r   z"AsyncItemsWithRawResponse.__init__  ss    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r/   Nr?   r&   ri   r   r   rz   r/   r-   r}   r}     r   r/   r}   c                      e Zd ZddZy)r2   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rK   rU   ra   rh   r   s     r-   r   z#ItemsWithStreamingResponse.__init__  s[    2LL
 5NN
 1JJ
	 3LL
r/   Nr   r   rz   r/   r-   r2   r2     r   r/   r2   c                      e Zd ZddZy)r   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rK   rU   ra   rh   r   s     r-   r   z(AsyncItemsWithStreamingResponse.__init__  s[    8LL
 ;NN
 7JJ
	 9LL
r/   Nr   r   rz   r/   r-   r   r     r   r/   r   ):
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   r   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.conversationsr   r   r    types.conversations.conversationr    #types.responses.response_includabler!   %types.conversations.conversation_itemr"   )types.responses.response_input_item_paramr#   *types.conversations.conversation_item_listr$   __all__r%   r&   r*   r}   r2   r   rz   r/   r-   <module>r      s    # , , %    K K K < & : Y Q @ ] ] < E E O NL
!c
O c
Lc
! c
L
 
$
 
$
 
$
 
r/   