
    >'h                        d dl Z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,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)serialize_datetime)jsonable_encoder)remove_none_from_dict)UnprocessableEntityError)EditSuggestion)HttpValidationError)&LlamaIndexCoreBaseLlmsTypesChatMessage)PaginatedReportResponse)Report)ReportCreateResponse)ReportEventItem)ReportMetadata)
ReportPlan)ReportResponse)ReportState   ):UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestActionz1..c                      e Zd ZdefdZddeeeddej                  e   dej                  e   deded	ej                  e   d
ej                  e   dej                  e   dej                  e   de
fdZdddddddej                  e   dej                  e   dej                  e   dej                  e   dej                  e   defdZdddddedej                  e   dej                  e   dej                  e   def
dZddddedej                  e   dej                  e   dedef
dZdddddedej                  e   dej                  e   dej                  e   dej*                  f
dZddddedej                  e   dej                  e   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ddd ded!edej                  e   dej                  e   d"ej                  e   defd#Zdddd$ded%ej                  ej<                     dej                  e   dej                  e   dej                  e   f
d&Z ddddedej                  e   dej                  e   defd'Z!ddddedej                  e   dej                  e   d(ed)ej                  e"   dej                  e#   fd*Z$ddddedej                  e   dej                  e   dej*                  fd+Z%y),ReportsClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     k/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/llama_cloud/resources/reports/client.py__init__zReportsClient.__init__*   
    -    N
project_idorganization_idtemplate_instructionsexisting_retriever_idtemplate_filer'   r(   nametemplate_textr)   r*   filesr+   returnc          	      *   |||d}	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      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)  
        Create a new report.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: str.

            - template_text: str.

            - template_instructions: typing.Optional[str].

            - existing_retriever_id: typing.Optional[str].

            - files: typing.List[str].

            - template_file: typing.Optional[str].
        r,   r-   r.   r)   r*   r+   POST/api/v1/reportsr'   r(   <   paramsjsonheaderstimeout   ,    status_codebodyOMITr   httpx_clientrequesturllibparseurljoinget_base_urlr
   r	   get_headersrA   pydanticparse_obj_asr   r:   r   r   r   r   textr!   r'   r(   r,   r-   r)   r*   r.   r+   _request	_response_response_jsons               r"   "create_report_api_v_1_reports_postz0ReportsClient.create_report_api_v_1_reports_post-   sx   @ ;?Q^in1o ,0EH,- ,0EH,-$(5H_%((55==LL  D$8$8$E$E$G#H!JL\](
Wf)gh!(+((446 > 
	 )''-#-(()=y~~?OPP  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss    E' '+Fstatelimitoffsetr'   r(   rU   rV   rW   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)aA  
        List all reports for a project.

        Parameters:
            - state: typing.Optional[ReportState].

            - limit: typing.Optional[int].

            - offset: typing.Optional[int].

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.list_reports(
            state=ReportState.PENDING,
        )
        GETr4   api/v1/reports/listrT   r7   r9   r;   r<   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   rK   rA   rL   rM   r   r:   r   r   r   r   rN   r!   rU   rV   rW   r'   r(   rQ   rR   s           r"   list_reportszReportsClient.list_reportsf   s:   B ((55==LL  D$8$8$E$E$G#H!JLab(""$",'6 ((446 > 
	 )''-#-(()@)..BRSS  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D3 3+Eversionr'   r(   	report_idr`   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  
        Get a specific report.

        Parameters:
            - report_id: str.

            - version: typing.Optional[int].

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.get_report(
            report_id="string",
        )
        rY   r4   api/v1/reports/r_   r7   r[   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   rK   rA   rL   rM   r   r:   r   r   r   r   rN   r!   ra   r`   r'   r(   rQ   rR   s          r"   
get_reportzReportsClient.get_report   s7   : ((55==LL  D$8$8$E$E$G#H!Jo^g]hLij(#:Rab ((446 > 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   D4 4+Er6   c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||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  
        Update metadata for a report.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: str. The name of the report
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.update_report_metadata(
            report_id="string",
            name="string",
        )
        r3   r4   rc   r6   r,   r7   r8   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   r	   rK   rA   rL   rM   r   r:   r   r   r   r   rN   r!   ra   r'   r(   r,   rQ   rR   s          r"   update_report_metadataz$ReportsClient.update_report_metadata   s<   < ((55==LL  D$8$8$E$E$G#H!Jo^g]hLij(
Wf)gh!64.1((446 > 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   D? ?+E*cascade_deleter'   r(   rn   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  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  
        Delete a report.

        Parameters:
            - report_id: str.

            - cascade_delete: typing.Optional[bool]. Whether to delete associated retriever and pipeline data

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.delete_report(
            report_id="string",
        )
        DELETEr4   rc   rm   r7   r[   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   rK   rA   rL   rM   typingAnyr:   r   r   r   r   rN   r!   ra   rn   r'   r(   rQ   rR   s          r"   delete_reportzReportsClient.delete_report   s;   : ((55==LL  D$8$8$E$E$G#H!Jo^g]hLij(#1`op ((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   D> >+E)contentc          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||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  
        Update a report's content.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - content: Report. The content of the report version
        ---
        from llama_cloud import Report
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.update_report(
            report_id="string",
            content=Report(
                id="string",
            ),
        )
        PATCHr4   rc   r6   rw   r7   r8   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   r	   rK   rA   rL   rM   r   r:   r   r   r   r   rN   r!   ra   r'   r(   rw   rQ   rR   s          r"   update_reportzReportsClient.update_report0  s>   B ((55==LL  D$8$8$E$E$G#H!Jo^g]hLij(
Wf)gh!9g"67((446 > 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srl   c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          d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  
        Get the plan for a report.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.get_report_plan(
            report_id="string",
        )
        rY   r4   rc   /planr6   r7   r[   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   rK   rA   rL   rM   r   r:   r   r   r   r   rN   r!   ra   r'   r(   rQ   rR   s         r"   get_report_planzReportsClient.get_report_planc  s3   , ((55==LL  D$8$8$E$E$G#H!Jo^g]hhmLno(
Wf)gh((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rg   r'   r(   rF   actionrF   c          
         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |||d      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\  
        Update the plan of a report, including approval, rejection, and editing.

        Parameters:
            - report_id: str.

            - action: UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - request: typing.Optional[ReportPlan].
        ---
        from llama_cloud import (
            ReportPlan,
            UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction,
        )
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.update_report_plan(
            report_id="string",
            action=UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.APPROVE,
            request=ReportPlan(),
        )
        ry   r4   rc   r~   r   r'   r(   r7   r8   r=   r>   r?   r@   rz   r!   ra   r   r'   r(   rF   rQ   rR   s           r"   update_report_planz ReportsClient.update_report_plan  sC   L ((55==LL  D$8$8$E$E$G#H!Jo^g]hhmLno(!P_` "'*((446 > 	
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srl   afterr'   r(   r   c          
         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |t        |      nd||d      | 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  
        Get all historical events for a report.

        Parameters:
            - report_id: str.

            - after: typing.Optional[dt.datetime].

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.get_report_events(
            report_id="string",
        )
        rY   r4   rc   /eventsNr   r7   r[   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   r   rK   rA   rL   rM   rr   Listr   r:   r   r   r   r   rN   r!   ra   r   r'   r(   rQ   rR   s          r"   get_report_eventszReportsClient.get_report_events  sT   : ((55==LL  D$8$8$E$E$G#H!Jo^g]hhoLpq(:?:K/6QU",'6 ((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   ,E +E>c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          d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  
        Get metadata for a report.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.get_report_metadata(
            report_id="string",
        )
        rY   r4   rc   	/metadatar6   r7   r[   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   rK   rA   rL   rM   r   r:   r   r   r   r   rN   r   s         r"   get_report_metadataz!ReportsClient.get_report_metadata  s3   , ((55==LL  D$8$8$E$E$G#H!Jo^g]hhqLrs(
Wf)gh((446 > 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srg   
user_querychat_historyc          
          | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||d      t        ||d      | 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)az  
        Suggest edits to a report based on user query and chat history.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - user_query: str.

            - chat_history: typing.List[LlamaIndexCoreBaseLlmsTypesChatMessage].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.suggest_edits_endpoint(
            report_id="string",
            user_query="string",
            chat_history=[],
        )
        r3   r4   rc   /suggest_editsr6   r   r   r7   r8   r=   r>   r?   r@   r   rE   rF   rG   rH   rI   rJ   r
   r	   rK   rA   rL   rM   rr   r   r   r:   r   r   r   r   rN   r!   ra   r'   r(   r   r   rQ   rR   s           r"   suggest_edits_endpointz$ReportsClient.suggest_edits_endpoint  sM   D ((55==LL  ''4467q9_YKWe;f )
Wf)gh!\"Z[((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s   +E +E=c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||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  
        Restart a report from scratch.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

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

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.reports.restart_report(
            report_id="string",
        )
        r3   r4   rc   /restartr6   r7   r[   r=   r>   r?   r@   rq   r   s         r"   restart_reportzReportsClient.restart_reportU  s7   , ((55==LL  D$8$8$E$E$G#H!Jo^g]hhpLqr(
Wf)gh((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#   rD   rr   Optionalstrr   r   rS   r   intr   r^   r   rf   r   rk   boolrs   ru   r   r|   r   r   r   r   dtdatetimer   r   r   r   r   r   r    r%   r"   r   r   )   s   .*; . ,004 7;6:.27O OOC(7O  -	7O
 7O 7O  &s37O  &s37O {{37O s+7O 
7Ox /3&*'++/048O {+8O s#	8O
 $8O OOC(8O  -8O 
!8O| )-+/04.O.O %	.O
 OOC(.O  -.O 
.Oh ,004.O.O OOC(	.O
  -.O .O 
.Oh 15+/04.O.O -	.O
 OOC(.O  -.O 
.Oh ,0041O1O OOC(	1O
  -1O 1O 
1Oh EIrv%O%O-3__S-A%O[a[j[jkn[o%O	%OX ,004/38O8O K	8O
 OOC(8O  -8O ,8O 
8O| /3+/042O2O r{{+	2O
 OOC(2O  -2O 
_	%2Oj EIrv%O%O-3__S-A%O[a[j[jkn[o%O	%OV ,0044O4O OOC(	4O
  -4O 4O kk"HI4O 
^	$4On EIrv%O%O-3__S-A%O[a[j[jkn[o%O	%Or%   r   c                      e Zd ZdefdZddeeeddej                  e   dej                  e   deded	ej                  e   d
ej                  e   dej                  e   dej                  e   de
fdZdddddddej                  e   dej                  e   dej                  e   dej                  e   dej                  e   defdZdddddedej                  e   dej                  e   dej                  e   def
dZddddedej                  e   dej                  e   dedef
dZdddddedej                  e   dej                  e   dej                  e   dej*                  f
dZddddedej                  e   dej                  e   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ddd ded!edej                  e   dej                  e   d"ej                  e   defd#Zdddd$ded%ej                  ej<                     dej                  e   dej                  e   dej                  e   f
d&Z ddddedej                  e   dej                  e   defd'Z!ddddedej                  e   dej                  e   d(ed)ej                  e"   dej                  e#   fd*Z$ddddedej                  e   dej                  e   dej*                  fd+Z%y),AsyncReportsClientr   c                    || _         y r   r   r    s     r"   r#   zAsyncReportsClient.__init__~  r$   r%   Nr&   r'   r(   r,   r-   r)   r*   r.   r+   r/   c          	      F  K   |||d}	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      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)r1   r2   r)   r*   r+   r3   r4   r5   r6   r7   r8   Nr=   r>   r?   r@   rC   rO   s               r"   rS   z5AsyncReportsClient.create_report_api_v_1_reports_post  s    @ ;?Q^in1o ,0EH,- ,0EH,-$(5H_%..;;CCLL  D$8$8$E$E$G#H!JL\](
Wf)gh!(+((446 D 
 
	 )''-#-(()=y~~?OPP  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   CF!E1BF!
E3 F!3+FF!rT   rU   rV   rW   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)aQ  
        List all reports for a project.

        Parameters:
            - state: typing.Optional[ReportState].

            - limit: typing.Optional[int].

            - offset: typing.Optional[int].

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.list_reports(
            state=ReportState.PENDING,
        )
        rY   r4   rZ   rT   r7   r[   Nr=   r>   r?   r@   r\   r]   s           r"   r^   zAsyncReportsClient.list_reports  sH    B ..;;CCLL  D$8$8$E$E$G#H!JLab(""$",'6 ((446 D 
 
	 )''-#-(()@)..BRSS  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-r_   ra   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  
        Get a specific report.

        Parameters:
            - report_id: str.

            - version: typing.Optional[int].

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.get_report(
            report_id="string",
        )
        rY   r4   rc   r_   r7   r[   Nr=   r>   r?   r@   rd   re   s          r"   rf   zAsyncReportsClient.get_report  sE    : ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hLij(#:Rab ((446 D 
 
	 )''-#-((9IJJ  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.E  'E. +E++E.r6   c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||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  
        Update metadata for a report.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: str. The name of the report
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.update_report_metadata(
            report_id="string",
            name="string",
        )
        r3   r4   rc   r6   r,   r7   r8   Nr=   r>   r?   r@   ri   rj   s          r"   rk   z)AsyncReportsClient.update_report_metadata$  sJ    < ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hLij(
Wf)gh!64.1((446 D 
 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	S+   BE9E	BE9"E 2E9+E66E9rm   rn   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  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  
        Delete a report.

        Parameters:
            - report_id: str.

            - cascade_delete: typing.Optional[bool]. Whether to delete associated retriever and pipeline data

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.delete_report(
            report_id="string",
        )
        rp   r4   rc   rm   r7   r[   Nr=   r>   r?   r@   rq   rt   s          r"   ru   z AsyncReportsClient.delete_reportT  sI    : ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hLij(#1`op ((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E8EBE8!E
 1E8
+E55E8rw   c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||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]  
        Update a report's content.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - content: Report. The content of the report version
        ---
        from llama_cloud import Report
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.update_report(
            report_id="string",
            content=Report(
                id="string",
            ),
        )
        ry   r4   rc   r6   rw   r7   r8   Nr=   r>   r?   r@   rz   r{   s          r"   r|   z AsyncReportsClient.update_report  sL    B ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hLij(
Wf)gh!9g"67((446 D 
 
	 )''-#-((9IJJ  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| 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  
        Get the plan for a report.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.get_report_plan(
            report_id="string",
        )
        rY   r4   rc   r~   r6   r7   r[   Nr=   r>   r?   r@   r   r   s         r"   r   z"AsyncReportsClient.get_report_plan  sA    , ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hhmLno(
Wf)gh((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   rF   c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |||d      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)al  
        Update the plan of a report, including approval, rejection, and editing.

        Parameters:
            - report_id: str.

            - action: UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - request: typing.Optional[ReportPlan].
        ---
        from llama_cloud import (
            ReportPlan,
            UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction,
        )
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.update_report_plan(
            report_id="string",
            action=UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.APPROVE,
            request=ReportPlan(),
        )
        ry   r4   rc   r~   r   r7   r8   Nr=   r>   r?   r@   rz   r   s           r"   r   z%AsyncReportsClient.update_report_plan  sQ    L ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hhmLno(!P_` "'*((446 D 	
 	
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Sr   r   r   c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |t        |      nd||d      | 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  
        Get all historical events for a report.

        Parameters:
            - report_id: str.

            - after: typing.Optional[dt.datetime].

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.get_report_events(
            report_id="string",
        )
        rY   r4   rc   r   Nr   r7   r[   r=   r>   r?   r@   r   r   s          r"   r   z$AsyncReportsClient.get_report_events  sb    : ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hhoLpq(:?:K/6QU",'6 ((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FE BF6E F+F

Fc          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          d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  
        Get metadata for a report.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.get_report_metadata(
            report_id="string",
        )
        rY   r4   rc   r   r6   r7   r[   Nr=   r>   r?   r@   r   r   s         r"   r   z&AsyncReportsClient.get_report_metadataL  sA    , ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hhqLrs(
Wf)gh((446 D 
 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr   r   r   c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||d      t        ||d      | 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  
        Suggest edits to a report based on user query and chat history.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - user_query: str.

            - chat_history: typing.List[LlamaIndexCoreBaseLlmsTypesChatMessage].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.suggest_edits_endpoint(
            report_id="string",
            user_query="string",
            chat_history=[],
        )
        r3   r4   rc   r   r6   r   r7   r8   Nr=   r>   r?   r@   r   r   s           r"   r   z)AsyncReportsClient.suggest_edits_endpoints  s[    D ..;;CCLL  ''4467q9_YKWe;f )
Wf)gh!\"Z[((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s+   BFEBF5E F+F		Fc          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||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  
        Restart a report from scratch.

        Parameters:
            - report_id: str.

            - project_id: typing.Optional[str].

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

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.reports.restart_report(
            report_id="string",
        )
        r3   r4   rc   r   r6   r7   r[   Nr=   r>   r?   r@   rq   r   s         r"   r   z!AsyncReportsClient.restart_report  sE    , ..;;CCLL  D$8$8$E$E$G#H!Jo^g]hhpLqr(
Wf)gh((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#   rD   rr   r   r   r   r   rS   r   r   r   r^   r   rf   r   rk   r   rs   ru   r   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r"   r   r   }  s   .*< . ,004 7;6:.27O OOC(7O  -	7O
 7O 7O  &s37O  &s37O {{37O s+7O 
7Ox /3&*'++/048O {+8O s#	8O
 $8O OOC(8O  -8O 
!8O| )-+/04.O.O %	.O
 OOC(.O  -.O 
.Oh ,004.O.O OOC(	.O
  -.O .O 
.Oh 15+/04.O.O -	.O
 OOC(.O  -.O 
.Oh ,0041O1O OOC(	1O
  -1O 1O 
1Oh EIrv%O%O-3__S-A%O[a[j[jkn[o%O	%OX ,004/38O8O K	8O
 OOC(8O  -8O ,8O 
8O| /3+/042O2O r{{+	2O
 OOC(2O  -2O 
_	%2Oj EIrv%O%O-3__S-A%O[a[j[jkn[o%O	%OV ,0044O4O OOC(	4O
  -4O 4O kk"HI4O 
^	$4On EIrv%O%O-3__S-A%O[a[j[jkn[o%O	%Or%   r   )7r   r   rr   urllib.parserG   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.datetime_utilsr   core.jsonable_encoderr	   core.remove_none_from_dictr
   !errors.unprocessable_entity_errorr   types.edit_suggestionr   types.http_validation_errorr   3types.llama_index_core_base_llms_types_chat_messager   types.paginated_report_responser   types.reportr   types.report_create_responser   types.report_event_itemr   types.report_metadatar   types.report_planr   types.report_responser   types.report_stater   Ltypes.update_report_plan_api_v_1_reports_report_id_plan_patch_request_actionr   rL   __version__
startswithImportErrorpydantic.v1v1castrs   rD   r   r   r   r%   r"   <module>r      s       ( & H 5 5 ? I 3 > i F " @ 6 3 + 3 -&&t,"
 v{{6::s#Q	O Q	OhQ	O Q	Ow  s   'C 	C'&C'