
    >'h                        d dl Z d dlZd dlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+ 	 d dl,Z,e,jZ                  j]                  d      re/d dl0m1Z,  e jd                  e jf                  d      Z4 G d d      Z5 G d d      Z6y# e/$ r d dl,Z,Y =w xY w)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)jsonable_encoder)remove_none_from_dict)UnprocessableEntityError)ExtractAgent)ExtractConfig)
ExtractJob)ExtractJobCreate)ExtractResultset)
ExtractRun)ExtractSchemaValidateResponse)HttpValidationError)LlamaExtractSettings)PaginatedExtractRunsResponse   )ExtractAgentCreateDataSchema)ExtractAgentUpdateDataSchema)'ExtractJobCreateBatchDataSchemaOverride)&ExtractSchemaValidateRequestDataSchemaz1..c                      e Zd ZdefdZdedej                  e   fdZ	ddddej                  e   dej                  e   d	ed
ededefdZd
edefdZddd	edej                  e   defdZdedefdZded
ededefdZdedej*                  fdZdedej                  e   fdZdddej                  e   dedefdZdedefdZdeddej                  e   dedej                  e   defdZdddddej                  e   ded ej@                  d!ej                  e   d"ej                  e   defd#Z!deeddej                  e   ded$ej                  e   d!ej                  e"   d"ej                  e   dej                  e   fd%Z#dede$fd&Z%ddd'ded(ej                  e&   d)ej                  e&   de'fd*Z(dedej                  e)   fd+Z*dede)fd,Z+d-ede)fd.Z,d-edej*                  fd/Z-y)0LlamaExtractClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     q/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/llama_cloud/resources/llama_extract/client.py__init__zLlamaExtractClient.__init__(   
    -    
project_idreturnc                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d      }d|j                  cxk  rdk  r<n n9t        j                  t        j                  t           |j                               S |j                  d	k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |
      # t$        $ r" t'        |j                  |j(                  
      w xY w)a"  
        Parameters:
            - project_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.list_extraction_agents(
            project_id="string",
        )
        GET/#api/v1/extraction/extraction-agentsr'   <   paramsheaderstimeout   ,    status_codebodyr    httpx_clientrequesturllibparseurljoinget_base_urlr	   get_headersr6   pydanticparse_obj_astypingListr   jsonr
   r   r   r   textr"   r'   	_response_response_jsons       r#   list_extraction_agentsz)LlamaExtractClient.list_extraction_agents+   s0    ((55==LL  D$8$8$E$E$G#H!JLqr(,
)CD((446 > 
	 )''-#-((\)BINNDTUU  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   E   +E+Nr'   organization_idrL   namedata_schemaconfigc                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        |||d      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      # t"        $ r" t%        |j                  |j&                        w xY w)a5  
        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: str. The name of the extraction schema

            - data_schema: ExtractAgentCreateDataSchema. The schema of the data.

            - config: ExtractConfig. The configuration parameters for the extraction agent.
        ---
        from llama_cloud import ExtractConfig, ExtractMode, ExtractTarget
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.create_extraction_agent(
            name="string",
            config=ExtractConfig(
                extraction_target=ExtractTarget.PER_DOC,
                extraction_mode=ExtractMode.FAST,
            ),
        )
        POSTr+   r,   rK   rM   rN   rO   r-   r/   rD   r0   r1   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r	   r   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   r'   rL   rM   rN   rO   rG   rH   s           r#   create_extraction_agentz*LlamaExtractClient.create_extraction_agentJ   s9   F ((55==LL  D$8$8$E$E$G#H!JLqr(
Wf)gh!4W]"^_((446 > 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D> >+E)c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Validates an extraction agent's schema definition.
        Returns the normalized and validated schema if valid, otherwise raises an HTTP 400.

        Parameters:
            - data_schema: ExtractSchemaValidateRequestDataSchema.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.validate_extraction_schema()
        rQ   r+   5api/v1/extraction/extraction-agents/schema/validationrN   r-   rD   r0   r1   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   rN   rG   rH   s       r#   validate_extraction_schemaz-LlamaExtractClient.validate_extraction_schema   s-   " ((55==LL  ''4467q9;r "=+">?((446 > 
	 )''-#-(()F	HXYY  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D/ /+Er'   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        d|i      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)aM  
        Parameters:
            - name: str.

            - project_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_extraction_agent_by_name(
            name="string",
        )
        r*   r+   ,api/v1/extraction/extraction-agents/by-name/r'   r-   r.   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r	   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   rM   r'   rG   rH   s        r#   get_extraction_agent_by_namez/LlamaExtractClient.get_extraction_agent_by_name   s5     ((55==LL  ''4467q9=ijnio;p ),
)CD((446 > 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D2 2+Eextraction_agent_idc                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |	      # t        $ r" t!        |j                  |j"                  	      w xY w)
a2  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_extraction_agent(
            extraction_agent_id="string",
        )
        r*   r+   $api/v1/extraction/extraction-agents/r-   r0   r1   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   rc   rG   rH   s       r#   get_extraction_agentz'LlamaExtractClient.get_extraction_agent   s(    ((55==LL  ''4467q9=abuav;w ((446 > 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   ?D& &+Ec          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Parameters:
            - extraction_agent_id: str.

            - data_schema: ExtractAgentUpdateDataSchema. The schema of the data

            - config: ExtractConfig. The configuration parameters for the extraction agent.
        ---
        from llama_cloud import ExtractConfig, ExtractMode, ExtractTarget
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.update_extraction_agent(
            extraction_agent_id="string",
            config=ExtractConfig(
                extraction_target=ExtractTarget.PER_DOC,
                extraction_mode=ExtractMode.FAST,
            ),
        )
        PUTr+   re   rN   rO   r-   rY   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   rc   rN   rO   rG   rH   s         r#   update_extraction_agentz*LlamaExtractClient.update_extraction_agent   s5   2 ((55==LL  ''4467q9=abuav;w "+"PQ((446 > 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D3 3+Ec                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r5n n2t        j                  t        j                  |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |	      # t         $ r" t#        |j                  |j$                  	      w xY w)
a5  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.delete_extraction_agent(
            extraction_agent_id="string",
        )
        DELETEr+   re   r-   rf   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r?   r6   r@   rA   rB   AnyrD   r
   r   r   r   rE   rh   s       r#   delete_extraction_agentz*LlamaExtractClient.delete_extraction_agent  s,    ((55==LL  ''4467q9=abuav;w ((446 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   	D0 0+Ec                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d      }d|j                  cxk  rdk  r<n n9t        j                  t        j                  t           |j                               S |j                  d	k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |
      # t$        $ r" t'        |j                  |j(                  
      w xY w)a'  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.list_jobs(
            extraction_agent_id="string",
        )
        r*   r+   api/v1/extraction/jobsrc   r-   r.   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r	   r?   r6   r@   rA   rB   rC   r   rD   r
   r   r   r   rE   rh   s       r#   	list_jobszLlamaExtractClient.list_jobs2  s2    ((55==LL  D$8$8$E$E$G#H!JLde(*?AT)UV((446 > 
	 )''-#-((Z)@)..BRSS  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	SrJ   from_uir|   r:   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      t        |      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |
      # t"        $ r" t%        |j                  |j&                  
      w xY w)a  
        Parameters:
            - from_ui: typing.Optional[bool].

            - request: ExtractJobCreate.
        ---
        from llama_cloud import (
            ExtractConfig,
            ExtractJobCreate,
            ExtractMode,
            ExtractTarget,
        )
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.run_job(
            request=ExtractJobCreate(
                extraction_agent_id="string",
                file_id="string",
                config_override=ExtractConfig(
                    extraction_target=ExtractTarget.PER_DOC,
                    extraction_mode=ExtractMode.FAST,
                ),
            ),
        )
        rQ   r+   rx   r|   r-   rS   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r	   r   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   r|   r:   rG   rH   s        r#   run_jobzLlamaExtractClient.run_jobQ  s/   : ((55==LL  D$8$8$E$E$G#H!JLde()W)=>!'*((446 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D9 9+E$job_idc                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |	      # t        $ r" t!        |j                  |j"                  	      w xY w)
a  
        Parameters:
            - job_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_job(
            job_id="string",
        )
        r*   r+   api/v1/extraction/jobs/r-   rf   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   r   rG   rH   s       r#   get_jobzLlamaExtractClient.get_job  #    ((55==LL  D$8$8$E$E$G#H!JNeflemLno((446	 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srj   r|   extract_settings
job_creater   c                   d|i}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        d|i      t        |      | j                  j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a$  
        Parameters:
            - from_ui: typing.Optional[bool].

            - job_create: ExtractJobCreate.

            - extract_settings: typing.Optional[LlamaExtractSettings].
        ---
        from llama_cloud import (
            ChunkMode,
            ExtractConfig,
            ExtractJobCreate,
            ExtractMode,
            ExtractTarget,
            FailPageMode,
            LlamaExtractSettings,
            LlamaParseParameters,
            ParsingMode,
        )
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.run_job_test_user(
            job_create=ExtractJobCreate(
                extraction_agent_id="string",
                file_id="string",
                config_override=ExtractConfig(
                    extraction_target=ExtractTarget.PER_DOC,
                    extraction_mode=ExtractMode.FAST,
                ),
            ),
            extract_settings=LlamaExtractSettings(
                chunk_mode=ChunkMode.PAGE,
                llama_parse_params=LlamaParseParameters(
                    parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                    replace_failed_page_mode=FailPageMode.RAW_TEXT,
                ),
            ),
        )
        r   r   rQ   r+   api/v1/extraction/jobs/testr|   r-   rS   r2   r3   r4   r5   OMITr    r9   r:   r;   r<   r=   r>   r	   r   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   r|   r   r   _requestrG   rH   s          r#   run_job_test_userz$LlamaExtractClient.run_job_test_user  sM   b 3?
1K4'+;H'(((55==LL  D$8$8$E$E$G#H!JLij()W)=>!(+((446 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   #E
 
+E5r|   data_schema_overrideconfig_overridefiler   r   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      t        |||d      d|i| j                   j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      # t"        $ r" t%        |j                  |j&                        w xY w)  
        Parameters:
            - from_ui: typing.Optional[bool].

            - extraction_agent_id: str.

            - file: typing.IO.

            - data_schema_override: typing.Optional[str].

            - config_override: typing.Optional[str].
        rQ   r+   api/v1/extraction/jobs/filer|   rc   r   r   r   r-   r/   datafilesr0   r1   r2   r3   r4   r5   r~   r"   r|   rc   r   r   r   rG   rH   s           r#   run_job_on_filez"LlamaExtractClient.run_job_on_file  sF   * ((55==LL  D$8$8$E$E$G#H!JLij()W)=>!+>,@'6 4.((446 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	SrJ   file_idsc                .   ||d}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        d|i      t        |      | j                  j                         d	      }d
|j                  cxk  rdk  r<n n9t        j                  t        j                  t            |j#                               S |j                  dk(  r1t%        t        j                  t&        |j#                                     	 |j#                         }t+        |j                  |      # t(        $ r" t+        |j                  |j,                        w xY w)a  
        Parameters:
            - from_ui: typing.Optional[bool].

            - extraction_agent_id: str. The id of the extraction agent

            - file_ids: typing.List[str]. The ids of the files

            - data_schema_override: typing.Optional[ExtractJobCreateBatchDataSchemaOverride]. The data schema to override the extraction agent's data schema with

            - config_override: typing.Optional[ExtractConfig].
        ---
        from llama_cloud import ExtractConfig, ExtractMode, ExtractTarget
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.run_batch_jobs(
            extraction_agent_id="string",
            file_ids=[],
            config_override=ExtractConfig(
                extraction_target=ExtractTarget.PER_DOC,
                extraction_mode=ExtractMode.FAST,
            ),
        )
        rc   r   r   r   rQ   r+   api/v1/extraction/jobs/batchr|   r-   rS   r2   r3   r4   r5   r   r    r9   r:   r;   r<   r=   r>   r	   r   r?   r6   r@   rA   rB   rC   r   rD   r
   r   r   r   rE   	r"   r|   rc   r   r   r   r   rG   rH   s	            r#   run_batch_jobsz!LlamaExtractClient.run_batch_jobs  sl   H J]jr1st+/CH+,$&*9H&'((55==LL  D$8$8$E$E$G#H!JLjk()W)=>!(+((446 > 
	 )''-#-((Z)@)..BRSS  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   E) )+Fc           	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |
      # t        $ r" t!        |j                  |j"                  
      w xY w)a  
        Parameters:
            - job_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_job_result(
            job_id="string",
        )
        r*   r+   r   /resultr-   rf   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r   s       r#   get_job_resultz!LlamaExtractClient.get_job_resultM  s'    ((55==LL  D$8$8$E$E$G#H!JNeflemmtLuv((446	 > 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss    D' '+Eskiplimitr   r   c          
         | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Parameters:
            - extraction_agent_id: str.

            - skip: typing.Optional[int].

            - limit: typing.Optional[int].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.list_extract_runs(
            extraction_agent_id="string",
        )
        r*   r+   api/v1/extraction/runsrc   r   r   r-   r.   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r	   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r"   rc   r   r   rG   rH   s         r#   list_extract_runsz$LlamaExtractClient.list_extract_runsk  s-   ( ((55==LL  D$8$8$E$E$G#H!JLde(AT^bmr)st((446 > 
	 )''-#-(()Ey~~GWXX  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   
D1 1+Ec                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d      }d|j                  cxk  rdk  r<n n9t        j                  t        j                  t           |j                               S |j                  d	k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |
      # t$        $ r" t'        |j                  |j(                  
      w xY w)a4  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_latest_run_from_ui(
            extraction_agent_id="string",
        )
        r*   r+   %api/v1/extraction/runs/latest-from-uirc   r-   r.   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r	   r?   r6   r@   rA   rB   Optionalr   rD   r
   r   r   r   rE   rh   s       r#   get_latest_run_from_uiz)LlamaExtractClient.get_latest_run_from_ui  s2    ((55==LL  D$8$8$E$E$G#H!JLst(*?AT)UV((446 > 
	 )''-#-(()DinnFVWW  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	SrJ   c                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |	      # t        $ r" t!        |j                  |j"                  	      w xY w)
a  
        Parameters:
            - job_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_run_by_job_id(
            job_id="string",
        )
        r*   r+   api/v1/extraction/runs/by-job/r-   rf   r2   r3   r4   r5   r    r9   r:   r;   r<   r=   r>   r?   r6   r@   rA   r   rD   r
   r   r   r   rE   r   s       r#   get_run_by_job_idz$LlamaExtractClient.get_run_by_job_id  s#    ((55==LL  D$8$8$E$E$G#H!JNlmsltLuv((446	 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srj   run_idc                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |	      # t        $ r" t!        |j                  |j"                  	      w xY w)
a  
        Parameters:
            - run_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.get_run(
            run_id="string",
        )
        r*   r+   api/v1/extraction/runs/r-   rf   r2   r3   r4   r5   r   r"   r   rG   rH   s       r#   get_runzLlamaExtractClient.get_run  r   rj   c                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r5n n2t        j                  t        j                  |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |	      # t         $ r" t#        |j                  |j$                  	      w xY w)
a  
        Parameters:
            - run_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.llama_extract.delete_extraction_run(
            run_id="string",
        )
        rr   r+   r   r-   rf   r2   r3   r4   r5   rs   r   s       r#   delete_extraction_runz(LlamaExtractClient.delete_extraction_run  s'    ((55==LL  D$8$8$E$E$G#H!JNeflemLno((446	 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srv   ).__name__
__module____qualname__r   r$   strrB   rC   r   rI   r   r   r   rV   r   r   r\   rb   ri   r   rp   rt   ru   r   rz   boolr   r   r   r   r   r   IOr   r   r   r   r   intr   r   r   r   r   r   r    r&   r#   r   r   '   s   .*; .OC OFKK<U OD ,004	3O OOC(3O  -	3O
 3O 23O 3O 
3Oj"OD"O	&"OH ]a !O !OV__UXEY !Oeq !OFO O O@*O#&*O8T*O^k*O	*OXO3 O6:: O@O OJ8O O> ;? -O&//$"7 -OIY -O^h -O^Oc Oj OB *.BFDO &DO %	DO
 !//*>?DO 
DOR *. 6:04,O &,O !	,O
 ii,O %ooc2,O  -,O 
,Ob *. Z^:>9O &9O !	9O
 ++c"9O %oo.UV9O  79O 
Z	 9OvOS O-= O> IMlp#O&)#O171E#OU[UdUdehUi#O	%#OJOS OV__U_E` O>O O
 O<Oc Oj O<OC OFJJ Or&   r   c                      e Zd ZdefdZdedej                  e   fdZ	ddddej                  e   dej                  e   d	ed
ededefdZd
edefdZddd	edej                  e   defdZdedefdZded
ededefdZdedej*                  fdZdedej                  e   fdZdddej                  e   dedefdZdedefdZdeddej                  e   dedej                  e   defdZdddddej                  e   ded ej@                  d!ej                  e   d"ej                  e   defd#Z!deeddej                  e   ded$ej                  e   d!ej                  e"   d"ej                  e   dej                  e   fd%Z#dede$fd&Z%ddd'ded(ej                  e&   d)ej                  e&   de'fd*Z(dedej                  e)   fd+Z*dede)fd,Z+d-ede)fd.Z,d-edej*                  fd/Z-y)0AsyncLlamaExtractClientr   c                    || _         y r   r   r!   s     r#   r$   z AsyncLlamaExtractClient.__init__  r%   r&   r'   r(   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d       d{   }d|j                  cxk  rd	k  r<n n9t        j                  t        j                  t           |j                               S |j                  d
k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a2  
        Parameters:
            - project_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.list_extraction_agents(
            project_id="string",
        )
        r*   r+   r,   r'   r-   r.   Nr2   r3   r4   r5   r8   rF   s       r#   rI   z.AsyncLlamaExtractClient.list_extraction_agents  s>     ..;;CCLL  D$8$8$E$E$G#H!JLqr(,
)CD((446 D 
 
	 )''-#-((\)BINNDTUU  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	S+   B
E:E
BE:#E 3E:+E77E:NrK   rL   rM   rN   rO   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        |||d      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)aE  
        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: str. The name of the extraction schema

            - data_schema: ExtractAgentCreateDataSchema. The schema of the data.

            - config: ExtractConfig. The configuration parameters for the extraction agent.
        ---
        from llama_cloud import ExtractConfig, ExtractMode, ExtractTarget
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.create_extraction_agent(
            name="string",
            config=ExtractConfig(
                extraction_target=ExtractTarget.PER_DOC,
                extraction_mode=ExtractMode.FAST,
            ),
        )
        rQ   r+   r,   rK   rR   r-   rS   Nr2   r3   r4   r5   rT   rU   s           r#   rV   z/AsyncLlamaExtractClient.create_extraction_agent-  sG    F ..;;CCLL  D$8$8$E$E$G#H!JLqr(
Wf)gh!4W]"^_((446 D 
 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   BE8EBE8!E
 1E8
+E55E8c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Validates an extraction agent's schema definition.
        Returns the normalized and validated schema if valid, otherwise raises an HTTP 400.

        Parameters:
            - data_schema: ExtractSchemaValidateRequestDataSchema.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.validate_extraction_schema()
        rQ   r+   rX   rN   r-   rY   Nr2   r3   r4   r5   rZ   r[   s       r#   r\   z2AsyncLlamaExtractClient.validate_extraction_schemab  s;    " ..;;CCLL  ''4467q9;r "=+">?((446 D 
 
	 )''-#-(()F	HXYY  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Ss+   B
E)D9BE)D; "E);+E&&E)r]   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        d|i      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a]  
        Parameters:
            - name: str.

            - project_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_extraction_agent_by_name(
            name="string",
        )
        r*   r+   r_   r'   r-   r.   Nr2   r3   r4   r5   r`   ra   s        r#   rb   z4AsyncLlamaExtractClient.get_extraction_agent_by_name  sC      ..;;CCLL  ''4467q9=ijnio;p ),
)CD((446 D 
 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Ss+   BE,D<BE,D> %E,>+E))E,rc   c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |
      7 # t        $ r" t!        |j                  |j"                  
      w xY ww)aB  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_extraction_agent(
            extraction_agent_id="string",
        )
        r*   r+   re   r-   rf   Nr2   r3   r4   r5   rg   rh   s       r#   ri   z,AsyncLlamaExtractClient.get_extraction_agent  s6     ..;;CCLL  ''4467q9=abuav;w ((446 D 
 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	S+   BE D0BE 	D2 E 2+EE c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Parameters:
            - extraction_agent_id: str.

            - data_schema: ExtractAgentUpdateDataSchema. The schema of the data

            - config: ExtractConfig. The configuration parameters for the extraction agent.
        ---
        from llama_cloud import ExtractConfig, ExtractMode, ExtractTarget
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.update_extraction_agent(
            extraction_agent_id="string",
            config=ExtractConfig(
                extraction_target=ExtractTarget.PER_DOC,
                extraction_mode=ExtractMode.FAST,
            ),
        )
        rl   r+   re   rm   r-   rY   Nr2   r3   r4   r5   rn   ro   s         r#   rp   z/AsyncLlamaExtractClient.update_extraction_agent  sC    2 ..;;CCLL  ''4467q9=abuav;w "+"PQ((446 D 
 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Ss+   BE-D=BE-D? &E-?+E**E-c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r5n n2t        j                  t        j                  |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      7 # t         $ r" t#        |j                  |j$                  
      w xY ww)aE  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.delete_extraction_agent(
            extraction_agent_id="string",
        )
        rr   r+   re   r-   rf   Nr2   r3   r4   r5   rs   rh   s       r#   ru   z/AsyncLlamaExtractClient.delete_extraction_agent  s:     ..;;CCLL  ''4467q9=abuav;w ((446 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	S+   BE*D:BE*D< #E*<+E''E*c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d       d{   }d|j                  cxk  rd	k  r<n n9t        j                  t        j                  t           |j                               S |j                  d
k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a7  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.list_jobs(
            extraction_agent_id="string",
        )
        r*   r+   rx   rc   r-   r.   Nr2   r3   r4   r5   ry   rh   s       r#   rz   z!AsyncLlamaExtractClient.list_jobs  s@     ..;;CCLL  D$8$8$E$E$G#H!JLde(*?AT)UV((446 D 
 
	 )''-#-((Z)@)..BRSS  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr   r{   r|   r:   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      t        |      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a  
        Parameters:
            - from_ui: typing.Optional[bool].

            - request: ExtractJobCreate.
        ---
        from llama_cloud import (
            ExtractConfig,
            ExtractJobCreate,
            ExtractMode,
            ExtractTarget,
        )
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.run_job(
            request=ExtractJobCreate(
                extraction_agent_id="string",
                file_id="string",
                config_override=ExtractConfig(
                    extraction_target=ExtractTarget.PER_DOC,
                    extraction_mode=ExtractMode.FAST,
                ),
            ),
        )
        rQ   r+   rx   r|   r-   rS   Nr2   r3   r4   r5   r~   r   s        r#   r   zAsyncLlamaExtractClient.run_job4  s=    : ..;;CCLL  D$8$8$E$E$G#H!JLde()W)=>!'*((446 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   BE3EBE3E ,E3+E00E3r   c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |
      7 # t        $ r" t!        |j                  |j"                  
      w xY ww)a  
        Parameters:
            - job_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_job(
            job_id="string",
        )
        r*   r+   r   r-   rf   Nr2   r3   r4   r5   r   r   s       r#   r   zAsyncLlamaExtractClient.get_jobc  1     ..;;CCLL  D$8$8$E$E$G#H!JNeflemLno((446	 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr   r   r   r   c                  K   d|i}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        d|i      t        |      | j                  j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a4  
        Parameters:
            - from_ui: typing.Optional[bool].

            - job_create: ExtractJobCreate.

            - extract_settings: typing.Optional[LlamaExtractSettings].
        ---
        from llama_cloud import (
            ChunkMode,
            ExtractConfig,
            ExtractJobCreate,
            ExtractMode,
            ExtractTarget,
            FailPageMode,
            LlamaExtractSettings,
            LlamaParseParameters,
            ParsingMode,
        )
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.run_job_test_user(
            job_create=ExtractJobCreate(
                extraction_agent_id="string",
                file_id="string",
                config_override=ExtractConfig(
                    extraction_target=ExtractTarget.PER_DOC,
                    extraction_mode=ExtractMode.FAST,
                ),
            ),
            extract_settings=LlamaExtractSettings(
                chunk_mode=ChunkMode.PAGE,
                llama_parse_params=LlamaParseParameters(
                    parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                    replace_failed_page_mode=FailPageMode.RAW_TEXT,
                ),
            ),
        )
        r   r   rQ   r+   r   r|   r-   rS   Nr2   r3   r4   r5   r   r   s          r#   r   z)AsyncLlamaExtractClient.run_job_test_user  s[    b 3?
1K4'+;H'(..;;CCLL  D$8$8$E$E$G#H!JLij()W)=>!(+((446 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   B%F'E(BF-E =F+FFr   r   r   r   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      t        |||d      d|i| j                   j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)r   rQ   r+   r   r|   r   r   r-   r   Nr2   r3   r4   r5   r~   r   s           r#   r   z'AsyncLlamaExtractClient.run_job_on_file  sT    * ..;;CCLL  D$8$8$E$E$G#H!JLij()W)=>!+>,@'6 4.((446 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN/
*  	Sy'<'<9>>RR	Ss+   BE:E
BE:#E 3E:+E77E:r   c                J  K   ||d}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        d|i      t        |      | j                  j                         d	       d
{   }d|j                  cxk  rdk  r<n n9t        j                  t        j                  t            |j#                               S |j                  dk(  r1t%        t        j                  t&        |j#                                     	 |j#                         }t+        |j                  |      7 # t(        $ r" t+        |j                  |j,                        w xY ww)a  
        Parameters:
            - from_ui: typing.Optional[bool].

            - extraction_agent_id: str. The id of the extraction agent

            - file_ids: typing.List[str]. The ids of the files

            - data_schema_override: typing.Optional[ExtractJobCreateBatchDataSchemaOverride]. The data schema to override the extraction agent's data schema with

            - config_override: typing.Optional[ExtractConfig].
        ---
        from llama_cloud import ExtractConfig, ExtractMode, ExtractTarget
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.run_batch_jobs(
            extraction_agent_id="string",
            file_ids=[],
            config_override=ExtractConfig(
                extraction_target=ExtractTarget.PER_DOC,
                extraction_mode=ExtractMode.FAST,
            ),
        )
        r   r   r   rQ   r+   r   r|   r-   rS   Nr2   r3   r4   r5   r   r   s	            r#   r   z&AsyncLlamaExtractClient.run_batch_jobs  sz    H J]jr1st+/CH+,$&*9H&'..;;CCLL  D$8$8$E$E$G#H!JLjk()W)=>!(+((446 D 
 
	 )''-#-((Z)@)..BRSS  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   B3F#5E36BF#E5 F#5+F  F#c           	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)a"  
        Parameters:
            - job_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_job_result(
            job_id="string",
        )
        r*   r+   r   r   r-   rf   Nr2   r3   r4   r5   r   r   s       r#   r   z&AsyncLlamaExtractClient.get_job_result0  s5     ..;;CCLL  D$8$8$E$E$G#H!JNeflemmtLuv((446	 D 
 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Ss+   BE!D1BE!
D3 E!3+EE!r   r   r   c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Parameters:
            - extraction_agent_id: str.

            - skip: typing.Optional[int].

            - limit: typing.Optional[int].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.list_extract_runs(
            extraction_agent_id="string",
        )
        r*   r+   r   r   r-   r.   Nr2   r3   r4   r5   r   r   s         r#   r   z)AsyncLlamaExtractClient.list_extract_runsN  s;    ( ..;;CCLL  D$8$8$E$E$G#H!JLde(AT^bmr)st((446 D 
 
	 )''-#-(()Ey~~GWXX  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Ss+   BE+D;BE+D= $E+=+E((E+c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        d|i      | j                   j                         d       d{   }d|j                  cxk  rd	k  r<n n9t        j                  t        j                  t           |j                               S |j                  d
k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)aD  
        Parameters:
            - extraction_agent_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_latest_run_from_ui(
            extraction_agent_id="string",
        )
        r*   r+   r   rc   r-   r.   Nr2   r3   r4   r5   r   rh   s       r#   r   z.AsyncLlamaExtractClient.get_latest_run_from_uis  s@     ..;;CCLL  D$8$8$E$E$G#H!JLst(*?AT)UV((446 D 
 
	 )''-#-(()DinnFVWW  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr   c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |
      7 # t        $ r" t!        |j                  |j"                  
      w xY ww)a%  
        Parameters:
            - job_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_run_by_job_id(
            job_id="string",
        )
        r*   r+   r   r-   rf   Nr2   r3   r4   r5   r   r   s       r#   r   z)AsyncLlamaExtractClient.get_run_by_job_id  s1     ..;;CCLL  D$8$8$E$E$G#H!JNlmsltLuv((446	 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr   r   c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |
      7 # t        $ r" t!        |j                  |j"                  
      w xY ww)a  
        Parameters:
            - run_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.get_run(
            run_id="string",
        )
        r*   r+   r   r-   rf   Nr2   r3   r4   r5   r   r   s       r#   r   zAsyncLlamaExtractClient.get_run  r   r   c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r5n n2t        j                  t        j                  |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      7 # t         $ r" t#        |j                  |j$                  
      w xY ww)a)  
        Parameters:
            - run_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.llama_extract.delete_extraction_run(
            run_id="string",
        )
        rr   r+   r   r-   rf   Nr2   r3   r4   r5   rs   r   s       r#   r   z-AsyncLlamaExtractClient.delete_extraction_run  s5     ..;;CCLL  D$8$8$E$E$G#H!JNeflemLno((446	 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr   ).r   r   r   r   r$   r   rB   rC   r   rI   r   r   r   rV   r   r   r\   rb   ri   r   rp   rt   ru   r   rz   r   r   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   .*< .O# O&++lB[ OD ,004	3O OOC(3O  -	3O
 3O 23O 3O 
3Oj"OD"O	&"OH cg !Os !O6??[^K_ !Okw !OFOc Ol O@*O#&*O8T*O^k*O	*OXO O O@Oc Ofkk*>U O> AE -O(= -OO_ -Odn -O^OC OJ OB *.BFDO &DO %	DO
 !//*>?DO 
DOR *. 6:04,O &,O !	,O
 ii,O %ooc2,O  -,O 
,Ob *. Z^:>9O &9O !	9O
 ++c"9O %oo.UV9O  79O 
Z	 9OvO3 O3C O> IMlp#O&)#O171E#OU[UdUdehUi#O	%#OJO3 O6??[eKf O>Oc Oj O<OC OJ O<O# O&** Or&   r   )7rB   urllib.parser;   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.jsonable_encoderr   core.remove_none_from_dictr	   !errors.unprocessable_entity_errorr
   types.extract_agentr   types.extract_configr   types.extract_jobr   types.extract_job_creater   types.extract_resultsetr   types.extract_runr   &types.extract_schema_validate_responser   types.http_validation_errorr   types.llama_extract_settingsr   %types.paginated_extract_runs_responser   &types.extract_agent_create_data_schemar   &types.extract_agent_update_data_schemar   3types.extract_job_create_batch_data_schema_overrider   1types.extract_schema_validate_request_data_schemar   r@   __version__
startswithImportErrorpydantic.v1v1castrt   r   r   r   r   r&   r#   <module>r      s      ( & H 5 ? I / 1 + 8 7 + S > @ Q P P h e&&t,"
 v{{6::s#`O `OF`O `OU  s   'C 	C)(C)