
    h                     R    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e      Z	y)    N)AnyOptional)CallbackManagerForToolRun)SlackBaseToolc                   N    e Zd ZU dZdZeed<   dZeed<   ddded	e	e
   d
efdZy)SlackGetChannelz)Tool that gets Slack channel information.get_channelid_name_dictnamezHUse this tool to get channelid-name dict. There is no input to this tooldescriptionN)run_managerargsr   returnc          
      l   	 t        j                  t               | j                  j	                         }|d   }|D cg c]&  }d|v r d|v rd|v rd|v rdD ci c]  }|||   
 c}( }}}t        j                  |d      S c c}w c c}}w # t        $ r}d	j                  |      cY d }~S d }~ww xY w)
Nchannelsidr
   creatednum_members)r   r
   r   r   F)ensure_asciizError creating conversation: {})	logging	getLogger__name__clientconversations_listjsondumps	Exceptionformat)	selfr   r   resultr   channelkeyfiltered_resultes	            i/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/langchain_community/tools/slack/get_channel.py_runzSlackGetChannel._run   s    	?h'[[335Fj)H  (7?g%(!W, /WWsgcl"WO  ::oEBB X  	?4;;A>>	?s@   =B B	B%B	*B B		B 	B3B.(B3.B3)r   
__module____qualname____doc__r
   str__annotations__r   r   r   r   r%        r$   r   r   
   sH    3)D#)R  
 NR??'/0I'J?	?r,   r   )
r   r   typingr   r   langchain_core.callbacksr   $langchain_community.tools.slack.baser   r   r+   r,   r$   <module>r0      s         > >?m ?r,   