§
    šŠtj¦ƒ  ã                  ó¢   — d Z ddlmZ ddlZddlmZmZmZmZm	Z	 ddl
Z
ddlmZ ddlmZmZmZ erddlmZ ddlmZ dd„Z G d„ de¦  «        ZdS )zUtil that calls GitHub.é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚDictÚListÚOptional)Úget_from_dict_or_env)Ú	BaseModelÚ
ConfigDictÚmodel_validator)ÚIssue)ÚPullRequestÚreturnr   c                 óL   — 	 ddl } n# t          $ r t          d¦  «        ‚w xY w| S )zImport tiktoken.r   NzHtiktoken is not installed. Please install it with `pip install tiktoken`)ÚtiktokenÚImportError)r   s    úb/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langchain_community/utilities/github.pyÚ_import_tiktokenr      sI   € ð
ØˆˆˆˆøÝð 
ð 
ð 
ÝØVñ
ô 
ð 	
ð
øøøð €Os   ‚ ‡!c                  ó¢  — e Zd ZU dZdZded<   dZded<   dZded<   dZded<   dZ	ded	<   dZ
ded
<   dZded<    ed¬¦  «        Z ed¬¦  «        edFd„¦   «         ¦   «         ZdGd„ZdHd„ZdId„ZdId„ZdId„ZdJd „ZdId!„ZdKd#„ZdId$„ZdLd&„ZdMd(„ZdNd,„ZdOd/„ZdPd0„ZdQd2„ZdRd4„Z dSd6„Z!dTd8„Z"dSd9„Z#dTd:„Z$dUd<„Z%dUd=„Z&dVd?„Z'dId@„Z(dIdA„Z)dWdC„Z*dXdE„Z+dS )YÚGitHubAPIWrapperzWrapper for GitHub API.Nr   ÚgithubÚgithub_repo_instancezOptional[str]Úgithub_repositoryÚgithub_app_idÚgithub_app_private_keyÚactive_branchÚgithub_base_branchÚforbid)ÚextraÚbefore)ÚmodeÚvaluesr   r   c                óJ  — t          |dd¦  «        }t          |dd¦  «        }t          |dd¦  «        }	 ddlm}m} n# t          $ r t	          d	¦  «        ‚w xY w	 t          |d
¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   n# t          $ r |}Y nw xY w|                     ||¦  «        }	 ||	¬¦  «        }
|
 	                    ¦   «         }|st          d|› d|› d�¦  «        ‚	 |d         }n$# t          $ r}t          d|› �¦  «        ‚d}~ww xY w|                     ¦   «         }|                     |¦  «        }t          |dd|j        ¬¦  «        }t          |dd|j        ¬¦  «        }||d<   ||d<   ||d<   ||d<   ||d<   ||d<   ||d<   |S )z?Validate that api key and python package exists in environment.r   ÚGITHUB_REPOSITORYr   ÚGITHUB_APP_IDr   ÚGITHUB_APP_PRIVATE_KEYr   )ÚAuthÚGithubIntegrationzHPyGithub is not installed. Please install it with `pip install PyGithub`ÚrN)Úauthz;Please make sure to install the created github app with id z on the repo: zrMore instructions can be found at https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-appzBPlease make sure to give correct github parameters Error message: r   ÚGITHUB_BASE_BRANCH)Údefaultr   ÚACTIVE_BRANCHr   r   )r	   r   r'   r(   r   ÚopenÚreadÚ	ExceptionÚAppAuthÚget_installationsÚ
ValueErrorÚget_github_for_installationÚget_repoÚdefault_branch)Úclsr"   r   r   r   r'   r(   ÚfÚprivate_keyr*   ÚgiÚinstallationÚeÚgÚrepor   r   s                    r   Úvalidate_environmentz%GitHubAPIWrapper.validate_environment+   sÃ  € õ 1ØÐ'Ð)<ñ
ô 
Ðõ -¨V°_ÀoÑVÔVˆå!5ØÐ,Ð.Fñ"
ô "
Ðð	Ø6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6øåð 	ð 	ð 	Ýð@ñô ð ð	øøøð	1õ Ð,¨cÑ2Ô2ð '°aØŸfšf™hœh�ð'ð 'ð 'ñ 'ô 'ð 'ð 'ð 'ð 'ð 'ð 'øøøð 'ð 'ð 'ð 'øøåð 	1ð 	1ð 	1Ø0ˆKˆKˆKð	1øøøð �|Š|ØØñ
ô 
ˆð Ð DÐ)Ñ)Ô)ˆØ×+Ò+Ñ-Ô-ˆØð 	Ýð=Ø ð=ð =Ø0Að=ð =ð =ñô ð ð	Ø'¨œ?ˆLˆLøÝð 	ð 	ð 	ÝØXÐUVÐXÐXñô ð øøøøð	øøøð
 ×4Ò4Ñ6Ô6ˆØ�zŠzÐ+Ñ,Ô,ˆå1ØØ Ø ØÔ'ð	
ñ 
ô 
Ðõ -ØØØØÔ'ð	
ñ 
ô 
ˆð ˆˆxÑØ)-ˆÐ%Ñ&Ø&7ˆÐ"Ñ#Ø"/ˆˆÑØ+AˆÐ'Ñ(Ø"/ˆˆÑØ'9ˆÐ#Ñ$àˆsW   µ> ¾AÁB Á,BÂB ÂBÂB ÂBÂB ÂB(Â'B(Ã:D Ä
D$ÄDÄD$ÚissuesúList[Issue]ú
List[dict]c                óœ   — g }|D ]F}|j         }|j        }|j        r|j        j        nd}||dœ}|�||d<   |                     |¦  «         ŒG|S )úÿ
        Extracts title and number from each Issue and puts them in a dictionary
        Parameters:
            issues(List[Issue]): A list of Github Issue objects
        Returns:
            List[dict]: A dictionary of issue titles and numbers
        N)ÚtitleÚnumberÚ	opened_by)rE   rF   ÚuserÚloginÚappend)Úselfr@   ÚparsedÚissuerE   rF   rG   Ú
issue_dicts           r   Úparse_issueszGitHubAPIWrapper.parse_issuesz   ss   € ð ˆØð 	&ð 	&ˆEØ”KˆEØ”\ˆFØ,1¬JÐ@˜œ
Ô(Ð(¸DˆIØ#(°FÐ;Ð;ˆJØÐ$Ø*3�
˜;Ñ'Ø�MŠM˜*Ñ%Ô%Ð%Ð%Øˆó    Úpull_requestsúList[PullRequest]c           	     ó¤   — g }|D ]J}|                      |j        |j        t          |j        ¦  «        t          |j        ¦  «        dœ¦  «         ŒK|S )rD   )rE   rF   ÚcommitsÚcomments)rJ   rE   rF   ÚstrrT   rU   )rK   rQ   rL   Úprs       r   Úparse_pull_requestsz$GitHubAPIWrapper.parse_pull_requests�   sf   € ð ˆØð 	ð 	ˆBØ�MŠMàœXØ œiÝ" 2¤:™œÝ # B¤KÑ 0Ô 0ð	ð ñô ð ð ð ˆrP   rV   c                óê   — | j                              d¬¦  «        }d„ |D ¦   «         }|rI|                      |¦  «        }dt          t	          |¦  «        ¦  «        z   dz   t          |¦  «        z   }|S dS )zÔ
        Fetches all open issues from the repo excluding pull requests

        Returns:
            str: A plaintext report containing the number of issues
            and each issue's title and number.
        r.   ©Ústatec                ó    — g | ]}|j         °	|‘ŒS © )Úpull_request)Ú.0rM   s     r   ú
<listcomp>z/GitHubAPIWrapper.get_issues.<locals>.<listcomp>«   s    € ÐFÐFÐF˜E°5Ô3EÐF�%ÐFÐFÐFrP   úFound z	 issues:
zNo open issues available)r   Ú
get_issuesrO   rV   Úlen)rK   r@   Úparsed_issuesÚparsed_issues_strs       r   rb   zGitHubAPIWrapper.get_issues¡   sˆ   € ð Ô*×5Ò5¸FÐ5ÑCÔCˆàFÐF VÐFÑFÔFˆØð 	.Ø ×-Ò-¨fÑ5Ô5ˆMà�3�s =Ñ1Ô1Ñ2Ô2Ñ2°\ÑAÅCÈÑDVÔDVÑVð ð %Ð$à-Ð-rP   c                óä   — | j                              d¬¦  «        }|j        dk    rI|                      |¦  «        }dt	          t          |¦  «        ¦  «        z   dz   t	          |¦  «        z   }|S dS )z³
        Fetches all open PRs from the repo

        Returns:
            str: A plaintext report containing the number of PRs
            and each PR's title and number.
        r.   rZ   r   ra   z pull requests:
zNo open pull requests available)r   Ú	get_pullsÚ
totalCountrX   rV   rc   )rK   rQ   Ú
parsed_prsÚparsed_prs_strs       r   Úlist_open_pull_requestsz(GitHubAPIWrapper.list_open_pull_requestsµ   sx   € ð Ô1×;Ò;À&Ð;ÑIÔIˆØÔ# aÒ'Ð'Ø×1Ò1°-Ñ@Ô@ˆJà�3�s :™œÑ/Ô/Ñ/Ð2EÑEÍÈJÉÌÑWð ð "Ð!à4Ð4rP   c                ó¢  — g }	 | j                              d| j        ¬¦  «        }|D ]U}|j        dk    r.|                     |                      |j        ¦  «        ¦  «         Œ;|                     |j        ¦  «         ŒV|r*d                     |¦  «        }dt          |¦  «        › d|› �S dS # t          $ r}t          |¦  «        cY d}~S d}~ww xY w)	z¦
        Fetches all files in the main branch of the repo.

        Returns:
            str: A plaintext report containing the paths and names of the files.
        Ú ©ÚrefÚdirú
ra   z files in the main branch:
z!No files found in the main branchN)r   Úget_contentsr   ÚtypeÚextendÚ_list_filesÚpathrJ   Újoinrc   r0   rV   ©rK   ÚfilesÚcontentsÚcontentÚ	files_strr<   s         r   Úlist_files_in_main_branchz*GitHubAPIWrapper.list_files_in_main_branchÈ   sü   € ð ˆð	ØÔ0×=Ò=Ø˜Ô/ð >ñ ô ˆHð $ð /ð /�Ø”< 5Ò(Ð(Ø—L’L ×!1Ò!1°'´,Ñ!?Ô!?Ñ@Ô@Ð@Ð@à—L’L ¤Ñ.Ô.Ð.Ð.àð ;Ø ŸIšI eÑ,Ô,�	ØS¥ E¡
¤
ÐSÐSÈ	ÐSÐSÐSà:Ð:øÝð 	ð 	ð 	Ý�q‘6”6ˆMˆMˆMˆMˆMˆMøøøøð	øøøs   „B$B+ Â+
CÂ5C	ÃCÃ	CÚbranch_namec                ó”   — d„ | j                              ¦   «         D ¦   «         }||v r|| _        d|› d�S d|› dt          |¦  «        › �S )z©Equivalent to `git checkout branch_name` for this Agent.
        Clones formatting from Github.

        Returns an Error (as a string) if branch doesn't exist.
        c                ó   — g | ]	}|j         ‘Œ
S r]   ©Úname©r_   Úbranchs     r   r`   z6GitHubAPIWrapper.set_active_branch.<locals>.<listcomp>è   s'   € ð 
ð 
ð 
Ø"ˆFŒKð
ð 
ð 
rP   zSwitched to branch `ú`zError z/ does not exist,in repo with current branches: )r   Úget_branchesr   rV   )rK   r~   Úcurr_branchess      r   Úset_active_branchz"GitHubAPIWrapper.set_active_branchâ   s…   € ð
ð 
Ø&*Ô&?×&LÒ&LÑ&NÔ&Nð
ñ 
ô 
ˆð ˜-Ð'Ð'Ø!,ˆDÔØ8¨+Ð8Ð8Ð8Ð8ðG˜ð Gð GÝ25°mÑ2DÔ2DðGð GðrP   c                óò   — 	 d„ | j                              ¦   «         D ¦   «         }|r*d                     |¦  «        }dt          |¦  «        › d|› �S dS # t          $ r}t          |¦  «        cY d}~S d}~ww xY w)zŸ
        Fetches a list of all branches in the repository.

        Returns:
            str: A plaintext report containing the names of the branches.
        c                ó   — g | ]	}|j         ‘Œ
S r]   r�   rƒ   s     r   r`   z:GitHubAPIWrapper.list_branches_in_repo.<locals>.<listcomp>ü   s'   € ð ð ð Ø &�”ðð ð rP   rq   ra   z branches in the repository:
z#No branches found in the repositoryN)r   r†   rw   rc   r0   rV   )rK   ÚbranchesÚbranches_strr<   s       r   Úlist_branches_in_repoz&GitHubAPIWrapper.list_branches_in_repoô   s©   € ð	ðð Ø*.Ô*C×*PÒ*PÑ*RÔ*Rðñ ô ˆHð ð =Ø#Ÿyšy¨Ñ2Ô2�àX�S ™]œ]ÐXÐXÈ,ÐXÐXðð =Ð<øÝð 	ð 	ð 	Ý�q‘6”6ˆMˆMˆMˆMˆMˆMøøøøð	øøøs   ‚AA Á
A6ÁA1Á+A6Á1A6Úproposed_branch_namec                ó¸  — ddl m} d}|}| j                             | j        j        ¦  «        }t          d¦  «        D ]—}	 | j                             d|› �|j        j        ¬¦  «         || _	        d|› d�c S # |$ rU}|j
        dk    rd	|j        d
         v r|dz  }|› d|› �}n$t          d|› �¦  «         t          d|› �¦  «        ‚Y d}~Œ�d}~ww xY wd|› d�S )a5  
        Create a new branch, and set it as the active bot branch.
        Equivalent to `git switch -c proposed_branch_name`
        If the proposed branch already exists, we append _v1 then _v2...
        until a unique name is found.

        Returns:
            str: A plaintext success message.
        r   ©ÚGithubExceptioniè  zrefs/heads/)ro   ÚshazBranch 'z9' created successfully, and set as current active branch.i¦  zReference already existsÚmessageé   Ú_vz Failed to create branch. Error: z8Unable to create branch name from proposed_branch_name: NzeUnable to create branch. At least 1000 branches exist with named derived from proposed_branch_name: `r…   )r   r‘   r   Ú
get_branchr6   ÚrangeÚcreate_git_refÚcommitr’   r   ÚstatusÚdataÚprintr0   )rK   rŽ   r‘   ÚiÚnew_branch_nameÚbase_branchr<   s          r   Úcreate_branchzGitHubAPIWrapper.create_branch	  s…  € ð 	+Ð*Ð*Ð*Ð*Ð*àˆØ.ˆØÔ/×:Ò:ØÔ%Ô4ñ
ô 
ˆõ �t‘”ð 	ð 	ˆAðØÔ)×8Ò8Ø7 oÐ7Ð7¸[Ô=OÔ=Sð 9ñ ô ð ð &5�Ô"ðN˜ð Nð Nð Nðð ð øð #ð 
ð 
ð 
Ø”8˜s’?�?Ð'AÀQÄVÈIÔEVÐ'VÐ'VØ˜‘F�AØ)=Ð&DÐ&DÀÐ&DÐ&D�O�Oõ Ð@¸QÐ@Ð@ÑAÔAÐAÝ#ð2Ø/ð2ð 2ñô ð ð	 $�O�O�O�Oøøøøð
øøøð>à&:ð>ð >ð >ð	
s   Á5A9Á9CÁ>ACÃCc                ó°  — g }	 | j                              d| j        ¬¦  «        }|D ]U}|j        dk    r.|                     |                      |j        ¦  «        ¦  «         Œ;|                     |j        ¦  «         ŒV|r2d                     |¦  «        }dt          |¦  «        › d| j        › d|› �S d| j        › d	�S # t          $ r}d
|› �cY d}~S d}~ww xY w)zÒ
        Fetches all files in the active branch of the repo,
        the branch the bot uses to make changes.

        Returns:
            str: A plaintext list containing the filepaths in the branch.
        rm   rn   rp   rq   ra   z files in branch `z`:
zNo files found in branch: `r…   zError: N)r   rr   r   rs   rt   ru   rv   rJ   rw   rc   r0   rx   s         r   Úlist_files_in_bot_branchz)GitHubAPIWrapper.list_files_in_bot_branch5  s0  € ð ˆð	!ØÔ0×=Ò=Ø˜Ô*ð >ñ ô ˆHð $ð /ð /�Ø”< 5Ò(Ð(Ø—L’L ×!1Ò!1°'´,Ñ!?Ô!?Ñ@Ô@Ð@Ð@à—L’L ¤Ñ.Ô.Ð.Ð.àð KØ ŸIšI eÑ,Ô,�	ð#�S ™ZœZð #ð #¸4Ô;Mð #ð #Ø ð#ð #ðð
 K°TÔ5GÐJÐJÐJÐJøÝð 	!ð 	!ð 	!Ø ˜Q�=�=Ð Ð Ð Ð Ð Ð øøøøð	!øøøs$   „B,B< Â1
B< Â<
CÃCÃ
CÃCÚdirectory_pathc                óœ   — ddl m} 	 t          |                      |¦  «        ¦  «        S # |$ r}d|j        › d|j        › �cY d}~S d}~ww xY w)zâ
        Recursively fetches files from a directory in the repo.

        Parameters:
            directory_path (str): Path to the directory

        Returns:
            str: List of file paths, or an error message.
        r   r�   zError: status code z, N)r   r‘   rV   ru   rš   r“   )rK   r£   r‘   r<   s       r   Úget_files_from_directoryz)GitHubAPIWrapper.get_files_from_directoryS  s„   € ð 	+Ð*Ð*Ð*Ð*Ð*ð	AÝ�t×'Ò'¨Ñ7Ô7Ñ8Ô8Ð8øØð 	Að 	Að 	AØ@¨¬Ð@Ð@°Q´YÐ@Ð@Ð@Ð@Ð@Ð@Ð@Ð@øøøøð	Aøøøs   ˆ!* ªA¯AÁ AÁAú	List[str]c                óü   — g }| j                              || j        ¬¦  «        }|D ]U}|j        dk    r.|                     |                      |j        ¦  «        ¦  «         Œ;|                     |j        ¦  «         ŒV|S )Nrn   rp   )r   rr   r   rs   rt   ru   rv   rJ   )rK   r£   ry   rz   r{   s        r   ru   zGitHubAPIWrapper._list_filesd  s‹   € ØˆàÔ,×9Ò9Ø Ô 2ð :ñ 
ô 
ˆð  ð 	+ð 	+ˆGØŒ|˜uÒ$Ð$Ø—’˜T×-Ò-¨g¬lÑ;Ô;Ñ<Ô<Ð<Ð<à—’˜Wœ\Ñ*Ô*Ð*Ð*ØˆrP   Úissue_numberÚintúDict[str, Any]c                óþ  — | j                              |¬¦  «        }d}g }t          |¦  «        dk    r|                     ¦   «                              |¦  «        }t          |¦  «        dk    rnD|D ])}|                     |j        |j        j        dœ¦  «         Œ*|dz  }t          |¦  «        dk    °d}|j        r|j        j        r|j        j        }||j	        |j        t          |¦  «        t          |¦  «        dœS )a7  
        Fetches a specific issue and its first 10 comments
        Parameters:
            issue_number(int): The number for the github issue
        Returns:
            `dict` containing the issue's title, body, comments as a string, and the
                username of the user who opened the issue
        ©rF   r   é
   ©ÚbodyrH   r”   N)rF   rE   r¯   rU   rG   )r   Ú	get_issuerc   Úget_commentsÚget_pagerJ   r¯   rH   rI   rE   rV   )rK   r¨   rM   ÚpagerU   Úcomments_pageÚcommentrG   s           r   r°   zGitHubAPIWrapper.get_issuer  s  € ð Ô)×3Ò3¸<Ð3ÑHÔHˆØˆØ!ˆÝ�(‰mŒm˜rÒ!Ð!Ø!×.Ò.Ñ0Ô0×9Ò9¸$Ñ?Ô?ˆMÝ�=Ñ!Ô! QÒ&Ð&ØØ(ð Tð T�Ø—’¨¬¸w¼|Ô?QÐ RÐ RÑSÔSÐSÐSØ�A‰IˆDõ �(‰mŒm˜rÒ!Ð!ð ˆ	ØŒ:ð 	)˜%œ*Ô*ð 	)Øœ
Ô(ˆIð #Ø”[Ø”JÝ˜H™œÝ˜Y™œð
ð 
ð 	
rP   Ú	pr_numberúList[Dict[str, Any]]c                ó–  — t          ¦   «         }d}g }| j                             t          |¦  «        ¬¦  «        }d}d}	 |                     ¦   «                              |¦  «        }t          |¦  «        dk    r�nM|D �]B}		 t          j        |	j	        ¦  «        }
|
j
        dk    r t          j        |
j        ¦  «        d         }nt          d|	j	        › d�¦  «         Œat          j        |¦  «        }|j
        dk    r|j        }nt          d	|j
        › d
�¦  «         Œ¡t          |                     d¦  «                             ||	j        z   dz   ¦  «        ¦  «        }||z   |k     r.|                     |	j        ||	j        |	j        dœ¦  «         ||z  }�Œ# t*          $ r}t          d|› �¦  «         Y d}~�Œ<d}~ww xY w|dz  }�Œ‰|S )a^  Fetches the full text of all files in a PR. Truncates after first 3k tokens.
        # TODO: Enhancement to summarize files with ctags if they're getting long.

        Args:
            pr_number(int): The number of the pull request on Github

        Returns:
            `dict` containing the issue's title, body, and comments as a string
        i¸  r¬   r   TéÈ   Údownload_urlzFailed to download file: z
, skippingz'Failed downloading file content (Error z). SkippingÚcl100k_basezfile_name file_contents)Úfilenamerz   Ú	additionsÚ	deletionsz.Error when reading files from a PR on github. Nr”   )r   r   Úget_pullr©   Ú	get_filesr²   rc   ÚrequestsÚgetÚcontents_urlÚstatus_codeÚjsonÚloadsÚtextrœ   Úget_encodingÚencoder¼   rJ   r½   r¾   r0   )rK   r¶   r   ÚMAX_TOKENS_FOR_FILESÚpr_filesrW   Útotal_tokensr³   Ú
files_pageÚfileÚfile_metadata_responserº   Úfile_content_responseÚfile_contentÚfile_tokensr<   s                   r   Úlist_pull_request_filesz(GitHubAPIWrapper.list_pull_request_files’  s=  € õ $Ñ%Ô%ˆØ$ÐØˆØÔ&×/Ò/µs¸9±~´~Ð/ÑFÔFˆØˆØˆð+	ØŸš™œ×0Ò0°Ñ6Ô6ˆJÝ�:‰Œ !Ò#Ð#ÙØ"ð &Pñ &P�ð%PÝ-5¬\¸$Ô:KÑ-LÔ-LÐ*Ø-Ô9¸SÒ@Ð@Ý'+¤zÐ2HÔ2MÑ'NÔ'NØ*ô(˜˜õ ÐW¸$Ô:KÐWÐWÐWÑXÔXÐXØ å,4¬L¸Ñ,FÔ,FÐ)Ø,Ô8¸CÒ?Ð?à'<Ô'A˜˜åðUØ&;Ô&GðUð Uð Uñô ð ð !å"%Ø ×-Ò-¨mÑ<Ô<×CÒCØ(¨4¬=Ñ8Ð;TÑTñô ñ#ô #�Kð
 % {Ñ2Ð6JÒJÐJØ Ÿšà,0¬MØ,8Ø-1¬^Ø-1¬^ð	ð ñô ð ð %¨Ñ3˜ùøÝ ð Pð Pð PÝÐNÈ1ÐNÐNÑOÔOÐOÐOÐOÐOÐOÑOøøøøðPøøøà�A‰IˆDñW+	ðX ˆs&   ÂAFÃ?FÄA7FÆ
F?Æ"F:Æ:F?c                ól  ‡‡‡— dŠ| j                              |¬¦  «        }dŠdd„Šdˆˆˆfd„}i } ||d|j        ¦  «          ||dt          |¦  «        ¦  «          ||d|j        r|j        nd¦  «         g }d}t          |¦  «        dk    r°|                     ¦   «                              |¦  «        }t          |¦  «        dk    rnu|D ]Z}t          |j        |j        j	        dœ¦  «        }	‰ ‰|	¦  «        z   ‰k    r n$| 
                    |	¦  «         ‰ ‰|	¦  «        z  ŠŒ[|dz  }t          |¦  «        dk    °° ||dt          |¦  «        ¦  «         g }
d}t          |
¦  «        dk    rª|                     ¦   «                              |¦  «        }t          |¦  «        dk    rno|D ]T}t          d|j        j        i¦  «        }‰ ‰|¦  «        z   ‰k    r n$|
 
                    |¦  «         ‰ ‰|¦  «        z  ŠŒU|dz  }t          |
¦  «        dk    °ª ||dt          |
¦  «        ¦  «         |S )ae  
        Fetches a specific pull request and its first 10 comments,
        limited by max_tokens.

        Parameters:
            pr_number(int): The number for the Github pull
            max_tokens(int): The maximum number of tokens in the response
        Returns:
            `dict` containing the pull's title, body, and comments as a string
        iÐ  r¬   r   rÇ   rV   r   r©   c                óˆ   — t          ¦   «         }t          |                     d¦  «                             | ¦  «        ¦  «        S )Nr»   )r   rc   rÈ   rÉ   )rÇ   r   s     r   Ú
get_tokensz5GitHubAPIWrapper.get_pull_request.<locals>.get_tokensß  s7   € Ý'Ñ)Ô)ˆHÝ�x×,Ò,¨]Ñ;Ô;×BÒBÀ4ÑHÔHÑIÔIÐIrP   Ú	data_dictrª   ÚkeyÚvalueÚNonec                óH   •—  ‰|¦  «        }‰|z   ‰k    r|| |<   ‰|z  Šd S d S ©Nr]   )r×   rØ   rÙ   ÚtokensrÖ   Ú
max_tokensrÌ   s       €€€r   Úadd_to_dictz6GitHubAPIWrapper.get_pull_request.<locals>.add_to_dictã  sA   ø€ à�Z Ñ&Ô&ˆFØ˜fÑ$¨
Ò2Ð2Ø!&�	˜#‘Ø Ñ&���ð 3Ð2rP   rE   rF   r¯   rm   r­   r®   r”   rU   r“   rT   )rÇ   rV   r   r©   )r×   rª   rØ   rV   rÙ   rV   r   rÚ   )r   r¿   rE   rV   r¯   rc   Úget_issue_commentsr²   rH   rI   rJ   Úget_commitsr™   r“   )rK   r¶   Úpullrß   Úresponse_dictrU   r³   r´   rµ   Úcomment_strrT   Úcommits_pager™   Ú
commit_strrÖ   rÞ   rÌ   s                 @@@r   Úget_pull_requestz!GitHubAPIWrapper.get_pull_requestÐ  s·  øøø€ ð ˆ
ØÔ(×1Ò1¸Ð1ÑCÔCˆØˆð	Jð 	Jð 	Jð 	Jð	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð )+ˆØˆ�M 7¨D¬JÑ7Ô7Ð7Øˆ�M 8­S°©^¬^Ñ<Ô<Ð<Øˆ�M 6¸¼	Ð+I¨4¬9¨9ÀrÑJÔJÐJà ˆØˆÝ�(‰mŒm˜rÒ!Ð!Ø ×3Ò3Ñ5Ô5×>Ò>¸tÑDÔDˆMÝ�=Ñ!Ô! QÒ&Ð&ØØ(ð 8ð 8�Ý!¨7¬<ÀÄÔASÐ"TÐ"TÑUÔU�Ø * *¨[Ñ"9Ô"9Ñ9¸JÒFÐFØ�EØ—’ Ñ,Ô,Ð,Ø 
 
¨;Ñ 7Ô 7Ñ7��Ø�A‰IˆDõ �(‰mŒm˜rÒ!Ð!ð 	ˆ�M :­s°8©}¬}Ñ=Ô=Ð=àˆØˆÝ�'‰lŒl˜bÒ Ð Ø×+Ò+Ñ-Ô-×6Ò6°tÑ<Ô<ˆLÝ�<Ñ Ô  AÒ%Ð%ØØ&ð 7ð 7�Ý  )¨V¬]Ô-BÐ!CÑDÔD�
Ø * *¨ZÑ"8Ô"8Ñ8¸:ÒEÐEØ�EØ—’˜zÑ*Ô*Ð*Ø 
 
¨:Ñ 6Ô 6Ñ6��Ø�A‰IˆDõ �'‰lŒl˜bÒ Ð ð 	ˆ�M 9­c°'©l¬lÑ;Ô;Ð;ØÐrP   Úpr_queryc                óH  — | j         | j        k    rdS 	 |                     d¦  «        d         }|t          |¦  «        dz   d…         }| j                             ||| j        | j         ¬¦  «        }d|j        › �S # t          $ r}dt          |¦  «        z   cY d}~S d}~ww xY w)	a¢  
        Makes a pull request from the bot's branch to the base branch
        Parameters:
            pr_query(str): a string which contains the PR title
            and the PR body. The title is the first line
            in the string, and the body are the rest of the string.
            For example, "Updated README
made changes to add info"
        Returns:
            str: A success or failure message
        z`Cannot make a pull request because
            commits are already in the main or master branch.rq   r   é   N)rE   r¯   ÚheadÚbasezSuccessfully created PR number z*Unable to make pull request due to error:
)	r   r   Úsplitrc   r   Úcreate_pullrF   r0   rV   )rK   rè   rE   r¯   rW   r<   s         r   Úcreate_pull_requestz$GitHubAPIWrapper.create_pull_request  sÜ   € ð Ô" dÔ&8Ò8Ð8ðAð AðNØ Ÿš tÑ,Ô,¨QÔ/�Ø¥ E¡
¤
¨Q¡Ð 0Ð 0Ô1�ØÔ.×:Ò:ØØØÔ+ØÔ0ð	 ;ñ ô �ð E¸¼ÐDÐDÐDøÝð Nð Nð NØDÅsÈ1ÁvÄvÑMÐMÐMÐMÐMÐMÐMøøøøðNøøøs   ”A&A; Á;
B!ÂBÂB!ÂB!Úcomment_queryc                óx  — t          |                     d¦  «        d         ¦  «        }|t          t          |¦  «        ¦  «        dz   d…         }	 | j                             |¬¦  «        }|                     |¦  «         dt          |¦  «        z   S # t          $ r}dt          |¦  «        z   cY d}~S d}~ww xY w)af  
        Adds a comment to a github issue
        Parameters:
            comment_query(str): a string which contains the issue number,
            two newlines, and the comment.
            for example: "1

Working on it now"
            adds the comment "working on it now" to issue 1
        Returns:
            str: A success or failure message
        z

r   rê   Nr¬   zCommented on issue z%Unable to make comment due to error:
)r©   rí   rc   rV   r   r°   Úcreate_commentr0   )rK   rð   r¨   rµ   rM   r<   s         r   Úcomment_on_issuez!GitHubAPIWrapper.comment_on_issue*  sÒ   € õ ˜=×.Ò.¨vÑ6Ô6°qÔ9Ñ:Ô:ˆØ¥¥C¨Ñ$5Ô$5Ñ 6Ô 6¸Ñ :Ð <Ð <Ô=ˆð	EØÔ-×7Ò7¸|Ð7ÑLÔLˆEØ× Ò  Ñ)Ô)Ð)Ø(­3¨|Ñ+<Ô+<Ñ<Ð<øÝð 	Eð 	Eð 	EØ;½cÀ!¹f¼fÑDÐDÐDÐDÐDÐDÐDøøøøð	Eøøøs   ÁAB Â
B9ÂB4Â.B9Â4B9Ú
file_queryc                óÒ  — | j         | j        k    rd| j        › d�S |                     d¦  «        d         }|t          |¦  «        dz   d…         }	 	 | j                             || j         ¬¦  «        }|rd|› d	| j         › d
�S n# t          $ r Y nw xY w| j                             |d|z   || j         ¬¦  «         d|z   S # t          $ r}dt          |¦  «        z   cY d}~S d}~ww xY w)a‘  
        Creates a new file on the Github repo
        Parameters:
            file_query(str): a string which contains the file path
            and the file contents. The file path is the first line
            in the string, and the contents are the rest of the string.
            For example, "hello_world.md
# Hello World!"
        Returns:
            str: A success or failure message
        z2You're attempting to commit to the directly to theúF branch, which is protected. Please create a new branch and try again.rq   r   rê   Nrn   zFile already exists at `z` on branch `z+`. You must use `update_file` to modify it.zCreate )rv   r“   r{   r„   zCreated file z"Unable to make file due to error:
)	r   r   rí   rc   r   rr   r0   Úcreate_filerV   )rK   rô   Ú	file_pathÚfile_contentsrÎ   r<   s         r   r÷   zGitHubAPIWrapper.create_file>  s{  € ð Ô Ô!8Ò8Ð8ð<ØÔ*ð<ð <ð <ðð ×$Ò$ TÑ*Ô*¨1Ô-ˆ	Ø"¥3 y¡>¤>°AÑ#5Ð#7Ð#7Ô8ˆð	BðØÔ0×=Ò=Ø 4Ô#5ð >ñ ô �ð ð ð6°9ð 6ð 6Ø&*Ô&8ð6ð 6ð 6ððøõ ð ð ð à�ðøøøð Ô%×1Ò1ØØ! IÑ-Ø%ØÔ)ð	 2ñ ô ð ð # YÑ.Ð.øÝð 	Bð 	Bð 	BØ8½3¸q¹6¼6ÑAÐAÐAÐAÐAÐAÐAøøøøð	Bøøøs<   Á0B ÂC  Â
BÂC  ÂBÂ-C  Ã 
C&Ã
C!ÃC&Ã!C&rø   c           	     óâ   — 	 | j                              || j        ¬¦  «        }|j                             d¦  «        S # t
          $ r'}d|› d| j        › dt          |¦  «        › �cY d}~S d}~ww xY w)a  
        Read a file from this agent's branch, defined by self.active_branch,
        which supports PR branches.
        Parameters:
            file_path(str): the file path
        Returns:
            str: The file decoded as a string, or an error message if not found
        rn   zutf-8zFile not found `z` on branch`z
`. Error: N)r   rr   r   Údecoded_contentÚdecoder0   rV   )rK   rø   rÎ   r<   s       r   Ú	read_filezGitHubAPIWrapper.read_filel  s¶   € ð		ØÔ,×9Ò9Ø˜tÔ1ð :ñ ô ˆDð Ô'×.Ò.¨wÑ7Ô7Ð7øÝð 	ð 	ð 	ð; 9ð ;ð ;ØÔ&ð;ð ;Ý25°a±&´&ð;ð ;ðð ð ð ð ð øøøøð	øøøs   ‚:= ½
A.ÁA)Á#A.Á)A.c           
     ó  — | j         | j        k    rd| j        › d�S 	 |                     d¦  «        d         }|                     d¦  «        d                              d¦  «        d                              ¦   «         }|                     d¦  «        d                              d	¦  «        d                              ¦   «         }|                      |¦  «        }|                     ||¦  «        }||k    r	 d
S | j                             |dt          |¦  «        z   || j         | j         	                    || j         ¬¦  «        j
        ¬¦  «         dt          |¦  «        z   S # t          $ r}dt          |¦  «        z   cY d}~S d}~ww xY w)a9  
        Updates a file with new content.
        Parameters:
            file_query(str): Contains the file path and the file contents.
                The old file contents is wrapped in OLD <<<< and >>>> OLD
                The new file contents is wrapped in NEW <<<< and >>>> NEW
                For example:
                /test/hello.txt
                OLD <<<<
                Hello Earth!
                >>>> OLD
                NEW <<<<
                Hello Mars!
                >>>> NEW
        Returns:
            A success or failure message
        ú2You're attempting to commit to the directlyto the rö   rq   r   zOLD <<<<r”   z>>>> OLDzNEW <<<<z>>>> NEWzŽFile content was not updated because old content was not found.It may be helpful to use the read_file action to get the current file contents.zUpdate rn   )rv   r“   r{   r„   r’   zUpdated file z$Unable to update file due to error:
N)r   r   rí   Ústriprý   Úreplacer   Úupdate_filerV   rr   r’   r0   )rK   rô   rø   Úold_file_contentsÚnew_file_contentsrÑ   Úupdated_file_contentr<   s           r   r  zGitHubAPIWrapper.update_file€  sÌ  € ð$ Ô Ô!8Ò8Ð8ð<ØÔ1ð<ð <ð <ðð
 	DØ'×-Ò-¨dÑ3Ô3°AÔ6ˆIà× Ò  Ñ,Ô,¨QÔ/×5Ò5°jÑAÔAÀ!ÔD×JÒJÑLÔLð ð × Ò  Ñ,Ô,¨QÔ/×5Ò5°jÑAÔAÀ!ÔD×JÒJÑLÔLð ð  Ÿ>š>¨)Ñ4Ô4ˆLØ#/×#7Ò#7Ø!Ð#4ñ$ô $Ð ð Ð3Ò3Ð3ð1ðð ð Ô%×1Ò1ØØ!¥C¨	¡N¤NÑ2Ø,ØÔ)ØÔ-×:Ò:Ø 4Ô#5ð ;ñ ô äð 2ñ ô ð ð #¥S¨¡^¤^Ñ3Ð3øÝð 	Dð 	Dð 	DØ:½SÀ¹V¼VÑCÐCÐCÐCÐCÐCÐCøøøøð	Døøøs%   �CE" Ã8A)E" Å"
FÅ,FÅ=FÆFc           	     ó*  — | j         | j        k    rd| j        › d�S 	 | j                             |d|z   | j         | j                             || j         ¬¦  «        j        ¬¦  «         d|z   S # t          $ r}dt          |¦  «        z   cY d}~S d}~ww xY w)	z­
        Deletes a file from the repo
        Parameters:
            file_path(str): Where the file is
        Returns:
            str: Success or failure message
        rÿ   rö   zDelete rn   )rv   r“   r„   r’   zDeleted file z$Unable to delete file due to error:
N)r   r   r   Údelete_filerr   r’   r0   rV   )rK   rø   r<   s      r   r  zGitHubAPIWrapper.delete_fileº  sá   € ð Ô Ô!8Ò8Ð8ð<ØÔ1ð<ð <ð <ðð
	DØÔ%×1Ò1ØØ! IÑ-ØÔ)ØÔ-×:Ò:Ø 4Ô#5ð ;ñ ô äð 2ñ ô ð ð # YÑ.Ð.øÝð 	Dð 	Dð 	DØ:½SÀ¹V¼VÑCÐCÐCÐCÐCÐCÐCøøøøð	Døøøs   �AA, Á,
BÁ6BÂBÂBÚqueryc           	     ó  — | j                              || j        ¬¦  «        }t          d|j        ¦  «        }d|› d�g}|d|…         D ]/}|                     d|j        › d|j        › d|j        › �¦  «         Œ0d	 	                    |¦  «        S )
zà
        Searches issues and pull requests in the repository.

        Parameters:
            query(str): The search query

        Returns:
            str: A string containing the first 5 issues and pull requests
        )r>   é   úTop ú	 results:NúTitle: z
, Number: z	, State: rq   )
r   Úsearch_issuesr   Úminrh   rJ   rE   rF   r[   rw   )rK   r  Úsearch_resultÚ	max_itemsÚresultsrM   s         r   Úsearch_issues_and_prsz&GitHubAPIWrapper.search_issues_and_prsÕ  s®   € ð œ×1Ò1°%¸dÔ>TÐ1ÑUÔUˆÝ˜˜=Ô3Ñ4Ô4ˆ	Ø.˜)Ð.Ð.Ð.Ð/ˆØ" : I :Ô.ð 	ð 	ˆEØ�NŠNØU˜%œ+ÐUÐU°´ÐUÐUÈÌÐUÐUñô ð ð ð �yŠy˜Ñ!Ô!Ð!rP   c                ó´  — | j                              || j        ¬¦  «        }|j        dk    rdS t	          d|j        ¦  «        }d|› d|j        › d�g}d}|D ]m}||k    r nd| j                             |j        | j        ¬¦  «        j	         
                    ¦   «         }|                     d	|j        › d
|› d�¦  «         |dz  }Œnd                     |¦  «        S )zù
        Searches code in the repository.
        # Todo: limit total tokens returned...

        Parameters:
            query(str): The search query

        Returns:
            str: A string containing, at most, the top 5 search results
        )r  r>   r   z0 results found.r
  zShowing top z of r  rn   zFilepath: `z`
File contents: z
<END OF FILE>r”   rq   )r   Úsearch_coder   rh   r  r   rr   rv   r   rû   rü   rJ   rw   )rK   r  r  Úmax_resultsr  ÚcountÚcoderÑ   s           r   r  zGitHubAPIWrapper.search_codeè  s  € ð œ×/Ò/Ø˜dÔ4ð 0ñ 
ô 
ˆð Ô# qÒ(Ð(Ø%Ð%Ý˜!˜]Ô5Ñ6Ô6ˆØV +ÐVÐV°=Ô3KÐVÐVÐVÐWˆØˆØ!ð 
	ð 
	ˆDØ˜Ò#Ð#Ø�àÔ4×AÒAØ”	˜tÔ1ð Bñ ô äŸfšf™hœhð ð �NŠNØX˜dœiÐXÐX¸<ÐXÐXÐXñô ð ð �Q‰JˆEˆEØ�yŠy˜Ñ!Ô!Ð!rP   Úreviewer_usernamec                ó  ‡ — ‰ j                              dd¬¦  «        }t          ˆ fd„|D ¦   «         d¦  «        }|€d‰ j        › d�S 	 |                     |g¬¦  «         d	|› d
|j        › �S # t          $ r}d|› �cY d}~S d}~ww xY w)a;  
        Creates a review request on *THE* open pull request
        that matches the current active_branch.

        Parameters:
            reviewer_username(str): The username of the person who is being requested

        Returns:
            str: A message confirming the creation of the review request
        r.   Úcreated)r[   Úsortc              3  óF   •K  — | ]}|j         j        ‰j        k    ¯|V — Œd S rÜ   )rë   ro   r   )r_   rW   rK   s     €r   ú	<genexpr>z9GitHubAPIWrapper.create_review_request.<locals>.<genexpr>  s4   øè è € ÐMÐM�B¨2¬7¬;¸$Ô:LÒ+LÐ+LˆRÐ+LÐ+LÐ+LÐ+LÐMÐMrP   Nz3No open pull request found for the current branch `r…   )Ú	reviewersz Review request created for user z on PR #z-Failed to create a review request with error )r   rg   Únextr   Úcreate_review_requestrF   r0   )rK   r  rQ   rW   r<   s   `    r   r!  z&GitHubAPIWrapper.create_review_request  s   ø€ ð Ô1×;Ò;Ø˜yð <ñ 
ô 
ˆõ ØMÐMÐMÐM˜-ÐMÑMÔMÈtñ
ô 
ˆð ˆ:ð9Ø#'Ô#5ð9ð 9ð 9ðð
	GØ×$Ò$Ð0AÐ/BÐ$ÑCÔCÐCð&Ð3Dð &ð &Øœ)ð&ð &ðøõ ð 	Gð 	Gð 	GØFÀ1ÐFÐFÐFÐFÐFÐFÐFÐFøøøøð	Gøøøs   Á#A, Á,
BÁ6B Á:BÂ Bc                óh   — | j                              ¦   «         }d|j        › d|j        › d|j        › �S )zu
        Fetches the latest release of the repository.

        Returns:
            str: The latest release
        zLatest title: ú tag: ú body: )r   Úget_latest_releaserE   Útag_namer¯   )rK   Úreleases     r   r%  z#GitHubAPIWrapper.get_latest_release)  sO   € ð Ô+×>Ò>Ñ@Ô@ˆð$˜Wœ]ð $ð $ØÔ$ð$ð $à”\ð$ð $ð	
rP   c           	     ó
  — | j                              ¦   «         }t          d|j        ¦  «        }d|› d�g}|d|…         D ]/}|                     d|j        › d|j        › d|j        › �¦  «         Œ0d                     |¦  «        S )	zi
        Fetches all releases of the repository.

        Returns:
            str: The releases
        r
  r  r  Nr  z, Tag: z, Body: rq   )	r   Úget_releasesr  rh   rJ   rE   r&  r¯   rw   )rK   Úreleasesr  r  r'  s        r   r)  zGitHubAPIWrapper.get_releases7  s¦   € ð Ô,×9Ò9Ñ;Ô;ˆÝ˜!˜XÔ0Ñ1Ô1ˆØ0˜+Ð0Ð0Ð0Ð1ˆØ   Ô-ð 	ð 	ˆGØ�NŠNØX˜'œ-ÐXÐX°Ô0@ÐXÐXÈ'Ì,ÐXÐXñô ð ð ð �yŠy˜Ñ!Ô!Ð!rP   r&  c                ój   — | j                              |¦  «        }d|j        › d|j        › d|j        › �S )zº
        Fetches a specific release of the repository.

        Parameters:
            tag_name(str): The tag name of the release

        Returns:
            str: The release
        z	Release: r#  r$  )r   Úget_releaserE   r&  r¯   )rK   r&  r'  s      r   r,  zGitHubAPIWrapper.get_releaseH  s?   € ð Ô+×7Ò7¸ÑAÔAˆØW˜7œ=ÐWÐW°Ô0@ÐWÐWÈÌÐWÐWÐWrP   r!   c                ó¬  — |dk    r4t          j        |                      t          |¦  «        ¦  «        ¦  «        S |dk    r4t          j        |                      t          |¦  «        ¦  «        ¦  «        S |dk    r4t          j        |                      t          |¦  «        ¦  «        ¦  «        S |dk    r|                      ¦   «         S |dk    r|                      |¦  «        S |dk    r|                      |¦  «        S |dk    r|  	                    |¦  «        S |dk    r|  
                    |¦  «        S |d	k    r|                      |¦  «        S |d
k    r|                      |¦  «        S |dk    r|                      ¦   «         S |dk    r|                      ¦   «         S |dk    r|                      ¦   «         S |dk    r|                      ¦   «         S |dk    r|                      |¦  «        S |dk    r|                      |¦  «        S |dk    r|                      |¦  «        S |dk    r|                      |¦  «        S |dk    r|                      |¦  «        S |dk    r|                      |¦  «        S |dk    r|                      ¦   «         S |dk    r|                      ¦   «         S |dk    r|                      |¦  «        S t5          d|z   ¦  «        ‚)Nr°   rç   rÓ   rb   ró   r÷   rï   rý   r  r  rk   r}   r¢   r�   rˆ   r    r¥   r  r  r!  r%  r)  r,  zInvalid mode)rÅ   Údumpsr°   r©   rç   rÓ   rb   ró   r÷   rï   rý   r  r  rk   r}   r¢   r�   rˆ   r    r¥   r  r  r!  r%  r)  r,  r3   )rK   r!   r  s      r   ÚrunzGitHubAPIWrapper.runU  s  € Ø�;ÒÐÝ”:˜dŸnšn­S°©Z¬ZÑ8Ô8Ñ9Ô9Ð9ØÐ'Ò'Ð'Ý”:˜d×3Ò3µC¸±J´JÑ?Ô?Ñ@Ô@Ð@ØÐ.Ò.Ð.Ý”:˜d×:Ò:½3¸u¹:¼:ÑFÔFÑGÔGÐGØ�\Ò!Ð!Ø—?’?Ñ$Ô$Ð$ØÐ'Ò'Ð'Ø×(Ò(¨Ñ/Ô/Ð/Ø�]Ò"Ð"Ø×#Ò# EÑ*Ô*Ð*ØÐ*Ò*Ð*Ø×+Ò+¨EÑ2Ô2Ð2Ø�[Ò Ð Ø—>’> %Ñ(Ô(Ð(Ø�]Ò"Ð"Ø×#Ò# EÑ*Ô*Ð*Ø�]Ò"Ð"Ø×#Ò# EÑ*Ô*Ð*ØÐ.Ò.Ð.Ø×/Ò/Ñ1Ô1Ð1ØÐ0Ò0Ð0Ø×1Ò1Ñ3Ô3Ð3ØÐ/Ò/Ð/Ø×0Ò0Ñ2Ô2Ð2ØÐ,Ò,Ð,Ø×-Ò-Ñ/Ô/Ð/ØÐ(Ò(Ð(Ø×)Ò)¨%Ñ0Ô0Ð0Ø�_Ò$Ð$Ø×%Ò% eÑ,Ô,Ð,ØÐ/Ò/Ð/Ø×0Ò0°Ñ7Ô7Ð7ØÐ,Ò,Ð,Ø×-Ò-¨eÑ4Ô4Ð4Ø�]Ò"Ð"Ø×#Ò# EÑ*Ô*Ð*ØÐ,Ò,Ð,Ø×-Ò-¨eÑ4Ô4Ð4ØÐ)Ò)Ð)Ø×*Ò*Ñ,Ô,Ð,Ø�^Ò#Ð#Ø×$Ò$Ñ&Ô&Ð&Ø�]Ò"Ð"Ø×#Ò# EÑ*Ô*Ð*å˜^¨dÑ2Ñ3Ô3Ð3rP   )r"   r   r   r   )r@   rA   r   rB   )rQ   rR   r   rB   )r   rV   )r~   rV   r   rV   )rŽ   rV   r   rV   )r£   rV   r   rV   )r£   rV   r   r¦   )r¨   r©   r   rª   )r¶   r©   r   r·   )r¶   r©   r   rª   )rè   rV   r   rV   )rð   rV   r   rV   )rô   rV   r   rV   )rø   rV   r   rV   )r  rV   r   rV   )r  rV   r   rV   )r&  rV   r   rV   )r!   rV   r  rV   r   rV   ),Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   r   r   r   r   Úmodel_configr   Úclassmethodr?   rO   rX   rb   rk   r}   rˆ   r�   r    r¢   r¥   ru   r°   rÓ   rç   rï   ró   r÷   rý   r  r  r  r  r!  r%  r)  r,  r/  r]   rP   r   r   r      s1  € € € € € € Ø!Ð!à€FÐÐÐÑØ $ÐÐ$Ð$Ð$Ñ$Ø'+ÐÐ+Ð+Ð+Ñ+Ø#'€MÐ'Ð'Ð'Ñ'Ø,0ÐÐ0Ð0Ð0Ñ0Ø#'€MÐ'Ð'Ð'Ñ'Ø(,ÐÐ,Ð,Ð,Ñ,à�:Øðñ ô €Lð €_˜(Ð#Ñ#Ô#ØðKð Kð Kñ „[ñ $Ô#ðKðZð ð ð ð&ð ð ð ð(.ð .ð .ð .ð(5ð 5ð 5ð 5ð&ð ð ð ð4ð ð ð ð$ð ð ð ð**
ð *
ð *
ð *
ðX!ð !ð !ð !ð<Að Að Að Að"ð ð ð ð
ð 
ð 
ð 
ð@<ð <ð <ð <ð|<ð <ð <ð <ð|Nð Nð Nð Nð8Eð Eð Eð Eð(,Bð ,Bð ,Bð ,Bð\ð ð ð ð(8Dð 8Dð 8Dð 8DðtDð Dð Dð Dð6"ð "ð "ð "ð&"ð "ð "ð "ð@Gð Gð Gð GðB
ð 
ð 
ð 
ð"ð "ð "ð "ð"Xð Xð Xð Xð04ð 04ð 04ð 04ð 04ð 04rP   r   )r   r   )r3  Ú
__future__r   rÅ   Útypingr   r   r   r   r   rÁ   Úlangchain_core.utilsr	   Úpydanticr
   r   r   Úgithub.Issuer   Úgithub.PullRequestr   r   r   r]   rP   r   ú<module>r=     s  ðØ Ð à "Ð "Ð "Ð "Ð "Ð "à €€€Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;à €€€Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;àð /Ø"Ð"Ð"Ð"Ð"Ð"Ø.Ð.Ð.Ð.Ð.Ð.ðð ð ð ði4ð i4ð i4ð i4ð i4�yñ i4ô i4ð i4ð i4ð i4rP   