§
    šŠtj�  ã                  óÚ   — 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
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 erd dlmZ n	 d dlmZ n# e$ r Y nw xY w G d„ de¦  «        ZdS )é    )Úannotations)ÚTYPE_CHECKINGÚList)ÚBaseTool)ÚBaseToolkit)Ú
ConfigDictÚField)ÚSlackGetChannel)ÚSlackGetMessage)ÚSlackScheduleMessage)ÚSlackSendMessage)Úlogin)Ú	WebClientc                  óV   — e Zd ZU dZ ee¬¦  «        Zded<    ed¬¦  «        Z	dd	„Z
d
S )ÚSlackToolkitaW
  Toolkit for interacting with Slack.

    Parameters:
        client: The Slack client.

    Setup:
        Install ``slack_sdk`` and set environment variable ``SLACK_USER_TOKEN``.

        .. code-block:: bash

            pip install -U slack_sdk
            export SLACK_USER_TOKEN="your-user-token"

    Key init args:
        client: slack_sdk.WebClient
            The Slack client.

    Instantiate:
        .. code-block:: python

            from langchain_community.agent_toolkits import SlackToolkit

            # Using environment variables (default)
            toolkit = SlackToolkit()

            # Or with an existing WebClient instance
            from slack_sdk import WebClient
            client = WebClient(token="your-user-token")
            toolkit = SlackToolkit(client=client)

    Tools:
        .. code-block:: python

            tools = toolkit.get_tools()
            tools

        .. code-block:: none

            [SlackGetChannel(client=<slack_sdk.web.client.WebClient object at 0x113caa8c0>),
            SlackGetMessage(client=<slack_sdk.web.client.WebClient object at 0x113caa4d0>),
            SlackScheduleMessage(client=<slack_sdk.web.client.WebClient object at 0x113caa440>),
            SlackSendMessage(client=<slack_sdk.web.client.WebClient object at 0x113caa410>)]

    Use within an agent:
        .. code-block:: python

            from langchain_openai import ChatOpenAI
            from langgraph.prebuilt import create_react_agent

            llm = ChatOpenAI(model="gpt-4o-mini")
            agent_executor = create_react_agent(llm, tools)

            example_query = "When was the #general channel created?"

            events = agent_executor.stream(
                {"messages": [("user", example_query)]},
                stream_mode="values",
            )
            for event in events:
                message = event["messages"][-1]
                if message.type != "tool":  # mask sensitive information
                    event["messages"][-1].pretty_print()

        .. code-block:: none

             ================================[1m Human Message [0m=================================

            When was the #general channel created?
            ==================================[1m Ai Message [0m==================================
            Tool Calls:
            get_channelid_name_dict (call_NXDkALjoOx97uF1v0CoZTqtJ)
            Call ID: call_NXDkALjoOx97uF1v0CoZTqtJ
            Args:
            ==================================[1m Ai Message [0m==================================

            The #general channel was created on timestamp 1671043305.
    )Údefault_factoryr   ÚclientT)Úarbitrary_types_allowedÚreturnúList[BaseTool]c                ó¦   — t          | j        ¬¦  «        t          | j        ¬¦  «        t          | j        ¬¦  «        t	          | j        ¬¦  «        gS )zGet the tools in the toolkit.)r   )r
   r   r   r   r   )Úselfs    ún/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langchain_community/agent_toolkits/slack/toolkit.pyÚ	get_toolszSlackToolkit.get_toolso   sN   € õ  4¤;Ð/Ñ/Ô/Ý 4¤;Ð/Ñ/Ô/Ý ¨¬Ð4Ñ4Ô4Ý D¤KÐ0Ñ0Ô0ð	
ð 	
ó    N)r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   Ú__annotations__r   Úmodel_configr   © r   r   r   r      sp   € € € € € € ðLð Lð\ ˜¨eÐ4Ñ4Ô4€FÐ4Ð4Ð4Ñ4à�:Ø $ðñ ô €Lð
ð 
ð 
ð 
ð 
ð 
r   r   N)Ú
__future__r   Útypingr   r   Úlangchain_core.toolsr   Úlangchain_core.tools.baser   Úpydanticr   r	   Ú+langchain_community.tools.slack.get_channelr
   Ú+langchain_community.tools.slack.get_messager   Ú0langchain_community.tools.slack.schedule_messager   Ú,langchain_community.tools.slack.send_messager   Ú%langchain_community.tools.slack.utilsr   Ú	slack_sdkr   ÚImportErrorr   r"   r   r   ú<module>r/      sZ  ðØ "Ð "Ð "Ð "Ð "Ð "à &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à )Ð )Ð )Ð )Ð )Ð )Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à GÐ GÐ GÐ GÐ GÐ GØ GÐ GÐ GÐ GÐ GÐ GØ QÐ QÐ QÐ QÐ QÐ QØ IÐ IÐ IÐ IÐ IÐ IØ 7Ð 7Ð 7Ð 7Ð 7Ð 7àð à#Ð#Ð#Ð#Ð#Ð#Ð#ðà'Ð'Ð'Ð'Ð'Ð'Ð'øØð ð ð Øˆðøøøð\
ð \
ð \
ð \
ð \
�;ñ \
ô \
ð \
ð \
ð \
s   ÁA ÁAÁA