
    h                         d Z ddlmZmZmZ ddlmZ ddlmZ ddl	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ g dZ G d	 d
e      Zy)zGitLab Toolkit.    )DictListOptional)BaseTool)BaseToolkit)COMMENT_ON_ISSUE_PROMPTCREATE_FILE_PROMPTCREATE_PULL_REQUEST_PROMPTCREATE_REPO_BRANCHDELETE_FILE_PROMPTGET_ISSUE_PROMPTGET_ISSUES_PROMPTGET_REPO_FILES_FROM_DIRECTORYGET_REPO_FILES_IN_BOT_BRANCHGET_REPO_FILES_IN_MAINLIST_REPO_BRANCESREAD_FILE_PROMPTSET_ACTIVE_BRANCHUPDATE_FILE_PROMPT)GitLabAction)GitLabAPIWrapper)
get_issues	get_issuecomment_on_issuecreate_pull_requestcreate_file	read_fileupdate_filedelete_filec                   h    e Zd ZU dZg Zee   ed<   eddde	de
ee      dd fd       Zdee   fd	Zy)
GitLabToolkita  GitLab Toolkit.

    *Security Note*: This toolkit contains tools that can read and modify
        the state of a service; e.g., by creating, deleting, or updating,
        reading underlying data.

        For example, this toolkit can be used to create issues, pull requests,
        and comments on GitLab.

        See https://python.langchain.com/docs/security for more information.

    Parameters:
        tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
    toolsN)included_toolsgitlab_api_wrapperr#   returnc                   ||nt         }ddt        dddt        dddt        ddd	t        dd
dt
        dddt        dddt        dddt        dddt        dddt        dddt        dddt        dddt        dddt        dg}|D cg c]  }|d   |v r| }}|D cg c]  }t        |d   |d    |d   |!       }} | |"      S c c}w c c}w )#zCreate a GitLabToolkit from a GitLabAPIWrapper.

        Args:
            gitlab_api_wrapper: GitLabAPIWrapper. The GitLab API wrapper.

        Returns:
            GitLabToolkit. The GitLab toolkit.
        r   z
Get Issues)modenamedescriptionr   z	Get Issuer   zComment on Issuer   zCreate Pull Requestr   zCreate Filer   z	Read Filer   zUpdate Filer   zDelete Filecreate_branchzCreate a new branchlist_branches_in_repozGet the list of branchesset_active_branchzChange the active branchlist_files_in_main_branchz)Overview of existing files in Main branchlist_files_in_bot_branchz+Overview of files in current working branchlist_files_from_directoryz@Overview of files in current working branch from a specific pathr'   r(   r)   )r(   r)   r'   api_wrapperr"   )DEFAULT_INCLUDED_TOOLSr   r   r   r
   r	   r   r   r   r   r   r   r   r   r   r   )	clsr$   r#   tools_to_include
operations	operationoperations_filteredactionr"   s	            o/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/langchain_community/agent_toolkits/gitlab/toolkit.pyfrom_gitlab_api_wrapperz%GitLabToolkit.from_gitlab_api_wrapper<   s   " -8N>T 	 %$0 $#/ +*6 .-9 &%1 $#/ &%1 &%1 (-1 020 ,20 4C5 3E; 4Z<EG"

T (
 $44 
 
 .
  F^"=1F^.	
 
 


s   C%Cc                     | j                   S )zGet the tools in the toolkit.r1   )selfs    r9   	get_toolszGitLabToolkit.get_tools   s    zz    )__name__
__module____qualname____doc__r"   r   r   __annotations__classmethodr   r   strr:   r=    r>   r9   r!   r!   *   si     E4>
 /3	i ,i  !c+	i 
 
i  i V4> r>   r!   N)rB   typingr   r   r   langchain_core.toolsr   langchain_core.tools.baser   'langchain_community.tools.gitlab.promptr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   %langchain_community.tools.gitlab.toolr   $langchain_community.utilities.gitlabr   r2   r!   rF   r>   r9   <module>rM      sF     ' ' ) 1     ? A
	 @K @r>   