+
    Wi=                      ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
HtHtHtHtHtHtHtHtHtHtHtHtHt ^RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ R	I H!t! ^ R
I"H#t# ^ RI$H%t%H&t&H't'H(t(H)t)H*t*H+t+ ^RIH,t, ^RI-H.t. ^RI/H0t0H1t1 ^RI2H3t3H4t4 ]Pj                  ! R4      R8H  t6Rt7R R lt8. 3R R llt9R R lt:R R lt;R R lt<]R,          t= ]R,          t>  ! R R]#RR 7      t? ! R! R"]#RR 7      t@]]?]@3,          tA / R#]B.bR$]C.bR%]D.bR&]D.bR']B.bR(]B.bR)]B.bR*]B.bR+]B.bR,]D.bR-]D.bR.]>]B.bR/]=.bR0]D.bR1]E.bR2]F]E.bR3]D.bR4]B.R5]F.R6]E./CtGR7]B.R$]C.R%]D.R&]D.R']B.R(]B.R)]B.R*]B.R,]D.R-]D.R8]E.R/]=.R0]D.R2]F]E./tH]R,          tIR9]D.R:]F]E.R;]F]E.R<]F]E.R=]F]E.R>]F]E.R?]C.R@]I.RA]C.RB]E.R0]D./tJRC]C.RD]B]D.RE]F.R0]D./tKRF RG ltLRH tMRI RJ ltN]R,          tO ]R,          tP  ! RK RL]#RR 7      tQ ! RM RN]#RR 7      tR ! RO RP]#RR 7      tS ! RQ RR]#RR 7      tT ! RS RT]#RR 7      tU ! RU RV]#RR 7      tV ! RW RX]#RR 7      tW ! RY RZ]#RR 7      tX ! R[ R\]#RR 7      tY] ! R] R^4      4       tZ] ! R_ R`4      4       t[] ! Ra Rb4      4       t\] ! Rc Rd4      4       t]] ! Re Rf4      4       t^] ! Rg Rh4      4       t_] ! Ri Rj4      4       t`] ! Rk Rl4      4       ta] ! Rm Rn4      4       tb] ! Ro Rp4      4       tc] ! Rq Rr4      4       td] ! Rs Rt4      4       te] ! Ru Rv4      4       tf]]e]f3,          tg] ! Rw Rx4      4       th] ! Ry Rz]h4      4       ti] ! R{ R|]h4      4       tj] ! R} R~]h4      4       tk] ! R R]h4      4       tl] ! R R4      4       tm] ! R R4      4       tn] ! R R4      4       to ! R R4      tp ! R R4      tq ! R R]p4      tr ! R R]q4      ts]! R4      tt] ! R R4      4       tu] ! R R]]t,          4      4       tv] ! R R4      4       tw]R,          tx ] ! R R4      4       ty] ! R R4      4       tzR R lt{R R lt| ! R R4      t} ! R R]}4      t~R# )    )annotationsN)	dataclass)wraps)AnyCallableDictGenericIterableIteratorListLiteralOptionalTypeVarUnionget_args
get_originoverload)AsyncWebsetsClient)OpenAI)ChatCompletionMessageParam)	ChatModel)	TypedDict)ExaOpenAICompletion_convert_schema_input_get_package_versionadd_message_to_messagesformat_exa_resultmaybe_get_queryJSONSchemaInput)WebsetsClient)ExaJSONEncoder)SearchMonitorsClientAsyncSearchMonitorsClient)ResearchClientAsyncResearchClientIS_BETATruei'  c                    V ^8  d   QhRRRR/# )   	snake_strstrreturn )formats   "I/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/exa_py/api.py__annotate__r0   7   s     F Fc Fc F    c                    V R8X  d   R# V R8X  d   R# V P                  R4      pV^ ,          RP                  R VR,           4       4      ,           # )	zConvert snake_case string to camelCase.

Args:
    snake_str (str): The string in snake_case format.

Returns:
    str: The string converted to camelCase format.
schema_z$schemanot_not_ c              3  @   "   T F  qP                  4       x  K  	  R # 5iN)title).0xs   & r/   	<genexpr>!snake_to_camel.<locals>.<genexpr>G   s     "En7799ns   :   NN)splitjoin)r*   
componentss   & r/   snake_to_camelrC   7   sJ     IF%Ja=277"Ejn"EEEEr1   c               $    V ^8  d   QhRRRRRR/# )r)   datadict	skip_keysz	list[str]r,   r-   )r.   s   "r/   r0   r0   J   s!        D r1   c           	         \        V \        4      '       d\   V P                  4        UUu/ uF>  w  r#Vf   K  \        V4      \        V\        4      '       d   W!9  d   \	        W14      MTbK@  	  upp# V # u uppi )z
Convert keys in a dictionary from snake_case to camelCase recursively.

Args:
    data (dict): The dictionary with keys in snake_case format.

Returns:
    dict: The dictionary with keys converted to camelCase format.
)
isinstancerF   itemsrC   to_camel_case)rE   rG   kvs   &&  r/   rK   rK   J   sy     $
 

	
 %	N1!T""q'9  -Q: %	
 	
 K
s
   A47A4c                    V ^8  d   QhRRRR/# )r)   	camel_strr+   r,   r-   )r.   s   "r/   r0   r0   _   s     
D 
Dc 
Dc 
Dr1   c                ~    \         P                  ! RRV 4      p\         P                  ! RRV4      P                  4       # )zConvert camelCase string to snake_case.

Args:
    camel_str (str): The string in camelCase format.

Returns:
    str: The string converted to snake_case format.
z(.)([A-Z][a-z]+)z\1_\2z([a-z0-9])([A-Z]))resublower)rO   r*   s   & r/   camel_to_snakerT   _   s4     )8Y?I66%x;AACCr1   c                    V ^8  d   QhRRRR/# )r)   rE   rF   r,   r-   )r.   s   "r/   r0   r0   l   s        r1   c           	         \        V \        4      '       dP   V P                  4        UUu/ uF2  w  r\        V4      \        V\        4      '       d   \	        V4      MTbK4  	  upp# V # u uppi )z
Convert keys in a dictionary from camelCase to snake_case recursively.

Args:
    data (dict): The dictionary with keys in camelCase format.

Returns:
    dict: The dictionary with keys converted to snake_case format.
)rI   rF   rJ   rT   to_snake_case)rE   rL   rM   s   &  r/   rW   rW   l   sd     $ 


$ 1:a3F3F}Q/AM$
 	
 K	
s   8A(c                    V ^8  d   QhRRRR/# )r)   entities_datazOptional[List[dict]]r,   zOptional[List]r-   )r.   s   "r/   r0   r0   ~   s     w* w*#7 w*N w*r1   c                ~  aa	a
aaaaaaaaaaaaa V '       g   R# ^ RI HpHpHoHoHoHoHo	Ho
H	oH
oHoHo R V3R lloR V3R lloR VVV3R lloR	 V
3R
 lloR V	V3R lloR V3R lloR VVVVV3R llpR VV3R llp. pV  F  pVP                  R4      pVR8X  dB   VP                  V! VR,          RVR,          V! VP                  R/ 4      4      R7      4       K\  VR8X  g   Ke  VP                  V! VR,          RVR,          V! VP                  R/ 4      4      R7      4       K  	  V'       d   V# R# )z
Parse entity data from API response into Entity dataclasses.

Handles field mapping for reserved Python keywords:
- 'from' -> 'from_date'
- 'to' -> 'to_date'
N)CompanyEntityPersonEntityEntityCompanyPropertiesEntityPersonProperties EntityCompanyPropertiesWorkforce#EntityCompanyPropertiesHeadquarters!EntityCompanyPropertiesFinancials#EntityCompanyPropertiesFundingRound!EntityCompanyPropertiesWebTrafficEntityDateRange EntityPersonPropertiesCompanyRef&EntityPersonPropertiesWorkHistoryEntryc                    V ^8  d   QhRRRR/# )r)   rE   Optional[dict]r,   Optional[EntityDateRange]r-   )r.   s   "r/   r0   %_parse_entities.<locals>.__annotate__   s     
 
~ 
2K 
r1   c                h   < V '       g   R # S! V P                  R4      V P                  R4      R7      # )Nfromto)	from_dateto_dateget)rE   rd   s   &r/   parse_date_range)_parse_entities.<locals>.parse_date_range   s-    hhv&HHTN
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rh   r,   *Optional[EntityPersonPropertiesCompanyRef]r-   )r.   s   "r/   r0   rj      s     
 
 
3] 
r1   c                h   < V '       g   R # S! V P                  R4      V P                  R4      R7      # )Nidname)rw   rx   rp   )rE   re   s   &r/   parse_company_ref*_parse_entities.<locals>.parse_company_ref   s-    /xx~&!
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rF   r,   rf   r-   )r.   s   "r/   r0   rj      s     
 
t 
0V 
r1   c           
        < S! V P                  R 4      V P                  R4      S! V P                  R4      4      S! V P                  R4      4      R7      # )r:   locationdatescompany)r:   r}   r~   r   rp   )rE   rf   ry   rr   s   &r/   parse_work_history_entry1_parse_entities.<locals>.parse_work_history_entry   sJ    5((7#XXj)"488G#45%dhhy&9:	
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rh   r,   -Optional[EntityCompanyPropertiesFundingRound]r-   )r.   s   "r/   r0   rj      s     
 
. 
5b 
r1   c                   < V '       g   R # S! V P                  R4      V P                  R4      V P                  R4      R7      # )Nrx   dateamount)rx   r   r   rp   )rE   rb   s   &r/   parse_funding_round,_parse_entities.<locals>.parse_funding_round   s:    2&!&!88H%
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rh   r,   +Optional[EntityCompanyPropertiesFinancials]r-   )r.   s   "r/   r0   rj      s     
 
~ 
2] 
r1   c           	        < V '       g   R # S! V P                  R4      V P                  R4      S! V P                  R4      4      R7      # )NrevenueAnnualfundingTotalfundingLatestRound)revenue_annualfunding_totalfunding_latest_roundrp   )rE   ra   r   s   &r/   parse_financials)_parse_entities.<locals>.parse_financials   s@    088O4((>2!4TXX>R5S!T
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rh   r,   +Optional[EntityCompanyPropertiesWebTraffic]r-   )r.   s   "r/   r0   rj      s     
 
 
3^ 
r1   c                H   < V '       g   R # S! V P                  R4      R7      # )NvisitsMonthly)visits_monthlyrp   )rE   rc   s   &r/   parse_web_traffic*_parse_entities.<locals>.parse_web_traffic   s"    088O4
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rF   r,   r]   r-   )r.   s   "r/   r0   rj      s     
 
t 
0G 
r1   c                  < V P                  R 4      pV P                  R4      pS! V P                  R4      V P                  R4      V P                  R4      V'       d   S! VP                  R4      R7      MRV'       dI   S! VP                  R4      VP                  R	4      VP                  R
4      VP                  R4      R7      MRS! V P                  R4      4      S! V P                  R4      4      R7      # )	workforceheadquartersrx   foundedYeardescriptiontotalr   Naddresscity
postalCodecountry)r   r   postal_coder   
financials
webTraffic)rx   founded_yearr   r   r   r   web_trafficrp   )rE   workforce_dataheadquarters_datar]   r`   r_   r   r   s   &  r/   parse_company_properties1_parse_entities.<locals>.parse_company_properties   s    +. HH^4&&!-0/]k6^=O=OPW=XYqu # =)--i8&**62-11,?)--i8	
 )-'(>?)$((<*@A
 	
r1   c                    V ^8  d   QhRRRR/# )r)   rE   rF   r,   r^   r-   )r.   s   "r/   r0   rj      s     
 
d 
/E 
r1   c           
        < V P                  R 4      pS! V P                  R4      V P                  R4      V'       d   V Uu. uF  pS! V4      NK  	  upR7      # RR7      # u upi )workHistoryrx   r}   N)rx   r}   work_historyrp   )rE   r   whr^   r   s   &  r/   parse_person_properties0_parse_entities.<locals>.parse_person_properties   sg    xx.%&!XXj)R^N2226N
 	
 ei
 	
 Os   A!typer   rw   version
properties)rw   r   r   r   person)
exa_py.apir[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rq   append)rY   r[   r\   r   r   entitiesentity_dataentity_typer]   ra   rb   r`   rc   r_   rd   r^   re   rf   ry   rr   r   r   r   r   s   &       @@@@@@@@@@@@@@@@r/   _parse_entitiesr   ~   s$       
 

 

 

 

 

 

 
$
 
 H$!oof-)#OOMt$#I.3KOOLRT4UV	  H$OOLt$#I.2;??<QS3TU	  %   8)T)r1   c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )	DeepTextOutputSchemai  z0Deep search output schema for plain-text output.zLiteral['text']r   r+   r   r-   N__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r-   r1   r/   r   r     s    :
r1   r   Fr   c                  :    ] tR tRt$ RtR]R&   R]R&   R]R&   R	tR
# )DeepObjectOutputSchemai  z<Deep search output schema for structured JSON object output.zLiteral['object']r   zDict[str, Any]r   	List[str]requiredr-   Nr   r-   r1   r/   r   r     s    F
r1   r   querynum_resultsinclude_domainsexclude_domainsstart_crawl_dateend_crawl_datestart_published_dateend_published_dateuser_locationinclude_textexclude_textr   categoryflags
moderationcontentsadditional_queriessystem_promptoutput_schemastreamurlexclude_source_domainurlstextsummary
highlightscontextmetadatalivecrawl_timeout	livecrawlmax_age_hoursfilter_empty_resultssubpagessubpage_targetextrasc               $    V ^8  d   QhRRRRRR/# )r)   optionszDict[str, Optional[object]]expectedrF   r,   Noner-   )r.   s   "r/   r0   r0     s$      (48	r1   c           	     *  a V P                  4        F}  w  poW!9  d   \        RV R24      hSf   K!  W,          p\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   Kk  \        RV RS R	V 24      h	  R# )
a  Validate an options dict against expected types and constraints.

Args:
    options (Dict[str, Optional[object]]): The options to validate.
    expected (dict): The expected types for each option.

Raises:
    ValueError: If an invalid option or option type is provided.
zInvalid option: ''Nc              3  <   <"   T F  p\        SV4      x  K  	  R # 5ir9   )is_valid_type)r;   tvalues   & r/   r=   *validate_search_options.<locals>.<genexpr>  s     CNq=**Ns   TFzInvalid value for option 'z': z. Expected one of )rJ   
ValueErrorany)r   r   keyexpected_typesr   s   &&  @r/   validate_search_optionsr     s     mmo
U0Q788=!sCNCsssCNCCC,SEUG;MnM]^  &r1   c                    \        V4      \        J d   V \        V4      9   # \        V\        4      '       d   \        W4      # R # )F)r   r   r   rI   r   )r   expected_types   &&r/   r   r     s:    - G+///-&&%//r1   c                    V ^8  d   QhRRRR/# )r)   rawrF   r,   Optional[CostDollars]r-   )r.   s   "r/   r0   r0     s     P PD P%: Pr1   c                    V '       g   R# V P                  R4      pVf   R# V P                  R4      pV P                  R4      p\        WVR7      # )zZ
Parse the costDollars JSON into a CostDollars object, or return None if missing/invalid.
Nr   searchr   )r   r  r   )rq   CostDollars)r  r   search_partcontents_parts   &   r/   parse_cost_dollarsr    sK     GGGE} ''(#KGGJ'MUOOr1   c                  N    ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   R	]R&   RtR# )TextContentsOptionsi  a  A class representing the options that you can specify when requesting text

Attributes:
    max_characters (int): The maximum number of characters to return. Default: None (no limit).
    include_html_tags (bool): If true, include HTML tags in the returned text. Default false.
    verbosity (VERBOSITY_OPTIONS): Controls verbosity level of returned content.
        "compact" (default): main content only; "standard": balanced; "full": all sections.
        Requires max_age_hours=0 to take effect.
    include_sections (List[SECTION_TAG]): Only include content from these semantic sections.
        Requires max_age_hours=0 to take effect.
    exclude_sections (List[SECTION_TAG]): Exclude content from these semantic sections.
        Requires max_age_hours=0 to take effect.
intmax_charactersboolinclude_html_tagsVERBOSITY_OPTIONS	verbosityzList[SECTION_TAG]include_sectionsexclude_sectionsr-   Nr   r-   r1   r/   r  r    s'       ''''r1   r  c                      ] tR tRt$ RtR]R&   R]R&   R]R&   R]R&   R	]R
&   R]R&   R]R&   R]R&   R]R&   R	]R&   R	]R&   R]R&   R]R&   R]R&   R ]R&   RtR# )
JSONSchemai  a  Represents a JSON Schema definition used for structured summary output.

.. deprecated:: 1.15.0
    Use Pydantic models or dict[str, Any] directly instead.
    This will be removed in a future version.

To learn more visit https://json-schema.org/overview/what-is-jsonschema.
r+   r3   r:   r   zLLiteral['object', 'array', 'string', 'number', 'boolean', 'null', 'integer']r   zDict[str, JSONSchema]r   z#Union[JSONSchema, List[JSONSchema]]rJ   r   r   r   enumzUnion[bool, JSONSchema]additionalPropertiesdefinitionspatternPropertieszList[JSONSchema]allOfanyOfoneOfr4   r-   Nr   r-   r1   r/   r  r    s`     LJ
VV%%..
J11&&,,
r1   r  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )	SummaryContentsOptionsi  ax  A class representing the options that you can specify when requesting summary

Attributes:
    query (str): The query string for the summary. Summary will bias towards answering the query.
    schema (Union[BaseModel, dict[str, Any]]): JSON schema for structured output from summary.
        Can be a Pydantic model (automatically converted) or a dict containing JSON Schema.
r+   r   r   schemar-   Nr   r-   r1   r/   r   r     s     Jr1   r   c                  D    ] tR tRt$ RtR]R&   R]R&   R]R&   R]R&   R	tR
# )HighlightsContentsOptionsi  a  A class representing the options that you can specify when requesting highlights.

Attributes:
    query (str): The query string for highlight generation. Highlights will be biased towards this query.
    max_characters (int): The maximum number of characters to return for highlights. Default: None (server default).
    num_sentences (int): Deprecated. Use max_characters instead. The number of sentences per highlight.
    highlights_per_url (int): Deprecated. Use max_characters instead. The number of highlights to return per URL.
r+   r   r  r  num_sentenceshighlights_per_urlr-   Nr   r-   r1   r/   r#  r#    s      Jr1   r#  c                  &    ] tR tRt$ RtR]R&   RtR# )ContextContentsOptionsi  aA  Options for retrieving aggregated context from a set of search results.

.. deprecated::
    Use ``highlights`` or ``text`` instead. The ``context`` option is deprecated
    and will be removed in a future version.

Attributes:
    max_characters (int): The maximum number of characters to include in the context string.
r  r  r-   Nr   r-   r1   r/   r'  r'    s     r1   r'  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )ExtrasOptionsi  zFA class representing additional extraction fields (e.g. links, images)r  linksimage_linksr-   Nr   r-   r1   r/   r)  r)    s    PJr1   r)  c                      ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   RtR# )ContentsOptionsi"  aW  Options for retrieving page contents in search and find_similar methods.

All fields are optional. If no content options are specified, text with
max_characters=10000 is returned by default.

Attributes:
    text (TextContentsOptions | True): Options for text extraction, or True for defaults.
    highlights (HighlightsContentsOptions | True): Options for highlight extraction, or True for defaults.
    summary (SummaryContentsOptions | True): Options for summary generation, or True for defaults.
    context (ContextContentsOptions | True): Deprecated. Use ``highlights`` or ``text`` instead. Will be removed in a future version.
    max_age_hours (int): Maximum age of cached content in hours. If content is older, it will be
        fetched fresh. Special values: 0 = always fetch fresh content,
        -1 = never fetch fresh (use cached content only). Example: 168 = fetch fresh for pages older than 7 days.
    subpages (int): Number of subpages to crawl.
    subpage_target (str | List[str]): Target subpage path(s) to crawl.
    extras (ExtrasOptions): Additional extraction options (links, images).
)Union[TextContentsOptions, Literal[True]]r   z/Union[HighlightsContentsOptions, Literal[True]]r   ,Union[SummaryContentsOptions, Literal[True]]r   z,Union[ContextContentsOptions, Literal[True]]r   LIVECRAWL_OPTIONSr   r  r   r   r   zUnion[str, List[str]]r   r)  r   r-   Nr   r-   r1   r/   r-  r-  "  sD    $ 43??9999  M))r1   r-  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )CostDollarsSearchiA  z)Represents the cost breakdown for search.floatneuralkeywordr-   Nr   r-   r1   r/   r2  r2  A  s    3MNr1   r2  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )CostDollarsContentsiH  z+Represents the cost breakdown for contents.r3  r   r   r-   Nr   r-   r1   r/   r7  r7  H  s    5
KNr1   r7  c                  B    ] tR tRt$ RtR]R&   RtR]R&   RtR]R	&   R
tR# )r  iO  z1Represents costDollars field in the API response.r3  r   Nr2  r  r7  r   r-   )	r   r   r   r   r   r   r  r   r   r-   r1   r/   r  r  O  s     ;L $F$$(H!(r1   r  c                  *    ] tR tRt$ RtRtR]R&   RtR# )r_   i\  zCompany workforce information.NOptional[int]r   r-   )r   r   r   r   r   r   r   r   r-   r1   r/   r_   r_   \  s    (E=r1   r_   c                  T    ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R]R&   R	t
R# )
r`   ic  z!Company headquarters information.NOptional[str]r   r   r   r   r-   )r   r   r   r   r   r   r   r   r   r   r   r-   r1   r/   r`   r`   c  s-    +!G]!D-!%K%!G]!r1   r`   c                  F    ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R# )
rb   im  zFunding round information.Nr<  rx   r   r:  r   r-   )
r   r   r   r   r   rx   r   r   r   r   r-   r1   r/   rb   rb   m  s#    $D-D- FM r1   rb   c                  F    ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R# )
ra   iv  zCompany financial information.Nr:  r   r   r   r   r-   )
r   r   r   r   r   r   r   r   r   r   r-   r1   r/   ra   ra   v  s%    ($(NM(#'M='JNGNr1   ra   c                  *    ] tR tRt$ RtRtR]R&   RtR# )rc   i  z Company web traffic information.Nr:  r   r-   )r   r   r   r   r   r   r   r   r-   r1   r/   rc   rc     s    *$(NM(r1   rc   c                  ~    ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R	]R
&   Rt
R]R&   RtR]R&   RtR]R&   RtR# )r]   i  z+Structured properties for a company entity.Nr<  rx   r:  r   r   z*Optional[EntityCompanyPropertiesWorkforce]r   z-Optional[EntityCompanyPropertiesHeadquarters]r   r   r   r   r   r-   )r   r   r   r   r   rx   r   r   r   r   r   r   r   r   r-   r1   r/   r]   r]     sO    5D-"&L-&!%K%<@I9@BFL?F>BJ;B?CK<Cr1   r]   c                  8    ] tR tRt$ RtRtR]R&   RtR]R&   RtR# )rd   i  z$Date range for work history entries.Nr<  rn   ro   r-   )	r   r   r   r   r   rn   r   ro   r   r-   r1   r/   rd   rd     s    .#I}#!G]!r1   rd   c                  8    ] tR tRt$ RtRtR]R&   RtR]R&   RtR# )re   i  z'Reference to a company in work history.Nr<  rw   rx   r-   )	r   r   r   r   r   rw   r   rx   r   r-   r1   r/   re   re     s    1BD-r1   re   c                  T    ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R	]R
&   Rt
R# )rf   i  z)A single work history entry for a person.Nr<  r:   r}   ri   r~   ru   r   r-   )r   r   r   r   r   r:   r   r}   r~   r   r   r-   r1   r/   rf   rf     s/    3E="Hm"'+E$+:>G7>r1   rf   c                  F    ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R# )
r^   i  z*Structured properties for a person entity.Nr<  rx   r}   z6Optional[List[EntityPersonPropertiesWorkHistoryEntry]]r   r-   )
r   r   r   r   r   rx   r   r}   r   r   r-   r1   r/   r^   r^     s$    4D-"Hm"KOLHOr1   r^   c                  D    ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   RtR# )r[   i  z%Structured entity data for a company.r+   rw   zLiteral['company']r   r  r   r]   r   r-   Nr   r-   r1   r/   r[   r[     s    /G
L''r1   r[   c                  D    ] tR tRt$ RtR]R&   R]R&   R]R&   R	]R
&   RtR# )r\   i  z$Structured entity data for a person.r+   rw   zLiteral['person']r   r  r   r^   r   r-   Nr   r-   r1   r/   r\   r\     s    .G
L&&r1   r\   c                      ] tR tRt$ RtR]R&   R]R&   RtR]R&   RtR	]R
&   RtR]R&   Rt	R]R&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RR ltR tRtR# )_Resulti  aD  A class representing the base fields of a search result.

Attributes:
    title (str): The title of the search result.
    url (str): The URL of the search result.
    id (str): The temporary ID for the document.
    score (float, optional): A number from 0 to 1 representing similarity.
    published_date (str, optional): An estimate of the creation date, from parsing HTML content.
    author (str, optional): The author of the content (if available).
    image (str, optional): A URL to an image associated with the content (if available).
    favicon (str, optional): A URL to the favicon (if available).
    subpages (List[_Result], optional): Subpages of main page
    extras (Dict, optional): Additional metadata; e.g. links, images.
    entities (List[Entity], optional): Structured entity data for company or person searches.
r+   r   rw   Nr<  r:   Optional[float]scorepublished_dateauthorimagefaviconzOptional[List[_Result]]r   zOptional[Dict]r   zOptional[List[Entity]]r   c                	    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn        Wn	        Wn
        R # r9   )r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   )selfr   rw   r:   rJ  rK  rL  rM  rN  r   r   r   s   &&&&&&&&&&&&r/   __init___Result.__init__  s<     

,
  r1   c                	   R V P                    RV P                   RV P                   RV P                   RV P                   RV P
                   RV P                   RV P                   RV P                   R	V P                   R
2pV P                  '       d0   R
P                  R V P                   4       4      pVRV R
2,          pV# )Title: 
URL: 
ID: z
Score: 
Published Date: 	
Author: z
Image: z

Favicon: z	
Extras: z
Subpages: 
c              3     "   T F5  pR VP                    RVP                  P                  ;'       g    R 2x  K7  	  R# 5i)z  - [z] UnknownN)r   r   rx   )r;   es   & r/   r=   "_Result.__str__.<locals>.<genexpr>  s;      %&A xr!,,"3"3"@"@y!AB&s   /??z
Entities:
)r:   r   rw   rJ  rK  rL  rM  rN  r   r   r   rA   )rP  resultentities_strs   &  r/   __str___Result.__str__  s    djj\ "HH: 77) jj\ "#223 4{{m $jj\ "~ &{{m $r	+ 	 ===99 %% L L>44Fr1   )rL  r   r   rN  rw   rM  rK  rJ  r   r:   r   )	NNNNNNNNN)r   r   r   r   r   r   r:   rJ  rK  rL  rM  rN  r   r   r   rQ  r`  r   r-   r1   r/   rH  rH    sy      
HGE=!E?!$(NM( FM E=!G]!(,H%,!FN!'+H$+!4r1   rH  c                  v   a  ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R	]R
&   RV 3R llt
V 3R ltRtV ;t# )Resulti  ae  
A class representing a search result with optional text, summary, and highlights.

Attributes:
    text (str, optional): The text content of the page.
    summary (str, optional): A summary of the page content.
    highlights (List[str], optional): Relevant sentences from the page.
    highlight_scores (List[float], optional): Scores for each highlight.
Nr<  r   r   Optional[List[str]]r   zOptional[List[float]]highlight_scoresc                	j   < \         SV `  VVVVVVVVV	V
V4       Wn        Wn        Wn        Wn        R # r9   )superrQ  r   r   r   re  )rP  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   r   r   re  	__class__s   &&&&&&&&&&&&&&&&r/   rQ  Result.__init__,  sJ    $ 		
 	$ 0r1   c                	  < \         SV `  4       pVR V P                   RV P                   R2,           pV P                  '       d   VRV P                   R2,          pV P
                  '       d   VRV P
                   R2,          pV# )Text: z

Summary: rY  zHighlights: zHighlight Scores: )rg  r`  r   r   r   re  )rP  base_strr^  rh  s   &  r/   r`  Result.__str__P  s}    7?$fTYYK{4<<.KK???T__$5R88F   *4+@+@*ADDFr1   )re  r   r   r   )NNNNNNNNNNNNN)r   r   r   r   r   r   r   r   r   re  rQ  r`  r   __classcell__rh  s   @r/   rc  rc    sE     D-!G]!&*J#*.2+2"1H r1   rc  c                  n   a  ] tR tRt$ Rt]P                  ! ]R7      tR]	R&   R	V 3R llt
V 3R ltRtV ;t# )
ResultWithTextiZ  zz
A class representing a search result with text present.

Attributes:
    text (str): The text of the search result page.
default_factoryr+   r   c                	F   < \         SV `  VVVVVVVVV	V
V4       Wn        R # r9   )rg  rQ  r   )rP  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   rh  s   &&&&&&&&&&&&&r/   rQ  ResultWithText.__init__e  s:     		
 	r1   c                	N   < \         SV `  4       pVR V P                   R2,           # )rk  rY  )rg  r`  r   rP  rl  rh  s   & r/   r`  ResultWithText.__str__  s'    7?$F499+R000r1   )r   
NNNNNNNNNr7   )r   r   r   r   r   dataclassesfieldr+   r   r   rQ  r`  r   rn  ro  s   @r/   rq  rq  Z  s.     !!#6D#6<1 1r1   rq  c                  n   a  ] tR tRt$ Rt]P                  ! ]R7      tR]	R&   R	V 3R llt
V 3R ltRtV ;t# )
ResultWithSummaryi  z[
A class representing a search result with summary present.

Attributes:
    summary (str)
rr  r+   r   c                	F   < \         SV `  VVVVVVVVV	V
V4       Wn        R # r9   )rg  rQ  r   )rP  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   rh  s   &&&&&&&&&&&&&r/   rQ  ResultWithSummary.__init__  s:     		
 r1   c                	N   < \         SV `  4       pVR V P                   R2,           # )	Summary: rY  )rg  r`  r   rw  s   & r/   r`  ResultWithSummary.__str__  s'    7?$Idll^2666r1   )r   ry  )r   r   r   r   r   rz  r{  r+   r   r   rQ  r`  r   rn  ro  s   @r/   r}  r}    s.     $$S9GS9<7 7r1   r}  c                     a  ] tR tRt$ Rt]P                  ! ]R7      tR]	R&   ]P                  ! ]R7      t
R]	R&   R
V 3R lltV 3R ltR	tV ;t# )ResultWithTextAndSummaryi  zs
A class representing a search result with text and summary present.

Attributes:
    text (str)
    summary (str)
rr  r+   r   r   c                	R   < \         SV `  VVVVVVVVV	V
V4       Wn        Wn        R # r9   )rg  rQ  r   r   )rP  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   r   rh  s   &&&&&&&&&&&&&&r/   rQ  !ResultWithTextAndSummary.__init__  s?      		
 	r1   c                	x   < \         SV `  4       pVR V P                   R2,           RV P                   R2,           # )rk  rY  r  )rg  r`  r   r   rw  s   & r/   r`   ResultWithTextAndSummary.__str__  s9    7?$F499+R00Yt||nB3OOOr1   )r   r   )NNNNNNNNNr7   r7   )r   r   r   r   r   rz  r{  r+   r   r   r   rQ  r`  r   rn  ro  s   @r/   r  r    sF     !!#6D#6$$S9GS9@P Pr1   r  c                  x    ] tR tRt$ RtR]R&   R]R&   RtR]R&   RtR]R	&   RtR]R
&   Rt	R]R&   RR lt
R tRtR# )AnswerResulti  a  A class representing a result for an answer.

Attributes:
    title (str): The title of the search result.
    url (str): The URL of the search result.
    id (str): The temporary ID for the document.
    published_date (str, optional): An estimate of the creation date, from parsing HTML content.
    author (str, optional): If available, the author of the content.
    text (str, optional): The full page text from each search result.
r+   rw   r   Nr<  r:   rK  rL  r   c                	N    Wn         W n        W0n        W@n        WPn        W`n        R # r9   rw   r   r:   rK  rL  r   )rP  rw   r   r:   rK  rL  r   s   &&&&&&&r/   rQ  AnswerResult.__init__  s#     
,	r1   c                	    R V P                    RV P                   RV P                   RV P                   RV P                   RV P
                   R2# )rT  rU  rV  rW  rX  
Text: 

)r:   r   rw   rK  rL  r   rP  s   &r/   r`  AnswerResult.__str__  sb    djj\ "HH: 77) #223 4{{m $YYKt%	
r1   )rL  rw   rK  r   r:   r   )NNNN)r   r   r   r   r   r   r:   rK  rL  r   rQ  r`  r   r-   r1   r/   r  r    sE    	 	G	HE=$(NM( FM D-
r1   r  c                  P    ] tR tRt$ RtRtR]R&   RtR]R&   R R	 ltR
 R lt	Rt
R# )StreamChunki  zA class representing a single chunk of streaming data.

Attributes:
    content (Optional[str]): The partial text content of the streamed response.
    citations (Optional[List[AnswerResult]]): List of citations if provided in this chunk.
Nr<  contentzOptional[List[AnswerResult]]	citationsc                   V ^8  d   QhRR/# )r)   r,   r  r-   )r.   s   "r/   r0   StreamChunk.__annotate__  s     F F$ Fr1   c                J    V P                   RJ;'       g    V P                  RJ# )z&Check if this chunk contains any data.Nr  r  r  s   &r/   has_dataStreamChunk.has_data  s"    ||4'EE4>>+EEr1   c                   V ^8  d   QhRR/# )r)   r,   r+   r-   )r.   s   "r/   r0   r  !  s     	 	 	r1   c                    RpV P                   '       d   WP                   ,          pV P                  '       d)   VR,          pV P                   F  pVRV 2,          pK  	  V# )z"Format the chunk data as a string.r7   z
Citations:rY  r  rP  outputsources   &  r/   r`  StreamChunk.__str__!  sR    <<<ll"F>>>n$F..Bvh-' )r1   r-   )r   r   r   r   r   r  r   r  r  r`  r   r-   r1   r/   r  r    s.     "G]!.2I+2F	 	r1   r  c                  D    ] tR tRt$ RtR]R&   R]R&   RtR]R	&   R
 tRtR# )AnswerResponsei-  a  A class representing the response for an answer operation.

Attributes:
    answer (str): The generated answer.
    citations (List[AnswerResult]): A list of citations used to generate the answer.
    cost_dollars (CostDollars, optional): The cost breakdown for this request.
Union[str, dict[str, Any]]answerzList[AnswerResult]r  Nr  cost_dollarsc                	f   R V P                    R2pV P                   F  pVRVP                   2,          pVRVP                   2,          pVRVP                   2,          pVRVP
                   2,          pVRVP                   2,          pVRVP                   2,          pVR,          pK  	  V# )	zAnswer: z

Citations:z
Title: rV  rU  rW  rX  r  rY  )r  r  r:   rw   r   rK  rL  r   r  s   &  r/   r`  AnswerResponse.__str__;  s    DKK=7nnF	&,,00Fvyyk**F

|,,F*6+@+@*ABBF
6==/22F..FdNF % r1   r-   )	r   r   r   r   r   r   r  r`  r   r-   r1   r/   r  r  -  s%     '&!!*.L'.
r1   r  c                  D    ] tR tRtRtR R ltR tR R ltR R	 ltR
t	R# )StreamAnswerResponseiH  1A class representing a streaming answer response.c                   V ^8  d   QhRR/# )r)   raw_responsezrequests.Responser-   )r.   s   "r/   r0   !StreamAnswerResponse.__annotate__K  s     ! !%6 !r1   c                	2    Wn         V P                  4        R # r9   _raw_response_ensure_ok_statusrP  r  s   &&r/   rQ  StreamAnswerResponse.__init__K      ) r1   c                	    V P                   P                  ^8w  d:   \        RV P                   P                   RV P                   P                   24      hR#     Request failed with status code : Nr  status_coder   r   r  s   &r/   r  &StreamAnswerResponse._ensure_ok_statusO  T    ))S0243E3E3Q3Q2RRTUYUgUgUlUlTmn  1r1   c                   V ^8  d   QhRR/# )r)   r,   zIterator[StreamChunk]r-   )r.   s   "r/   r0   r  U  s     &# &#/ &#r1   c              #  	  "   V P                   P                  4        EF~  pV'       g   K  VP                  R 4      P                  R4      p \        P
                  ! V4      pRpRpRT9   dK   TR,          '       d<   RTR,          ^ ,          9   d'   TR,          ^ ,          R,          P                  R4      pRT9   d   TR,          '       d   TR,          R8w  d   . pTR,           F  p\        T4      pTP                  \        TP                  R4      TP                  R	4      TP                  R
4      TP                  R4      TP                  R4      TP                  R4      R7      4       K  	  \        YER7      pTP                  4       '       g   EKz  Tx  EK  	  R#   \        P                   d     EK  i ; i5i)zutf-8data: Nchoicesdeltar  r  nullrw   r   r:   rK  rL  r   r  r  )r  
iter_linesdecoderemoveprefixjsonloadsJSONDecodeErrorrq   rW   r   r  r  r  )	rP  linedecoded_linechunkr  r  ssnake_sstream_chunks	   &        r/   __iter__StreamAnswerResponse.__iter__U  s|    &&113D;;w/<<XFL

<0 GIE!eI&6&6eI.q11#I.q1':>>yIG u$+&&+&&0	{++A+A.G$$$&{{40 'E 2")++g"6+2;;7G+H#*;;x#8!(V!4	 , 'wLL$$&&""K 4 '' s>   A	F?F""F?<AF?CF?F?"F<7F?;F<<F?c                   V ^8  d   QhRR/# r)   r,   r   r-   )r.   s   "r/   r0   r  }       # #t #r1   c                :    V P                   P                  4        R# z@Close the underlying raw response to release the network socket.Nr  closer  s   &r/   r  StreamAnswerResponse.close}        "r1   r  N)
r   r   r   r   r   rQ  r  r  r  r   r-   r1   r/   r  r  H  s    ;!&#P# #r1   r  c                  >    ] tR tRtRtR R ltR tR tR R ltR	t	R
# )AsyncStreamAnswerResponsei  r  c                   V ^8  d   QhRR/# )r)   r  zhttpx.Responser-   )r.   s   "r/   r0   &AsyncStreamAnswerResponse.__annotate__  s     ! !^ !r1   c                	2    Wn         V P                  4        R # r9   r  r  s   &&r/   rQ  "AsyncStreamAnswerResponse.__init__  r  r1   c                	    V P                   P                  ^8w  d:   \        RV P                   P                   RV P                   P                   24      hR# r  r  r  s   &r/   r  +AsyncStreamAnswerResponse._ensure_ok_status  r  r1   c                	   a  V 3R  lpV! 4       # )c                z  <"   SP                   P                  4         R j  xL
  p V '       g   K  V P                  R4      p \        P                  ! V4      pR pR pRT9   dK   TR,          '       d<   RTR,          ^ ,          9   d'   TR,          ^ ,          R,          P                  R4      pRT9   d   TR,          '       d   TR,          R8w  d   . pTR,           F  p\        T4      pTP                  \        TP                  R4      TP                  R4      TP                  R	4      TP                  R
4      TP                  R4      TP                  R4      R7      4       K  	  \        Y4R7      pTP                  4       '       g   EKq  T5x  EKy   ELu  \        P
                   d     EK  i ; iEDR # 5i)Nr  r  r  r  r  r  rw   r   r:   rK  rL  r   r  r  )r  aiter_linesr  r  r  r  rq   rW   r   r  r  r  )	r  r  r  r  r  r  r  r  rP  s	           r/   	generator6AsyncStreamAnswerResponse.__aiter__.<locals>.generator  s    "00<<> %' %'d#00: JJ|4E  	%%	*:*:%	"21"55"'	"21"5g">"B"B9"M  5(k**k*f4 "I";//"/"2!(((#*;;t#4$+KK$6&-kk'&:/6{{;K/L'.{{8'<%,[[%8	 0  +7P((**&&K%' ++  ?sW   F;F7FF7F;FF;4AF;CF;F;F7F4/F;3F44F;r-   )rP  r  s   f r/   	__aiter__#AsyncStreamAnswerResponse.__aiter__  s    &	'P {r1   c                   V ^8  d   QhRR/# r  r-   )r.   s   "r/   r0   r    r  r1   c                :    V P                   P                  4        R# r  r  r  s   &r/   r  AsyncStreamAnswerResponse.close  r  r1   r  N)
r   r   r   r   r   rQ  r  r  r  r   r-   r1   r/   r  r    s    ;!)V# #r1   r  c                      ] tR tRtRtRtR# )StreamSearchResponsei  1A class representing a streaming search response.r-   Nr   r   r   r   r   r   r-   r1   r/   r  r        ;r1   r  c                      ] tR tRtRtRtR# )AsyncStreamSearchResponsei  r  r-   Nr  r-   r1   r/   r  r    r  r1   r  Tc                  :    ] tR tRt$ RtR]R&   R]R&   R]R&   RtR# )	ContentStatusi  zAA class representing the status of a content retrieval operation.r+   rw   statusr  r-   Nr   r-   r1   r/   r  r    s    KGKKr1   r  c                      ] tR tRt$ RtR]R&   R]R&   R]R&   RtR]R	&   RtR
]R&   RtR]R&   Rt	R]R&   Rt
R]R&   R tRtR# )SearchResponsei  a  A class representing the response for a search operation.

Attributes:
    results (List[Result]): A list of search results.
    resolved_search_type (str, optional): 'neural' or 'keyword' if auto.
    auto_date (str, optional): A date for filtering if autoprompt found one.
    context (str, optional): Deprecated. Combined context string when requested via contents.context. Use highlights or text instead.
    output (DeepSearchOutput, optional): Search synthesized output object returned
        when output_schema is provided, containing content and field-level
        grounding.
    statuses (List[ContentStatus], optional): Status list from get_contents.
    cost_dollars (CostDollars, optional): Cost breakdown.
    search_time (float, optional): Time taken for the search in milliseconds.
zList[T]resultsr<  resolved_search_type	auto_dateNr   zOptional['DeepSearchOutput']r  zOptional[List[ContentStatus]]statusesr  r  rI  search_timec                	    R P                  R V P                   4       4      pV P                  '       d   VRV P                   2,          pV P                  e   VRV P                   2,          pV P                  '       d   VRV P                   2,          pV P
                  e   VRV P
                   R2,          pV P                  '       d   VRV P                  P                   2,          pV P                  P                  '       d!   VRV P                  P                   2,          pV P                  P                  '       d!   VR	V P                  P                   2,          pV P                  '       d   VR
V P                   2,          pV# )r  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir9   )r+   )r;   r^  s   & r/   r=   )SearchResponse.__str__.<locals>.<genexpr>  s     D|VS[[|s   z

Context: z	
Output: z
Resolved Search Type: z
Search Time: msz
CostDollars: total=z
  - search: z
  - contents: z
Statuses: )rA   r  r   r  r  r  r  r   r  r   r   )rP  r  s   & r/   r`  SearchResponse.__str__  sQ   Dt||DD<<<DLL>22F;;"
4;;-00F$$$01J1J0KLLF'(8(8'9<<F-d.?.?.E.E-FGGF  '''N4+<+<+C+C*DEE  ))),T->->-G-G,HII===T]]O44Fr1   r-   )r   r   r   r   r   r   r   r  r   r  r  r`  r   r-   r1   r/   r  r    sU     ''!G]!+/F(/.2H+2*.L'.#'K'r1   r  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )!DeepSearchOutputGroundingCitationi  z0Citation metadata for one grounded output field.r+   r   r:   r-   Nr   r-   r1   r/   r  r    s    :	HJr1   r  c                  :    ] tR tRt$ RtR]R&   R]R&   R]R&   R	tR
# )DeepSearchOutputGroundingi  z>Grounding metadata for one field in search synthesized output.r+   r{  z'List[DeepSearchOutputGroundingCitation]r  #DeepSearchOutputGroundingConfidence
confidencer-   Nr   r-   r1   r/   r
  r
    s    HJ6633r1   r
  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )	DeepSearchOutputi  z"Search synthesized output payload.r  r  zList[DeepSearchOutputGrounding]	groundingr-   Nr   r-   r1   r/   r  r    s    ,''..r1   r  c                    V ^8  d   QhRRRR/# )r)   r  r   r,   zOptional[DeepSearchOutput]r-   )r.   s   "r/   r0   r0     s     =B =B# =B*D =Br1   c                   \        V \        4      '       g   R# V P                  R4      p\        V\        4      '       d   TpM\        V\        4      '       d   TpMRp. pV P                  R4      p\        V\        4      '       Ed<   V EF4  p\        V\        4      '       g   K  VP                  R4      p\        V\        4      '       g   KE  . pVP                  R4      p\        V\        4      '       d   V F  p	\        V	\        4      '       g   K  V	P                  R4      p
V	P                  R4      p\        V
\        4      '       g   KU  TP                  \        T
\        V\        4      '       d   TMRR	7      4       K  	  VP                  R
4      pVR9  d   RpVP                  \        VVVR7      4       EK7  	  \        W#R7      # )zParse search output into a typed object.

Args:
    raw: Raw `output` field from API response.

Returns:
    Parsed DeepSearchOutput when the payload is an object, otherwise None.
Nr  r7   r  r{  r  r   r:   )r   r:   r  medium)r{  r  r  )r  r  lowr  high)	rI   rF   rq   r+   listr   r  r
  r  )r  raw_contentr  r  raw_groundinggrounding_rowr{  r  raw_citationscitationr   r:   r  s   &            r/   parse_deep_search_outputr    s    c4  '')$K+s##.9	K	&	&13IGGK(M-&&*MmT22!%%g.EeS))ACI)--k:M-.. -H%h55 ",,u-C$LL1E%c3// $$9 #+5eS+A+A%r !. '**<8J!::%
)'); +J GAAr1   c               $    V ^8  d   QhRRRRRR/# )r)   original_dictr   fields_to_nestr   new_keyr+   r-   )r.   s   "r/   r0   r0   _  s!      t Y  r1   c                Z    / pV F  pW@9   g   K  V P                  V4      W4&   K   	  W0V&   V # r9   )pop)r  r  r   nested_dictr{  s   &&&  r/   nest_fieldsr$  _  s<    K  !!.!2!25!9K	   )'r1   c            '         ] tR tRtRtROR R lltRPR R lltRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR/R R lltR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR/R R lltR  R! lt	]
RQR" R# ll4       t]
R$RR%RR&RR'RR(RR)RR*RRR/R+ R, ll4       t]
R$RR%RR&RR'RR(RR)RR*RRR/R- R. ll4       t]
R$RR%RR&RR'RR(RR)RR*RRR/R/ R0 ll4       tR1 R2 ltR
RRRRRRRRRRRRRRRRRRRR3RRRRR/R4 R5 llt]
RRRRRRRRRRRRRRRRRRR3RRRRRR$RR%RR&RR'RR(RR)RR*R/R6 R7 ll4       t]
RRRRRRRRRRRRRRRRRRR3RRRRRR$RR%RR&RR'RR(RR)RR*R/R8 R9 ll4       t]
RRRRRRRRRRRRRRRRRRR3RRRRRR$RR%RR&RR'RR(RR)RR*R/R: R; ll4       t]
RRRRRRRRRRRRRRRRRRR3RRRRRR$RR%RR&RR'RR(RR)RR*R/R< R= ll4       t]
RRRRRRRRRRRRRRRRRRR3RRRRRR$RR%RR&RR'RR(RR)RR*R/R> R? ll4       tR@ RA ltRB RC ltRD RE lt]
RR	RFR	RRRGRRRRR/RH RI ll4       tRR	RFR	RRRGRRRRR/RJ RK lltRFR	RRRGRRRRR/RL RM lltRNtR# )RExaip  z&A client for interacting with Exa API.Nc               $    V ^8  d   QhRRRRRR/# )r)   api_keyr<  base_urlr+   
user_agentr-   )r.   s   "r/   r0   Exa.__annotate__s  s(     $3 $3$3 $3 "	$3r1   c                   Vf/   ^ RI pVP                  P                  R4      pVf   \        R4      hVf   R\	        4        2pW n        RVRVRR/V n        \        V 4      V n        \        V 4      V n
        \        V 4      V n        R# )	aV  Initialize the Exa client with the provided API key and optional base URL and user agent.

Args:
    api_key (str): The API key for authenticating with the Exa API.
    base_url (str, optional): The base URL for the Exa API. Defaults to "https://api.exa.ai".
    user_agent (str, optional): Custom user agent. Defaults to "exa-py {version}".
NEXA_API_KEYzNAPI key must be provided as an argument or in EXA_API_KEY environment variablezexa-py/z	x-api-keyz
User-AgentzContent-Typezapplication/json)osenvironrq   r   r   r)  headersr    websetsr$   researchr"   monitors)rP  r(  r)  r*  r.  s   &&&& r/   rQ  Exa.__init__s  s     ?jjnn]3G d 
 "#7#9":;J *.

 %T*&t,,T2r1   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r)   endpointr+   rE   z$Optional[Union[Dict[str, Any], str]]methodparamszOptional[Dict[str, Any]]r0  Optional[Dict[str, str]]r,   z(Union[Dict[str, Any], requests.Response]r-   )r.   s   "r/   r0   r+    sN     Q QQ 3Q 	Q
 )Q *Q 
2Qr1   c                   \        V\        4      '       d   TpM&V'       d   \        P                  ! V\        R7      MRpT;'       d2    \        V\
        4      ;'       d    VP                  R4      ;'       g    T;'       d    VP                  R4      R8H  p/ V P                  CpV'       d   VP                  V4       VP                  4       R8X  da   V'       d.   \        P                  ! V P                  V,           VVRR7      p	V	# \        P                  ! V P                  V,           WR7      p	EM VP                  4       R	8X  d`   V'       d.   \        P                  ! V P                  V,           VVRR
7      p	V	# \        P                  ! V P                  V,           WhR7      p	MVP                  4       R8X  d+   \        P                  ! V P                  V,           WhR7      p	MMVP                  4       R8X  d+   \        P                  ! V P                  V,           VR7      p	M\        RV 24      hV	P                   R8  d&   \        RV	P                    RV	P"                   24      hV	P                  4       # )a  Send a request to the Exa API, optionally streaming if data['stream'] is True.

Args:
    endpoint (str): The API endpoint (path).
    data (dict, optional): The JSON payload to send. Defaults to None.
    method (str, optional): The HTTP method to use. Defaults to "POST".
    params (Dict[str, Any], optional): Query parameters to include. Defaults to None.
    headers (Dict[str, str], optional): Additional headers to include in the request. Defaults to None.

Returns:
    Union[dict, requests.Response]: If streaming, returns the Response object.
    Otherwise, returns the JSON-decoded response as a dict.

Raises:
    ValueError: If the request fails (non-200 status code).
)clsNr   trueGETT)r0  r8  r   )r0  r8  POST)rE   r0  r   )rE   r0  PATCHDELETEr0  Unsupported HTTP method: i  r  r  )rI   r+   r  dumpsr!   rF   rq   r0  updateupperrequestsr)  postpatchdeleter   r  r   )
rP  r6  rE   r7  r8  r0  	json_dataneeds_streamingrequest_headersress
   &&&&&&    r/   requestExa.request  s   2 dC  I AE

4^<$I  QQJtT$:QQtxx?Q 
 
55vzz(+v5 	
 +T\\*""7+<<>U"llMMH,+!	 
llMMH,o \\^v%mmMMH,"+	 
mmMMH,9 \\^w&..(yC \\^x'//$--(":OTC8ABB??c!23??2C2chhZP  xxzr1   r   Fr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c          *     l    V ^8  d   QhRRRRRRRRR	R
RR
RRRRRRRRRR
RR
RRRRRR
RRRRRR
RRRRRR/#  r)   r   r+   r   Optional[bool]r   0Optional[Union[ContentsOptions, Literal[False]]]r   r:  r   rd  r   r   r<  r   r   r   r   r   r    Optional[Union[SearchType, str]]r   Optional[Category]r   r   r   r   r   r   Optional[DeepOutputSchema]r,   SearchResponse[Result]r-   )r.   s   "r/   r0   r+    s     M
 M
M
 	M

 CM
 #M
 -M
 -M
 (M
 &M
 ,M
 *M
 *M
 *M
 /M
  %!M
" ##M
$ #%M
& %'M
( 0)M
* %+M
, 2-M
. 
 /M
r1   c                  V'       d   \        R4      h\        4       P                  4        UUu/ uF  w  ppVR8w  g   K  Vf   K  VVbK  	  pppVP                  RR4       VRJ d   VP                  RR4       M"Vf   RV9  d   RR\        //VR&   M	Ve   VVR&   \        V\        4       \        VR	.R
7      pV P                  RV4      p\        VP                  R4      4      p. pVR,           EF"  p\        V4      pVP                  \        VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \        VP                  R4      4      R7      4       EK%  	  \        TRV9   d
   VR,          MRRV9   d
   VR,          MRVP                  R4      \!        VP                  R 4      4      VVP                  R!4      R"7      # u uppi )#a]  Perform a search.

By default, returns text contents with 10,000 max characters. Use contents=False to opt-out.

Args:
    query (str): The query string.
    stream (bool, optional): If True, stream the synthesized search response.
        Use ``stream_search(...)`` instead of ``search(..., stream=True)``.
    contents (ContentsOptions | False, optional): Options for retrieving page contents.
        Defaults to {"text": {"maxCharacters": 10000}}. Use False to disable contents.
        See ContentsOptions for available options (text, highlights, summary, etc.).
        Note: The ``context`` option is deprecated; use ``highlights`` or ``text`` instead.
    num_results (int, optional): Number of search results to return. Default 10.
    include_domains (List[str], optional): Domains to include in the search.
    exclude_domains (List[str], optional): Domains to exclude from the search.
    start_crawl_date (str, optional): Only links crawled after this date.
    end_crawl_date (str, optional): Only links crawled before this date.
    start_published_date (str, optional): Only links published after this date.
    end_published_date (str, optional): Only links published before this date.
    include_text (List[str], optional): Strings that must appear in the page text.
    exclude_text (List[str], optional): Strings that must not appear in the page text.
    type (SearchType, optional): Search type - 'auto' (default), 'fast',
        'deep-lite', 'deep', 'deep-reasoning', 'neural', or 'instant'.
    category (Category, optional): Data category to focus on (e.g. 'company', 'news', 'research paper').
    flags (List[str], optional): Experimental flags for Exa usage.
    moderation (bool, optional): If True, the search results will be moderated for safety.
    user_location (str, optional): Two-letter ISO country code of the user (e.g. US).
    additional_queries (List[str], optional): Alternative query formulations for deep search to skip
        automatic LLM-based query expansion. Max 5 queries. Only applicable when type is
        'deep-lite', 'deep', or 'deep-reasoning'.
        Example: ["machine learning", "ML algorithms", "neural networks"]
    system_prompt (str, optional): Instructions that guide both the search process and
        the final returned result. Use this to prefer certain sources, emphasize novelty,
        avoid duplicates, or constrain the response style. Supported for all search types.
    output_schema (DeepOutputSchema, optional): Search output schema for structured
        synthesis. When provided, the API returns synthesized output in ``output``.
        Use ``{"type": "text", "description": ...}`` for plain text output or
        ``{"type": "object", "properties": ..., "required": ...}`` for structured JSON.
        For object schemas, max nesting depth is 2 and max total properties is 10.
        Supported for all search types.

Returns:
    SearchResponse: The response containing search results, etc.

Raises:
    ValueError: If stream=True is provided. Use stream_search() instead.

Examples:
    # Basic search
    result = exa.search(
      "hottest AI startups",
      num_results=2,
      contents={"highlights": True}
    )

    # Deep search with query variations
    deep_result = exa.search(
      "blog post about AI",
      type="deep",
      additional_queries=["AI blogpost", "machine learning blogs"],
      num_results=5
    )
Zstream=True is not supported in `search()`. Please use `stream_search(...)` for streaming.rP  Nr   Fr   r   r  r   rG   /searchcostDollarsr  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   re  r   r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   r   re  r   resolvedSearchTypeautoDater   r  
searchTimer   r  r  r  )r   localsrJ   r"  DEFAULT_MAX_CHARACTERSr   SEARCH_OPTIONS_TYPESrK   rN  r  rq   rW   r   rc  r   r  r  rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rL   rM   r   rE   r  r  r^  snake_results   &&$$$$$$$$$$$$$$$$$$$        r/   r  
Exa.search  sX   n A 
 %+HNN$4V$4DAqV441a4$4VHd# uKK
D)*G";#),<>T+U"VGJ!"*GJ)=>O3DE||Iw/)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* *>$*FD%&D *d 2DHHY'+DHHX,>?%.
 	
Q Ws   J JJc          (     h    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRR/# )r)   r   r+   r   rS  r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rT  r   rU  r   r   rR  r   r   r   r   rV  r,   r  r-   )r.   s   "r/   r0   r+  {  s     K2 K2K2 C	K2
 #K2 -K2 -K2 (K2 &K2 ,K2 *K2 *K2 *K2 /K2 %K2  #!K2" ##K2$ %%K2& 0'K2( %)K2* 2+K2, 
-K2r1   c               |   \        4       P                  4        UUu/ uF  w  ppVR8w  g   K  Vf   K  VVbK  	  pppVRJ d   VP                  RR4       M"Vf   RV9  d   RR\        //VR&   M	Ve   VVR&   \	        V\
        4       \        VR.R7      pR	VR
&   V P                  RV4      p\        V4      # u uppi )a%  Generate a streaming search response.

Args:
    query (str): The query string.
    contents (ContentsOptions | False, optional): Options for retrieving page contents.
        Defaults to {"text": {"maxCharacters": 10000}}. Use False to disable contents.
    num_results (int, optional): Number of search results to return. Default 10.
    include_domains (List[str], optional): Domains to include in the search.
    exclude_domains (List[str], optional): Domains to exclude from the search.
    start_crawl_date (str, optional): Only links crawled after this date.
    end_crawl_date (str, optional): Only links crawled before this date.
    start_published_date (str, optional): Only links published after this date.
    end_published_date (str, optional): Only links published before this date.
    include_text (List[str], optional): Strings that must appear in the page text.
    exclude_text (List[str], optional): Strings that must not appear in the page text.
    type (SearchType, optional): Search type - 'auto' (default), 'fast',
        'deep-lite', 'deep', 'deep-reasoning', 'neural', or 'instant'.
    category (Category, optional): Data category to focus on.
    flags (List[str], optional): Experimental flags for Exa usage.
    moderation (bool, optional): If True, the search results will be moderated for safety.
    user_location (str, optional): Two-letter ISO country code of the user (e.g. US).
    additional_queries (List[str], optional): Alternative query formulations for deep search.
    system_prompt (str, optional): Instructions that guide the search process and streamed synthesis.
    output_schema (DeepOutputSchema, optional): Search output schema for structured synthesis.

Returns:
    StreamSearchResponse: An iterator yielding OpenAI-style streaming chunks with
        partial ``content`` and optional ``citations``.

Examples:
    stream = exa.stream_search(
        "What are the latest battery breakthroughs?",
        type="auto"
    )

    for chunk in stream:
        if chunk.content:
            print(chunk.content, end="", flush=True)
rP  NFr   r   r  r   rZ  Tr   r[  )	rb  rJ   r"  rc  r   rd  rK   rN  r  rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rL   rM   r   r  s   &&$$$$$$$$$$$$$$$$$$    r/   stream_searchExa.stream_search{  s    | %+HNN$4V$4DAqV441a4$4VuKK
D)*G";#),<>T+U"VGJ!"*GJ)=>O3DE ||Iw7#L11 Ws   B8B8B8c                   V ^8  d   QhRR/# r)   r   r+   r-   )r.   s   "r/   r0   r+    s     T
 T
 T
r1   c                |   RV/pVP                  4        F  w  rEVf   K  WSV&   K  	  RV9  d   RV9  d   RV9  d   R\        /VR&   / pVP                  \        4       VP                  \        4       VP                  \
        4       \        W64       RV9   dC   \        VR,          \        4      '       d&   VR,          pRV9   d   \        VR,          4      VR&   \        V. ROR
4      p\        VR.R7      pV P                  RV4      p\        VP                  R4      4      p	. p
VR,           EF"  p\        V4      pV
P!                  \#        VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R	4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \%        VP                  R4      4      R7      4       EK%  	  \'        V
VP                  R4      VP                  R4      VP                  R4      \)        VP                  R4      4      V	VP                  R4      R7      # ) D  
DEPRECATED: Use search() instead. The search() method now returns text contents by default.

Migration:
- search_and_contents(query) → search(query)
- search_and_contents(query, text=True) → search(query, contents={"text": True})
- search_and_contents(query, summary=True) → search(query, contents={"summary": True})
r   r   r   r   r  r!  r   r   r   r   rZ  r[  r\  r  r   rw   r:   rJ  rK  rL  rM  rN  re  r   r]  r^  r_  r  r`  ra  
r   r   r   r   r   r   r   r   r   r   )rJ   rc  rD  rd  CONTENTS_OPTIONS_TYPESCONTENTS_ENDPOINT_OPTIONS_TYPESr   rI   rF   r   r$  rK   rN  r  rq   rW   r   rc  r   r  r  rP  r   kwargsr   rL   rM   merged_optionssummary_optsrE   r  r  r^  rf  s   &&,          r/   search_and_contentsExa.search_and_contents  s}    E"LLNDA}
 #
 '!('/1GHGFO2345=>8 Jwy/A4$H$H"9-L<')>|H?U)VX&  
   H:>||Iw/)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'+DHHX,>?%.
 	
r1   c               @    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRR/
# )r)   r   $Union[str, List[str], List[_Result]]r   r:  r   Optional[LIVECRAWL_OPTIONS]r   r   rR  r   r   Optional[Union[str, List[str]]]r   Optional[ExtrasOptions]r   rd  r,   SearchResponse[ResultWithText]r-   )r.   s   "r/   r0   r+    sn     - -2- )- /	-
 %- --  - 8- (- #- 
(-r1   c
                	    R # r9   r-   )
rP  r   r   r   r   r   r   r   r   r   s
   &&&&&&&&&&r/   get_contentsExa.get_contents  s     *-r1   r   r   r   r   r   r   r   c               D    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRR/# )r)   r   r{  r   r.  r   r:  r   r|  r   r   rR  r   r   r}  r   r~  r   rd  r,   r  r-   )r.   s   "r/   r0   r+  -  sx     - -2- 8	-
 )- /- %- --  - 8- (- #- 
(-r1   c       	        	    R # r9   r-   )rP  r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$r/   r  r  ,  s     *-r1   c               D    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRR/# )r)   r   r{  r   r/  r   r:  r   r|  r   r   rR  r   r   r}  r   r~  r   rd  r,   !SearchResponse[ResultWithSummary]r-   )r.   s   "r/   r0   r+  =  sx     0 020 >	0
 )0 /0 %0 -0  0 80 (0 #0 
+0r1   c       	        	    R # r9   r-   )rP  r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$r/   r  r  <  s     -0r1   c               H    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRR/# )r)   r   r{  r   r.  r   r/  r   r:  r   r|  r   r   rR  r   r   r}  r   r~  r   rd  r,   (SearchResponse[ResultWithTextAndSummary]r-   )r.   s   "r/   r0   r+  M  s     7 727 8	7
 >7 )7 /7 %7 -7  7 87 (7 #7 
27r1   c       
        	    R # r9   r-   )rP  r   r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$$r/   r  r  L  s     47r1   c                   V ^8  d   QhRR/# r)   r   r{  r-   )r.   s   "r/   r0   r+  ]  s     e
 e
!E e
r1   c                   \        V\        4      '       d   V.pM]\        V\        4      '       dH   \        V4      ^ 8  d8   \        V^ ,          \        4      '       d   V Uu. uF  q3P
                  NK  	  ppRV/pVP                  4        F  w  rVVR8w  g   K  Vf   K  WdV&   K  	  RV9  d   RV9  d   RV9  d   R\        /VR&   / pVP                  \        4       VP                  \        4       \        WG4       RV9   dC   \        VR,          \        4      '       d&   VR,          pRV9   d   \        VR,          4      VR&   \        VR.4      pV P                  RV4      p	\!        V	P#                  R	4      4      p
. pV	P#                  R
. 4       FM  pVP%                  \'        VP#                  R4      VP#                  R4      VP#                  R4      R7      4       KO  	  . pV	R,           EF"  p\)        V4      pVP%                  \+        VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      \-        VP#                  R4      4      R7      4       EK%  	  \/        VV	P#                  R4      V	P#                  R4      V	P#                  R4      V
VV	P#                  R4      R 7      # u upi )!a  Retrieve contents for a list of URLs.

Args:
    urls (str | List[str] | List[Result]): A single URL, list of URLs, or list of Result objects.
    text (TextContentsOptions | True, optional): Options for text extraction.
    summary (SummaryContentsOptions | True, optional): Options for summary generation.
    max_age_hours (int, optional): Maximum age of cached content in hours. If content is older,
        it will be fetched fresh. Special values: 0 = always fetch fresh content,
        -1 = never fetch fresh (cache only). Example: 168 = fetch fresh for pages older than 7 days.
    filter_empty_results (bool, optional): Whether to filter out empty results.
    subpages (int, optional): Number of subpages to retrieve.
    subpage_target (str | List[str], optional): Target subpages to retrieve.
    extras (ExtrasOptions, optional): Options for extra content (links, image_links).
    flags (List[str], optional): Experimental flags.

Returns:
    SearchResponse[Result]: The response containing the contents of the URLs.

Examples:
    # Get contents for a single URL
    contents = exa.get_contents("https://example.com/article")

    # Get contents for multiple URLs
    contents = exa.get_contents([
        "https://example.com/article1",
        "https://example.com/article2"
    ])
r   rP  r   r   r   r  r!  	/contentsr\  r   rw   r  r  rw   r  r  r  r   r:   rJ  rK  rL  rM  rN  r   r   re  r   r]  r^  r_  r   r`  r   r  r   r  )rI   r+   r  lenrH  r   rJ   rc  rD  rr  rs  r   rF   r   rK   rN  r  rq   r   r  rW   rc  r   r  rP  r   ru  rr   rL   rM   rv  rw  rE   r  r   r  r  r^  rf  s   &&,             r/   r  r  ]  s   < dC  6Dd##D	A*T!Wg:V:V#'(4aEE4D(4.LLNDAF{q}
 #
 '!('/1GHGFO45=>8 Jwy/A4$H$H"9-L<')>|H?U)VX&(4||K1)$((=*ABhhz2.FOOzz$'!::h/!::h/ / 9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'%.
 	
w )s   "M&r   c               T    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRR/# r)   r   r+   r   rS  r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rR  r   rU  r   r,   rW  r-   )r.   s   "r/   r0   r+    s     _
 _
_
 C	_

 #_
 -_
 -_
 (_
 &_
 ,_
 *_
 *_
 *_
  ._
 %_
  #!_
" 
 #_
r1   c               h   \        4       P                  4        UUu/ uF  w  ppVR8w  g   K  Vf   K  VVbK  	  pppVRJ d   VP                  RR4       M"Vf   RV9  d   RR\        //VR&   M	Ve   VVR&   \	        V\
        4       \        V4      pV P                  RV4      p\        VP                  R4      4      p. pVR	,           EF"  p\        V4      pVP                  \        VP                  R
4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \        VP                  R4      4      R7      4       EK%  	  \        VVP                  R4      VP                  R4      VVP                  R4      R7      # u uppi )ai  Finds similar pages to a given URL, potentially with domain filters and date filters.

By default, returns text contents with 10,000 max characters. Use contents=False to opt-out.

Args:
    url (str): The URL to find similar pages for.
    contents (ContentsOptions | False, optional): Options for retrieving page contents.
        Defaults to {"text": {"maxCharacters": 10000}}. Use False to disable contents.
        See ContentsOptions for available options (text, highlights, summary, etc.).
    num_results (int, optional): Number of results to return. Default is None (server default).
    include_domains (List[str], optional): Domains to include in the search.
    exclude_domains (List[str], optional): Domains to exclude from the search.
    start_crawl_date (str, optional): Only links crawled after this date.
    end_crawl_date (str, optional): Only links crawled before this date.
    start_published_date (str, optional): Only links published after this date.
    end_published_date (str, optional): Only links published before this date.
    include_text (List[str], optional): Strings that must appear in the page text.
    exclude_text (List[str], optional): Strings that must not appear in the page text.
    exclude_source_domain (bool, optional): Whether to exclude the source domain.
    category (Category, optional): Data category to focus on (e.g. 'company', 'news', 'research paper').
    flags (List[str], optional): Experimental flags.

Returns:
    SearchResponse[Result]

Examples:
    similar_results = exa.find_similar(
        "miniclip.com",
        num_results=2,
        exclude_source_domain=True
    )
rP  NFr   r   r  /findSimilarr\  r  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   re  r   r]  r^  r_  r`  r  r  )rb  rJ   r"  rc  r   FIND_SIMILAR_OPTIONS_TYPESrK   rN  r  rq   rW   r   rc  r   r  rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   rL   rM   r   rE   r  r  r^  rf  s   &&$$$$$$$$$$$$$        r/   find_similarExa.find_similar  s   d %+HNN$4V$4DAqV441a4$4V uKK
D)*G";#),<>T+U"VGJ!"*GJ)CD(||NG4)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ %.
 	
O Ws   H.H.H.c          *     l    V ^8  d   QhRRRRRRRRRR	R
R	RR	RR	RRRRRRRRRRRRRRRRRRRRRRRRRR/# ) r)   r   r+   r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rR  r   rU  r   r   r   r|  r   r   r   r   r}  r   r~  r,   r  r-   )r.   s   "r/   r0   r+  &  s     - -- #	-
 -- -- (- &- ,- *- *- *-  .- %- #-  )!-" /#-$ %%-& -'-(  )-* 8+-, (--. 
(/-r1   c               	    R # r9   r-   )rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$$$$$$$$$$$r/   find_similar_and_contentsExa.find_similar_and_contents%  s    0 *-r1   c          ,     p    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR R!/# "r)   r   r+   r   r.  r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rR  r   rU  r   r   r   r|  r   r   r   r   r}  r   r~  r,   r  r-   )r.   s   "r/   r0   r+  @       - -- 8	-
 #- -- -- (- &- ,- *- *- *-  .- %-  #!-" )#-$ /%-& %'-( -)-*  +-, 8--. (/-0 
(1-r1   c               	    R # r9   r-   rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$$$$$$$$$$$$r/   r  r  ?      2 *-r1   c          ,     p    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR R!/# r  r-   )r.   s   "r/   r0   r+  [  r  r1   c               	    R # r9   r-   r  s   &&$$$$$$$$$$$$$$$$$$$$r/   r  r  Z  r  r1   c          ,     p    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR R!/# )"r)   r   r+   r   r/  r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rR  r   rU  r   r   r   r|  r   r   r   r   r}  r   r~  r,   r  r-   )r.   s   "r/   r0   r+  v  s     0 00 >	0
 #0 -0 -0 (0 &0 ,0 *0 *0 *0  .0 %0  #!0" )#0$ /%0& %'0( -)0*  +0, 8-0. (/00 
+10r1   c               	    R # r9   r-   )rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$$$$$$$$$$$$r/   r  r  u  s    2 -0r1   c          .     t    V ^8  d   QhRRRRRRRRR	R
RR
RRRRRRRRRR
RR
RRRRRR
RRRRRRRRRRRRR R!R"R#/# )$r)   r   r+   r   r.  r   r/  r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rR  r   rU  r   r   r   r|  r   r   r   r   r}  r   r~  r,   r  r-   )r.   s   "r/   r0   r+    s     7 77 8	7
 >7 #7 -7 -7 (7 &7 ,7 *7 *7 *7  .7  %!7" ##7$ )%7& /'7( %)7* -+7,  -7. 8/70 (172 
237r1   c               	    R # r9   r-   )rP  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &&$$$$$$$$$$$$$$$$$$$$$r/   r  r    s    4 47r1   c                   V ^8  d   QhRR/# r)   r   r+   r-   )r.   s   "r/   r0   r+    s     O
 O
S O
r1   c                <   RV/pVP                  4        F  w  rEVf   K  WSV&   K  	  RV9  d   RV9  d   R\        /VR&   / pVP                  \        4       VP                  \        4       VP                  \
        4       \        W64       RV9   dC   \        VR,          \        4      '       d&   VR,          pRV9   d   \        VR,          4      VR&   \        V. ROR
4      p\        VR.R7      pV P                  RV4      p\        VP                  R4      4      p	. p
VR,           EF"  p\        V4      pV
P!                  \#        VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R	4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \%        VP                  R4      4      R7      4       EK%  	  \'        V
VP                  R4      VP                  R4      VP                  R4      V	VP                  R4      R7      # )h  
DEPRECATED: Use find_similar() instead. The find_similar() method now returns text contents by default.

Migration:
- find_similar_and_contents(url) → find_similar(url)
- find_similar_and_contents(url, text=True) → find_similar(url, contents={"text": True})
- find_similar_and_contents(url, summary=True) → find_similar(url, contents={"summary": True})
r   r   r   r  r!  r   r   r   r   r   rZ  r  r\  r  rw   r:   rJ  rK  rL  rM  rN  re  r   r]  r^  r_  r`  r   r  r  rq  )rJ   rc  rD  r  rr  rs  r   rI   rF   r   r$  rK   rN  r  rq   rW   r   rc  r   r  rP  r   ru  r   rL   rM   rv  rw  rE   r  r  r^  rf  s   &&,          r/   r  r    sb    #,LLNDA}
 #  Yg%=/1GHGFO8945=>8 Jwy/A4$H$H"9-L<')>|H?U)VX&  
   H:>||NG4)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'%.
 	
r1   c                   V ^8  d   QhRR/# )r)   clientr   r-   )r.   s   "r/   r0   r+    s     D D6 Dr1   c                   a a VP                   P                  P                  o\        S4      RR VV 3R lll4       p\	        R4       W!P                   P                  n        V# )ab  Wrap an OpenAI client with Exa functionality.

After wrapping, any call to `client.chat.completions.create` will be intercepted
and enhanced with Exa RAG functionality. To disable Exa for a specific call,
set `use_exa="none"` in the `create` method.

Args:
    client (OpenAI): The OpenAI client to wrap.

Returns:
    OpenAI: The wrapped OpenAI client.
c                X    V ^8  d   QhRRRRRRRRR	R
RR
RRRRRRRRRR
RR
RRRRRRRR
/# )r)   messagesz$Iterable[ChatCompletionMessageParam]modelzUnion[str, ChatModel]use_exaz-Optional[Literal['required', 'none', 'auto']]r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rT  r   rU  result_max_lenr  r   r-   )r.   s   "r/   r0   Exa.wrap.<locals>.__annotate__	  s     .	 .	:.	 ).	
 C.	 '.	 1.	 1.	 ,.	 *.	 #0.	 !..	 ..	 ..	 3.	  )!.	"  #.	$ '%.	r1   c                   < R VRVRVRVRVRVRV	RV
RVR	VR
VRV/pRV/pVP                  V4       SP                  S\        V 4      VVVR7      # )r   r   r   r   r   r   r   r   r   r   r   r   r  )	create_fnr  max_lencreate_kwargs
exa_kwargs)rD  _create_with_toolr  )r  r  r  r   r   r   r   r   r   r   r   r   r   r   r  r   openai_kwargsr  r  funcrP  s   &&&&&&&&&&&&&&&&,  r/   create_with_rag!Exa.wrap.<locals>.create_with_rag	  s    0 {!?!?"$4 .&(<$&8HJ %e,M  /))h&+% *  r1   z.Wrapping OpenAI client with Exa functionality.)auto   NNNNNNNNNNi   N)chatcompletionscreater   print)rP  r  r  r  s   f& @r/   wrapExa.wrap  sV     {{&&--	t.	 .	 
.	` 	>?)8&r1   c               $    V ^8  d   QhRRRRRR/# )r)   r  r   r  z List[ChatCompletionMessageParam]r,   r   r-   )r.   s   "r/   r0   r+  C	  s(     > >> 3> 
>r1   c                	   R RRRRRRRR RRR	R R
RR//RR	.///.pWdR&   V! RRV/VB p\        V4      pV'       g   \        P                  ! VRR7      # V P                  VVP	                  R4      VP	                  R4      VP	                  R4      VP	                  R4      VP	                  R4      VP	                  R4      VP	                  R4      VP	                  R4      VP	                  R4      VP	                  R 4      VP	                  R4      VP	                  R4      R7      p	\        WR7      p
\        WrV
4      pV! RRV/VB p\        P                  ! WyR7      pV# )r   functionrx   r  r   z(Search the web for relevant information.
parametersobjectr   r   stringzThe query to search for.r   toolsr  N)
completion
exa_resultr   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   )r  r-   )r   r   from_completionrx  rq   r   r   )rP  r  r  r  r  r  r  r  r   r  exa_strnew_messagesexa_completions   &&&&&&       r/   r  Exa._create_with_toolC	  s    
H!#M $# & -/I&' #WI	#
( "'gBBMB

+&66%$ 
 --"}5&NN+<=&NN+<='^^,>?%>>*:;!+0F!G)~~.BC#7#7'^^J/..) . 

 $J@.zWMFFF
,<<!
 r1   r   r  c               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# r)   r   r+   r   rR  r   r   r<  r  #Optional[Literal['exa', 'exa-pro']]r   Optional[JSONSchemaInput]r   r,   z+Union[AnswerResponse, StreamAnswerResponse]r-   )r.   s   "r/   r0   r+  	  sZ     
: 
:
: 	
:
 
: %
: 3
: 1
: %
: 
5
:r1   c               	    R # r9   r-   )rP  r   r   r   r   r  r   r   s   &&$$$$$$r/   r  
Exa.answer	  s     7:r1   c               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# r  r-   )r.   s   "r/   r0   r+  	  sn     DK DKDK 	DK
 DK %DK 3DK 1DK %DK 
5DKr1   c                  V'       d   \        R4      h\        4       P                  4        UU	u/ uF  w  rVR8w  g   K  V	f   K  WbK  	  p
pp	RV
9   d!   V
R,          e   \        V
R,          4      V
R&   \	        V
R.4      p
V P                  RV
4      p. pVR,           F  p\        V4      pVP                  \        VP                  R4      VP                  R4      VP                  R4      VP                  R	4      VP                  R
4      VP                  R4      R7      4       K  	  \        VP                  R4      4      p\        VR,          W4      # u up	pi )a?  Generate an answer to a query using Exa's search and LLM capabilities.

Args:
    query (str): The query to answer.
    text (bool, optional): Whether to include full text in the results. Defaults to False.
    system_prompt (str, optional): A system prompt to guide the LLM's behavior when generating the answer.
    model (str, optional): The model to use for answering. Defaults to None.
    output_schema (dict[str, Any], optional): JSON schema describing the desired answer structure.

Returns:
    AnswerResponse: An object containing the answer and citations.

Raises:
    ValueError: If stream=True is provided. Use stream_answer() instead for streaming responses.

Examples:
    response = exa.answer("What is the capital of France?")

    print(response.answer)       # e.g. "Paris"
    print(response.citations)    # list of citations used

    # If you want the full text of the citations in the response:
    response_with_text = exa.answer(
        "What is the capital of France?",
        text=True
    )
    print(response_with_text.citations[0].text)  # Full page text
Zstream=True is not supported in `answer()`. Please use `stream_answer(...)` for streaming.rP  r   /answerr  rw   r   r:   rK  rL  r   r  r\  r  )r   rb  rJ   r   rK   rN  rW   r   r  rq   r  r  rP  r   r   r   r   r  r   r   rL   rM   r   responser  r^  rf  r  s   &&$$$$$$        r/   r  r  	  sL   N A 
 %+HNN$4V$4DAV4414$4V g%'/*B*N'<W_=U'VGO$/):;<<	73	{++F(0L#''-$((/&**73#/#3#34D#E'++H5%))&1	 , *(,,}*EFhx0)JJ/ Ws   EEEc               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r)   r   r+   r   r  r   r<  r  r  r   r  r   r,   r  r-   )r.   s   "r/   r0   r+  	  sP     *2 *2*2 	*2
 %*2 3*2 1*2 %*2 
*2r1   c               0   \        4       P                  4        UUu/ uF  w  rxVR8w  g   K  Vf   K  WxbK  	  p	ppRV	9   d!   V	R,          e   \        V	R,          4      V	R&   \        V	R.R7      p	RV	R&   V P	                  RV	4      p
\        V
4      # u uppi )a  Generate a streaming answer response.

Args:
    query (str): The query to answer.
    text (bool): Whether to include full text in the results. Defaults to False.
    system_prompt (str, optional): A system prompt to guide the LLM's behavior when generating the answer.
    model (str, optional): The model to use for answering. Defaults to None.
    output_schema (dict[str, Any], optional): JSON schema describing the desired answer structure.

Returns:
    StreamAnswerResponse: An object that can be iterated over to retrieve (partial text, partial citations).
        Each iteration yields a tuple of (Optional[str], Optional[List[AnswerResult]]).

Examples:
    stream = exa.stream_answer("What is the capital of France?", text=True)

    for chunk in stream:
        if chunk.content:
            print("Partial answer:", chunk.content)
        if chunk.citations:
            for citation in chunk.citations:
                print("Citation found:", citation.url)
rP  r   rZ  Tr   r  )rb  rJ   r   rK   rN  r  rP  r   r   r   r  r   r   rL   rM   r   r  s   &&$$$$$    r/   stream_answerExa.stream_answer	  s    B %+HNN$4V$4DAV4414$4V g%'/*B*N'<W_=U'VGO$O3DE ||Iw7#L11 Ws   BBB)r)  r0  r3  r2  r1  )https://api.exa.aiNNr>  NN)NNNNNNNN)r   r   r   r   r   rQ  rN  r  rk  rx  r   r  r  r  r  r  r  r  r   r-   r1   r/   r&  r&  p  s   0$3LQfM
 "'	M

 FJM
 &*M
 04M
 04M
 +/M
 )-M
 /3M
 -1M
 -1M
 -1M
 26M
  (,!M
" &*#M
$ &*%M
& (,'M
( 37)M
* (,+M
, 59-M
^K2 FJ	K2
 &*K2 04K2 04K2 +/K2 )-K2 /3K2 -1K2 -1K2 -1K2 26K2 (,K2  &*!K2" &*#K2$ (,%K2& 37'K2( (,)K2* 59+K2ZT
l - - -
 ,0- 26- (,- 04- #'- ;?- +/- &*- - 0
 ,00 260 (,0 040 #'0 ;?0 +/0 &*0 0 7 ,07 267 (,7 047 #'7 ;?7 +/7 &*7 7 e
N_
 FJ	_

 &*_
 04_
 04_
 +/_
 )-_
 /3_
 -1_
 -1_
 -1_
 15_
 (,_
  &*!_
B - &*	-
 04- 04- +/- )-- /3- -1- -1- -1- 15- (,- &*-  ,0!-" 26#-$ (,%-& 04'-( #')-* ;?+-, +/-- -2 -
 &*- 04- 04- +/- )-- /3- -1- -1- -1- 15- (,-  &*!-" ,0#-$ 26%-& (,'-( 04)-* #'+-, ;?--. +//- -4 -
 &*- 04- 04- +/- )-- /3- -1- -1- -1- 15- (,-  &*!-" ,0#-$ 26%-& (,'-( 04)-* #'+-, ;?--. +//- -4 0
 &*0 040 040 +/0 )-0 /30 -10 -10 -10 150 (,0  &*!0" ,0#0$ 26%0& (,'0( 04)0* #'+0, ;?-0. +//0 04 7 &*7 047 047 +/7 )-7 /37 -17 -17 -17 157  (,!7" &*#7$ ,0%7& 26'7( (,)7* 04+7, #'-7. ;?/70 +/17 76O
bDL>@ 
: "'	
:
  %
: (,
: 6:
: 48
: (,
: 
:DK "'	DK
  %DK (,DK 6:DK 48DK (,DKL*2 	*2
 (,*2 6:*2 48*2 (,*2 *2r1   r&  c            &        a  ] tR tRtR1R V 3R lllt]R R l4       tR2R R lltR	R
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR/R R lltRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR/R R  llt	R! R" lt
R# R$ ltRRRRRRRRRRRRRRRRRRRRR%RRRRR/R& R' lltR( R) ltR	R
R*R
RRR+RRRRR/R, R- lltR*R
RRR+RRRRR/R. R/ lltR0tV ;t# )3AsyncExai
  c                    V ^8  d   QhRRRR/# )r)   r(  r+   api_baser-   )r.   s   "r/   r0   AsyncExa.__annotate__
  s       s r1   c                	   < \         SV `  W4       \        V 4      V n        \	        V 4      V n        \        V 4      V n        R V n        R # r9   )	rg  rQ  r%   r2  r   r1  r#   r3  _client)rP  r(  r  rh  s   &&&r/   rQ  AsyncExa.__init__
  s;    ++D1)$/1$7r1   c                   V ^8  d   QhRR/# )r)   r,   zhttpx.AsyncClientr-   )r.   s   "r/   r0   r  
  s      ) r1   c                	    V P                   f3   \        P                  ! V P                  V P                  RR7      V n         V P                   # )NiX  )r)  r0  timeout)r  httpxAsyncClientr)  r0  r  s   &r/   r  AsyncExa.client
  s;     << ,,cDL ||r1   Nc               $    V ^8  d   QhRRRRRR/# )r)   r6  r+   r7  r0  r9  r-   )r.   s   "r/   r0   r  
  s-     I II 	I *Ir1   c                  "   T;'       d2    \        V\        4      ;'       d    VP                  R4      ;'       g    T;'       d    VP                  R4      R8H  p/ V P                  CpV'       d   VP	                  V4       VP                  4       R8X  d   V'       dS   \        P                  ! RV P                  V,           VVR7      pV P                  P                  VRR7      G Rj  xL
 p	V	# V P                  P                  V P                  V,           WGR7      G Rj  xL
 p	EMKVP                  4       R8X  d   V'       dR   \        P                  ! RV P                  V,           W'R	7      pV P                  P                  VRR7      G Rj  xL
 p	V	# V P                  P                  V P                  V,           W'R	7      G Rj  xL
 p	MVP                  4       R
8X  d8   V P                  P                  V P                  V,           W'R	7      G Rj  xL
 p	MZVP                  4       R8X  d8   V P                  P                  V P                  V,           VR7      G Rj  xL
 p	M\        RV 24      hV	P                  ^8w  d7   V	P                  ^8w  d&   \        RV	P                   RV	P                    24      hV	P#                  4       #  EL EL ELA EL L Lx5i)an  Send a request to the Exa API, optionally streaming if data['stream'] is True.

Args:
    endpoint (str): The API endpoint (path).
    data (dict, optional): The JSON payload to send.
    method (str, optional): The HTTP method to use. Defaults to "POST".
    params (dict, optional): Query parameters.
    headers (Dict[str, str], optional): Additional headers to include in the request. Defaults to None.

Returns:
    Union[dict, httpx.Response]: If streaming, returns the Response object.
    Otherwise, returns the JSON-decoded response as a dict.

Raises:
    ValueError: If the request fails (non-200 status code).
r   r<  r=  )r8  r0  T)r   Nr>  )r  r0  r?  r@  rA  rB  r  r  )rI   rF   rq   r0  rD  rE  r  Requestr)  r  sendrG  rH  rI  r   r  r   r  )
rP  r6  rE   r7  r8  r0  rK  rL  rN  rM  s
   &&&&&&    r/   async_requestAsyncExa.async_request
  sl    2  QQJtT$:QQtxx?Q 
 
55vzz(+v5 	
 +T\\*""7+<<>U"--MMH,!+	 !KK,,WT,BB
 KKOOMMH,V ,   \\^v%--DMMH44 !KK,,WT,BB
 KK,,MMH,4 -   \\^w&))(t *  C \\^x'**(/ +  C 8ABB??c!coo&<23??2C2chhZP  xxz? C Cs   !KK	K*K2-K AK+K,7K#K$"KA
KK7K	K
AKKAK!K"A+KKKKKKr   Fr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c          *     l    V ^8  d   QhRRRRRRRRR	R
RR
RRRRRRRRRR
RR
RRRRRR
RRRRRR
RRRRRR/# rQ  r-   )r.   s   "r/   r0   r  b
  s     J
 J
J
 	J

 CJ
 #J
 -J
 -J
 (J
 &J
 ,J
 *J
 *J
 *J
 /J
  %!J
" ##J
$ #%J
& %'J
( 0)J
* %+J
, 2-J
. 
 /J
r1   c               (  "   V'       d   \        R4      h\        4       P                  4        UUu/ uF  w  ppVR8w  g   K  Vf   K  VVbK  	  pppVP                  RR4       VRJ d   VP                  RR4       M"Vf   RV9  d   RR\        //VR&   M	Ve   VVR&   \        V\        4       \        VR	.R
7      pV P                  RV4      G Rj  xL
 p\        VP                  R4      4      p. pVR,           EF"  p\        V4      pVP                  \        VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \        VP                  R4      4      R7      4       EK%  	  \        VVP                  R4      VP                  R4      VP                  R4      \!        VP                  R 4      4      VVP                  R!4      R"7      # u uppi  EL5i)#a  Perform a search with a prompt-engineered query to retrieve relevant results.

By default, returns text contents with 10,000 max characters. Use contents=False to opt-out.

Args:
    query (str): The query string.
    stream (bool, optional): If True, stream the synthesized search response.
        Use ``stream_search(...)`` instead of ``search(..., stream=True)``.
    contents (ContentsOptions | False, optional): Options for retrieving page contents.
        Defaults to {"text": {"maxCharacters": 10000}}. Use False to disable contents.
        See ContentsOptions for available options (text, highlights, summary, etc.).
        Note: The ``context`` option is deprecated; use ``highlights`` or ``text`` instead.
    num_results (int, optional): Number of search results to return. Default 10.
    include_domains (List[str], optional): Domains to include in the search.
    exclude_domains (List[str], optional): Domains to exclude from the search.
    start_crawl_date (str, optional): Only links crawled after this date.
    end_crawl_date (str, optional): Only links crawled before this date.
    start_published_date (str, optional): Only links published after this date.
    end_published_date (str, optional): Only links published before this date.
    include_text (List[str], optional): Strings that must appear in the page text.
    exclude_text (List[str], optional): Strings that must not appear in the page text.
    type (SearchType, optional): Search type - 'auto' (default), 'fast',
        'deep-lite', 'deep', 'deep-reasoning', 'neural', or 'instant'.
    category (Category, optional): Data category to focus on (e.g. 'company', 'news', 'research paper').
    flags (List[str], optional): Experimental flags for Exa usage.
    moderation (bool, optional): If True, the search results will be moderated for safety.
    user_location (str, optional): Two-letter ISO country code of the user (e.g. US).
    additional_queries (List[str], optional): Alternative query formulations for deep search to skip
        automatic LLM-based query expansion. Max 5 queries. Only applicable when type is
        'deep-lite', 'deep', or 'deep-reasoning'.
        Example: ["machine learning", "ML algorithms", "neural networks"]
    system_prompt (str, optional): Instructions that guide both the search process and
        the final returned result. Use this to prefer certain sources, emphasize novelty,
        avoid duplicates, or constrain the response style. Supported for all search types.
    output_schema (DeepOutputSchema, optional): Search output schema for structured
        synthesis. When provided, the API returns synthesized output in ``output``.
        Use ``{"type": "text", "description": ...}`` for plain text output or
        ``{"type": "object", "properties": ..., "required": ...}`` for structured JSON.
        For object schemas, max nesting depth is 2 and max total properties is 10.
        Supported for all search types.

Returns:
    SearchResponse: The response containing search results, etc.

Raises:
    ValueError: If stream=True is provided. Use stream_search() instead.

Examples:
    Basic async search:
    >>> async_exa = AsyncExa(api_key="your-api-key")
    >>> results = await async_exa.search("latest AI research papers")
    >>> print(results.results[0].title)

    Async search with filters:
    >>> results = await async_exa.search(
    ...     "climate change research",
    ...     include_domains=["nature.com", "science.org"],
    ...     start_published_date="2024-01-01"
    ... )
rY  rP  Nr   Fr   r   r  r   rZ  r[  r\  r  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   re  r   r]  r^  r_  r   r  r`  ra  )r   rb  rJ   r"  rc  r   rd  rK   r  r  rq   rW   r   rc  r   r  r  re  s   &&$$$$$$$$$$$$$$$$$$$        r/   r  AsyncExa.searchb
  s[    h A 
 %+HNN$4V$4DAqV441a4$4VHd# uKK
D)*G";#),<>T+U"VGJ!"*GJ)=>O3DE''	7;;)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'+DHHX,>?%.
 	
Q W  <s*   /JJ	J	J	BJJF=Jc          (     h    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRR/# )r)   r   r+   r   rS  r   r:  r   rd  r   r   r<  r   r   r   r   r   r   rT  r   rU  r   r   rR  r   r   r   r   rV  r,   r  r-   )r.   s   "r/   r0   r  
  s     J7 J7J7 C	J7
 #J7 -J7 -J7 (J7 &J7 ,J7 *J7 *J7 *J7 /J7 %J7  #!J7" ##J7$ %%J7& 0'J7( %)J7* 2+J7, 
#-J7r1   c                 "   \        4       P                  4        UUu/ uF  w  ppVR8w  g   K  Vf   K  VVbK  	  pppVRJ d   VP                  RR4       M"Vf   RV9  d   RR\        //VR&   M	Ve   VVR&   \	        V\
        4       \        VR.R7      pR	VR
&   V P                  RV4      G Rj  xL
 p\        V4      # u uppi  L5i)ae  Generate a streaming search response asynchronously.

Args:
    query (str): The query string.
    contents (ContentsOptions | False, optional): Options for retrieving page contents.
        Defaults to {"text": {"maxCharacters": 10000}}. Use False to disable contents.
    num_results (int, optional): Number of search results to return. Default 10.
    include_domains (List[str], optional): Domains to include in the search.
    exclude_domains (List[str], optional): Domains to exclude from the search.
    start_crawl_date (str, optional): Only links crawled after this date.
    end_crawl_date (str, optional): Only links crawled before this date.
    start_published_date (str, optional): Only links published after this date.
    end_published_date (str, optional): Only links published before this date.
    include_text (List[str], optional): Strings that must appear in the page text.
    exclude_text (List[str], optional): Strings that must not appear in the page text.
    type (SearchType, optional): Search type - 'auto' (default), 'fast',
        'deep-lite', 'deep', 'deep-reasoning', 'neural', or 'instant'.
    category (Category, optional): Data category to focus on.
    flags (List[str], optional): Experimental flags for Exa usage.
    moderation (bool, optional): If True, the search results will be moderated for safety.
    user_location (str, optional): Two-letter ISO country code of the user (e.g. US).
    additional_queries (List[str], optional): Alternative query formulations for deep search.
    system_prompt (str, optional): Instructions that guide the search process and streamed synthesis.
    output_schema (DeepOutputSchema, optional): Search output schema for structured synthesis.

Returns:
    AsyncStreamSearchResponse: An async iterator yielding OpenAI-style streaming chunks.

Examples:
    >>> async_exa = AsyncExa(api_key="your-api-key")
    >>> stream = await async_exa.stream_search(
    ...     "What are the latest battery breakthroughs?",
    ...     type="auto"
    ... )
    >>> async for chunk in stream:
    ...     if chunk.content:
    ...         print(chunk.content, end="", flush=True)
rP  NFr   r   r  r   rZ  Tr   r[  )	rb  rJ   r"  rc  r   rd  rK   r  r  rj  s   &&$$$$$$$$$$$$$$$$$$    r/   rk  AsyncExa.stream_search
  s     z %+HNN$4V$4DAqV441a4$4VuKK
D)*G";#),<>T+U"VGJ!"*GJ)=>O3DE !//	7CC(66 W Ds&   C
CCCA6C
2C3C
c                   V ^8  d   QhRR/# rn  r-   )r.   s   "r/   r0   r  :  s     S
 S
s S
r1   c                h  "   RV/pVP                  4        F  w  rEVf   K  WSV&   K  	  RV9  d   RV9  d   RV9  d   R\        /VR&   / pVP                  \        4       VP                  \        4       VP                  \
        4       \        W64       RV9   dC   \        VR,          \        4      '       d&   VR,          pRV9   d   \        VR,          4      VR&   \        V. ROR4      p\        VR.R7      pV P                  RV4      G Rj  xL
 p\        VP                  R4      4      p	. p
VR,           EF"  p\        V4      pV
P!                  \#        VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R
4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \%        VP                  R4      4      R7      4       EK%  	  \'        V
VP                  R4      VP                  R4      VP                  R	4      V	VP                  R4      R7      #  EL5i) rp  r   Nr   r   r   r  r!  r   r   r   r   rZ  r[  r\  r  r   rw   r:   rJ  rK  rL  rM  rN  re  r   r]  r^  r_  r`  r  rq  )rJ   rc  rD  rd  rr  rs  r   rI   rF   r   r$  rK   r  r  rq   rW   r   rc  r   r  rt  s   &&,          r/   rx  AsyncExa.search_and_contents:  sy     E"LLNDA}
 #
 '!('/1GHGFO2345=>8 Jwy/A4$H$H"9-L<')>|H?U)VX&  
   H:>''	7;;)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'%.
 	
1 <s   J2C/J2J/FJ2c                   V ^8  d   QhRR/# r  r-   )r.   s   "r/   r0   r    s     e
 e
'K e
r1   c                  "   \        V\        4      '       d   V.pM]\        V\        4      '       dH   \        V4      ^ 8  d8   \        V^ ,          \        4      '       d   V Uu. uF  q3P
                  NK  	  ppRV/pVP                  4        F  w  rVVR8w  g   K  Vf   K  WdV&   K  	  RV9  d   RV9  d   RV9  d   R\        /VR&   / pVP                  \        4       VP                  \        4       \        WG4       RV9   dC   \        VR,          \        4      '       d&   VR,          pRV9   d   \        VR,          4      VR&   \        VR.4      pV P                  R	V4      G Rj  xL
 p	\!        V	P#                  R
4      4      p
. pV	P#                  R. 4       FM  pVP%                  \'        VP#                  R4      VP#                  R4      VP#                  R4      R7      4       KO  	  . pV	R,           EF"  p\)        V4      pVP%                  \+        VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      VP#                  R4      \-        VP#                  R4      4      R7      4       EK%  	  \/        VV	P#                  R4      V	P#                  R4      V	P#                  R4      V
VV	P#                  R 4      R!7      # u upi  EL	5i)"a  Retrieve contents for a list of URLs asynchronously.

Args:
    urls (str | List[str] | List[Result]): A single URL, list of URLs, or list of Result objects.
    text (TextContentsOptions | True, optional): Options for text extraction.
    summary (SummaryContentsOptions | True, optional): Options for summary generation.
    max_age_hours (int, optional): Maximum age of cached content in hours. If content is older,
        it will be fetched fresh. Special values: 0 = always fetch fresh content,
        -1 = never fetch fresh (cache only). Example: 168 = fetch fresh for pages older than 7 days.
    filter_empty_results (bool, optional): Whether to filter out empty results.
    subpages (int, optional): Number of subpages to retrieve.
    subpage_target (str | List[str], optional): Target subpages to retrieve.
    extras (ExtrasOptions, optional): Options for extra content (links, image_links).
    flags (List[str], optional): Experimental flags.

Returns:
    SearchResponse[Result]: The response containing the contents of the URLs.

Examples:
    Get contents for URLs asynchronously:
    >>> async_exa = AsyncExa(api_key="your-api-key")
    >>> results = await async_exa.get_contents("https://example.com/article")
    >>> print(results.results[0].text)

    Get contents from async search results:
    >>> search_results = await async_exa.search("AI news", contents=False)
    >>> contents = await async_exa.get_contents(search_results.results[:5])
r   rP  Nr   r   r   r  r!  r  r\  r   rw   r  r  r  r  r   r:   rJ  rK  rL  rM  rN  r   r   re  r   r]  r^  r_  r   r`  r  )rI   r+   r  r  rH  r   rJ   rc  rD  rr  rs  r   rF   r   rK   r  r  rq   r   r  rW   rc  r   r  r  s   &&,             r/   r  AsyncExa.get_contents  s    < dC  6Dd##D	A*T!Wg:V:V#'(4aEE4D(4.LLNDAF{q}
 #
 '!('/1GHGFO45=>8 Jwy/A4$H$H"9-L<')>|H?U)VX&(4''W==)$((=*ABhhz2.FOOzz$'!::h/!::h/ / 9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'%.
 	
w )4 >s,   A"M8$M08M8M8"C
M8,M5-H	M8r   c               T    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRR/# r  r-   )r.   s   "r/   r0   r    s     e
 e
e
 C	e

 #e
 -e
 -e
 (e
 &e
 ,e
 *e
 *e
 *e
  .e
 %e
  #!e
" 
 #e
r1   c                 "   \        4       P                  4        UUu/ uF  w  ppVR8w  g   K  Vf   K  VVbK  	  pppVRJ d   VP                  RR4       M"Vf   RV9  d   RR\        //VR&   M	Ve   VVR&   \	        V\
        4       \        V4      pV P                  RV4      G Rj  xL
 p\        VP                  R4      4      p. pVR	,           EF"  p\        V4      pVP                  \        VP                  R
4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \        VP                  R4      4      R7      4       EK%  	  \        VVP                  R4      VP                  R4      VVP                  R4      R7      # u uppi  EL5i)a  Finds similar pages to a given URL, potentially with domain filters and date filters.

By default, returns text contents with 10,000 max characters. Use contents=False to opt-out.

Args:
    url (str): The URL to find similar pages for.
    contents (ContentsOptions | False, optional): Options for retrieving page contents.
        Defaults to {"text": {"maxCharacters": 10000}}. Use False to disable contents.
        See ContentsOptions for available options (text, highlights, summary, etc.).
    num_results (int, optional): Number of results to return. Default is None (server default).
    include_domains (List[str], optional): Domains to include in the search.
    exclude_domains (List[str], optional): Domains to exclude from the search.
    start_crawl_date (str, optional): Only links crawled after this date.
    end_crawl_date (str, optional): Only links crawled before this date.
    start_published_date (str, optional): Only links published after this date.
    end_published_date (str, optional): Only links published before this date.
    include_text (List[str], optional): Strings that must appear in the page text.
    exclude_text (List[str], optional): Strings that must not appear in the page text.
    exclude_source_domain (bool, optional): Whether to exclude the source domain.
    category (Category, optional): Data category to focus on (e.g. 'company', 'news', 'research paper').
    flags (List[str], optional): Experimental flags.

Returns:
    SearchResponse[Result]

Examples:
    Find similar pages asynchronously:
    >>> async_exa = AsyncExa(api_key="your-api-key")
    >>> results = await async_exa.find_similar("https://www.nature.com/articles/s41586-021-03819-2")
    >>> print(results.results[0].title)

    Find similar with domain filters:
    >>> results = await async_exa.find_similar(
    ...     "https://arxiv.org/abs/2301.00001",
    ...     include_domains=["arxiv.org", "openreview.net"],
    ...     exclude_source_domain=True
    ... )
rP  NFr   r   r  r  r\  r  r   rw   r:   rJ  rK  rL  rM  rN  r   r   r   r   re  r   r]  r^  r_  r`  r  )rb  rJ   r"  rc  r   r  rK   r  r  rq   rW   r   rc  r   r  r  s   &&$$$$$$$$$$$$$        r/   r  AsyncExa.find_similar  s    p %+HNN$4V$4DAqV441a4$4V uKK
D)*G";#),<>T+U"VGJ!"*GJ)CD(''@@)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ %.
 	
O W As'   IH8H8H8A.I*H>+FIc                   V ^8  d   QhRR/# r  r-   )r.   s   "r/   r0   r  ]  s     N
 N
3 N
r1   c                Z  "   RV/pVP                  4        F  w  rEVf   K  WSV&   K  	  RV9  d   RV9  d   R\        /VR&   / pVP                  \        4       VP                  \        4       VP                  \
        4       \        W64       RV9   dC   \        VR,          \        4      '       d&   VR,          pRV9   d   \        VR,          4      VR&   \        V. ROR4      p\        VR.R7      pV P                  RV4      G Rj  xL
 p\        VP                  R4      4      p	. p
VR,           EF"  p\        V4      pV
P!                  \#        VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      VP                  R	4      VP                  R
4      VP                  R4      VP                  R4      VP                  R4      VP                  R4      \%        VP                  R4      4      R7      4       EK%  	  \'        V
VP                  R4      VP                  R4      VP                  R4      V	VP                  R4      R7      #  EL5i)r  r   Nr   r   r  r!  r   r   r   r   r   rZ  r  r\  r  rw   r:   rJ  rK  rL  rM  rN  re  r   r]  r^  r_  r`  r  rq  )rJ   rc  rD  r  rr  rs  r   rI   rF   r   r$  rK   r  r  rq   rW   r   rc  r   r  r  s   &&,          r/   r  "AsyncExa.find_similar_and_contents]  sp     #,LLNDA}
 #  Yg%=/1GHGFO8945=>8 Jwy/A4$H$H"9-L<')>|H?U)VX&  
   H:>''@@)$((=*AB9ooF(0LNN$((/#''-&**73&**73#/#3#34D#E'++H5&**73(,,Y7)--j9'++H5%))&1(,,Y7+//=%1%5%56H%I,VZZ
-CD &* HH)*HHZ HHY'%.
 	
1 As   J+C(J+
J(FJ+r   r  c               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# r  r-   )r.   s   "r/   r0   r    sn     BK BKBK 	BK
 BK %BK 3BK 1BK %BK 
5BKr1   c                 "   V'       d   \        R4      h\        4       P                  4        UU	u/ uF  w  rVR8w  g   K  V	f   K  WbK  	  p
pp	RV
9   d!   V
R,          e   \        V
R,          4      V
R&   \	        V
R.R7      p
V P                  RV
4      G Rj  xL
 p. pVR,           F  p\        V4      pVP                  \        VP                  R4      VP                  R	4      VP                  R
4      VP                  R4      VP                  R4      VP                  R4      R7      4       K  	  \        VP                  R4      4      p\        VR,          W4      # u up	pi  L5i)ag  Generate an answer to a query using Exa's search and LLM capabilities.

Args:
    query (str): The query to answer.
    text (bool, optional): Whether to include full text in the results. Defaults to False.
    system_prompt (str, optional): A system prompt to guide the LLM's behavior when generating the answer.
    model (str, optional): The model to use for answering. Defaults to None.
    output_schema (dict[str, Any], optional): JSON schema describing the desired answer structure.

Returns:
    AnswerResponse: An object containing the answer and citations.

Raises:
    ValueError: If stream=True is provided. Use stream_answer() instead for streaming responses.

Examples:
    Basic async question answering:
    >>> async_exa = AsyncExa(api_key="your-api-key")
    >>> response = await async_exa.answer("What are the latest developments in quantum computing?")
    >>> print(response.answer)

    Async answer with citations:
    >>> response = await async_exa.answer("Explain renewable energy benefits", text=True)
    >>> for citation in response.citations:
    ...     print(f"{citation.title}: {citation.url}")
r  rP  Nr   rZ  r  r  rw   r   r:   rK  rL  r   r  r\  r  )r   rb  rJ   r   rK   r  rW   r   r  rq   r  r  r  s   &&$$$$$$        r/   r  AsyncExa.answer  sZ    J A 
 %+HNN$4V$4DAV4414$4V g%'/*B*N'<W_=U'VGO$O3DE++Iw??	{++F(0L#''-$((/&**73#/#3#34D#E'++H5%))&1	 , *(,,}*EFhx0)JJ/ W @s*   /E+E#E#E#AE+E)CE+c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r)   r   r+   r   r  r   r<  r  r  r   r  r   r,   r  r-   )r.   s   "r/   r0   r    sP     /7 /7/7 	/7
 %/7 3/7 1/7 %/7 
#/7r1   c               L  "   \        4       P                  4        UUu/ uF  w  rxVR8w  g   K  Vf   K  WxbK  	  p	ppRV	9   d!   V	R,          e   \        V	R,          4      V	R&   \        V	R.R7      p	RV	R&   V P	                  RV	4      G Rj  xL
 p
\        V
4      # u uppi  L5i)a  Generate a streaming answer response.

Args:
    query (str): The query to answer.
    text (bool): Whether to include full text in the results. Defaults to False.
    system_prompt (str, optional): A system prompt to guide the LLM's behavior when generating the answer.
    model (str, optional): The model to use for answering. Defaults to None.
    output_schema (dict[str, Any], optional): JSON schema describing the desired answer structure.
    user_location (str, optional): The user's location for location-aware answers.

Returns:
    AsyncStreamAnswerResponse: An object that can be iterated over to retrieve (partial text, partial citations).
        Each iteration yields a tuple of (Optional[str], Optional[List[AnswerResult]]).

Examples:
    Stream an answer asynchronously:
    >>> async_exa = AsyncExa(api_key="your-api-key")
    >>> async for chunk in async_exa.stream_answer("What is quantum computing?"):
    ...     if chunk.text:
    ...         print(chunk.text, end="", flush=True)

    Async stream with citations:
    >>> async for chunk in async_exa.stream_answer("Explain climate change", text=True):
    ...     if chunk.text:
    ...         print(chunk.text, end="")
    ...     if chunk.citations:
    ...         print(f"\nCitations: {[c.url for c in chunk.citations]}")
rP  Nr   rZ  Tr   r  )rb  rJ   r   rK   r  r  r  s   &&$$$$$    r/   r  AsyncExa.stream_answer  s     L %+HNN$4V$4DAV4414$4V g%'/*B*N'<W_=U'VGO$O3DE !//	7CC(66 W Ds&   B$BBBAB$B"B$)r  r3  r2  r1  )r  r  )r   r   r   r   rQ  propertyr  r  r  rk  rx  r  r  r  r  r  r   rn  ro  s   @r/   r  r  
  s
      IVJ
 "'	J

 FJJ
 &*J
 04J
 04J
 +/J
 )-J
 /3J
 -1J
 -1J
 -1J
 26J
  (,!J
" &*#J
$ &*%J
& (,'J
( 37)J
* (,+J
, 59-J
XJ7 FJ	J7
 &*J7 04J7 04J7 +/J7 )-J7 /3J7 -1J7 -1J7 -1J7 26J7 (,J7  &*!J7" &*#J7$ (,%J7& 37'J7( (,)J7* 59+J7XS
je
Ne
 FJ	e

 &*e
 04e
 04e
 +/e
 )-e
 /3e
 -1e
 -1e
 -1e
 15e
 (,e
  &*!e
NN
`BK "'	BK
  %BK (,BK 6:BK 48BK (,BKH/7 	/7
 (,/7 6:/7 48/7 (,/7 /7r1   r  )r   zresearch papernewspdfzpersonal sitezfinancial reportpeople)r  fastz	deep-litedeepzdeep-reasoningr4  instant)alwaysfallbackneverr  	preferred)compactstandardfull)unspecifiedheader
navigationbannerbodysidebarfooterr   r  )
__future__r   rz  r  r.  rQ   r   	functoolsr   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r1  r   r  rF  openair   /openai.types.chat.chat_completion_message_paramr   openai.types.chat_modelr   typing_extensionsr   exa_py.utilsr   r   r   r   r   r   r   r    websets.core.baser!   r3  r"   r#   r2  r$   r%   getenvis_betarc  rC   rK   rT   rW   r   Category
SearchTyper   r   DeepOutputSchemar+   r  r  r  rF   rd  r  r0  rr  rs  r   r   r  r  SECTION_TAGr  r  r   r#  r'  r)  r-  r2  r7  r  r_   r`   rb   ra   rc   r]   rd   re   rf   r^   r[   r\   EntityrH  rc  rq  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r$  r&  r  r-   r1   r/   <module>r@     s#   "   	 	 !    " (    V - '   # - E 9 ))I
&
(   F& 68 *
D$w*v  q 
9E Ye  -/EEF $cU$C5$ $ v$ $ se$ $ $ cU$  !$& '$, -$4 
5$6 dV7$8 4&9$: t;$< =$B cUdVtfG$ N 
C5C5vvseSE3%TFTFdV
dVt $ NO  TF
T4Ld|4,d|t##$cUTFdV  sDktfdV	# 0P& 9:  \ 3()5 (,% 6
Ye 
	  Ye IU iu >	 )5  ) ) )       " " " ! ! ! O O O ) ) ) 	D 	D 	D " " "    ? ? ? P P P ( ( ( ' ' ' 
}l*	+ J J JZ ;W ; ;| *1W *1 *1Z *7 *7 *7Z .Pw .P .Pb %
 %
 %
P   6   47# 7#t:# :#z</ << 9 < CL    +WQZ + +\    '..E&F # 4 4 4 4 / / /=B@"P2 P2f$]7s ]7r1   