
    _jK                        S r SSKJr  SSKJrJrJrJrJr  SSK	r	SSK
r
\(       a  SSKJrJr   " S S5      r " S S	5      rg)
z)Base client classes for the Research API.    )annotations)TYPE_CHECKINGAnyDictOptionalUnionN)ExaAsyncExac                  h    \ rS rSrSrSS jr    S	           S
S jjr S     SS jjrSrg)ResearchBaseClient   z4Base client for synchronous Research API operations.c                    Xl         SU l        g)zOInitialize the base client.

Args:
    client: The parent Exa client instance.
/research/v1N_client	base_pathselfclients     I/home/rurouni/.local/lib/python3.13/site-packages/exa_py/research/base.py__init__ResearchBaseClient.__init__        '    Nc                   U R                    U 3nU(       aZ  US:X  a  U R                  R                  USX$S9$ Uc  0 n[        U[        5      (       a  SUS'   U R                  R                  XcX$S9$ U R                  R                  XcX$S9$ )a2  Make a request to the Research API.

Args:
    endpoint: The API endpoint (relative to base_path).
    method: HTTP method to use.
    data: Request body data.
    params: Query parameters.
    stream: Whether to stream the response.

Returns:
    The API response as a dict or raw Response for streaming.
GETNdatamethodparamsTstream)r   r   request
isinstancedictr   endpointr   r   r    r!   full_endpoints          r   r"   ResearchBaseClient.request   s    (  >>*8*5 ||++!V ,  
 <DdD))%)DN||++!V ,   <<'' (  r   c                :    0 nUb  XS'   Ub  [        U5      US'   U$ zBuild pagination parameters for list requests.

Args:
    cursor: Pagination cursor.
    limit: Maximum number of results.

Returns:
    Dictionary of query parameters.
cursorlimitstrr   r+   r,   r    s       r   build_pagination_params*ResearchBaseClient.build_pagination_paramsG   /     %8!%jF7Or   r   )r   z'Exa'POSTNNF)r&   r.   r   r.   r   $Optional[Union[Dict[str, Any], str]]r    Optional[Dict[str, str]]r!   boolreturnz(Union[Dict[str, Any], requests.Response]NNr+   zOptional[str]r,   zOptional[int]r8   zDict[str, str]	__name__
__module____qualname____firstlineno____doc__r   r"   r0   __static_attributes__ r   r   r   r      s    >( 59+/++ + 3	+
 )+ + 
2+\ DH#3@	 r   r   c                  h    \ rS rSrSrSS jr    S	           S
S jjr S     SS jjrSrg)AsyncResearchBaseClient[   z5Base client for asynchronous Research API operations.c                    Xl         SU l        g)zZInitialize the async base client.

Args:
    client: The parent AsyncExa client instance.
r   Nr   r   s     r   r    AsyncResearchBaseClient.__init__^   r   r   Nc                \  #    U R                    U 3nU(       aj  US:X  a#  U R                  R                  USX$S9I Sh  vN $ Uc  0 n[        U[        5      (       a  SUS'   U R                  R                  XcX$S9I Sh  vN $ U R                  R                  XcX$S9I Sh  vN $  Ng N( N7f)a9  Make an async request to the Research API.

Args:
    endpoint: The API endpoint (relative to base_path).
    method: HTTP method to use.
    data: Request body data.
    params: Query parameters.
    stream: Whether to stream the response.

Returns:
    The API response as a dict or raw Response for streaming.
r   Nr   Tr!   )r   r   async_requestr#   r$   r%   s          r   r"   AsyncResearchBaseClient.requestg   s     (  >>*8*5 "\\77!V 8   
 <DdD))%)DN!\\77!V 8    33 4   s4   <B,B&A B,?B( !B,!B*"B,(B,*B,c                :    0 nUb  XS'   Ub  [        U5      US'   U$ r*   r-   r/   s       r   r0   /AsyncResearchBaseClient.build_pagination_params   r2   r   r   )r   z
'AsyncExa'r3   )r&   r.   r   r.   r   r5   r    r6   r!   r7   r8   z%Union[Dict[str, Any], httpx.Response]r9   r:   r;   rB   r   r   rD   rD   [   s    ?( 59+/++ + 3	+
 )+ + 
/+\ DH#3@	 r   rD   )r@   
__future__r   typingr   r   r   r   r   httpxrequests
exa_py.apir	   r
   r   rD   rB   r   r   <module>rR      s6    / " < <  (J JZJ Jr   