a
    bg                     @   sL   d dl Z d dlZd dlmZmZ d dlmZ d dlmZ G dd deZ	dS )    N)AnyOptional)CallbackManagerForToolRun)SlackBaseToolc                   @   sF   e Zd ZU dZdZeed< dZeed< ddee	e
 edd	d
ZdS )SlackGetChannelz)Tool that gets Slack channel information.Zget_channelid_name_dictnamezHUse this tool to get channelid-name dict. There is no input to this tooldescriptionN)run_manager)argsr	   returnc             
   G   sn   z:t t | j }|d }dd |D }tj|ddW S  tyh } zd|W  Y d }~S d }~0 0 d S )Nchannelsc                    s>   g | ]6 d  v rd v rd v rd v r fdddD qS )idr   creatednum_membersc                    s   i | ]}| | qS  r   ).0keyZchannelr   y/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain_community/tools/slack/get_channel.py
<dictcomp>       z3SlackGetChannel._run.<locals>.<listcomp>.<dictcomp>)r   r   r   r   r   )r   r   r   r   
<listcomp>   s   z(SlackGetChannel._run.<locals>.<listcomp>F)ensure_asciizError creating conversation: {})	logging	getLogger__name__clientZconversations_listjsondumps	Exceptionformat)selfr	   r
   resultr   Zfiltered_resulter   r   r   _run   s    

zSlackGetChannel._run)r   
__module____qualname____doc__r   str__annotations__r   r   r   r   r$   r   r   r   r   r   
   s   

r   )
r   r   typingr   r   Zlangchain_core.callbacksr   Z$langchain_community.tools.slack.baser   r   r   r   r   r   <module>   s
   