This will automatically retrieve data from the workspace associated with the user’s token.
Copy
import osfrom embedchain import Appos.environ["SLACK_USER_TOKEN"] = "xoxp-xxx"app = App()app.add("in:general", data_type="slack")result = app.query("what are the messages in general channel?")print(result)
NOTE: you can also pass the config with base_url, headers, team_id to setup your SlackLoader.
Once you setup the loader, you can create an app and load data using the above slack loader
Copy
import osfrom embedchain.pipeline import Pipeline as Appapp = App()app.add("in:random", data_type="slack", loader=loader)question = "Which bots are available in the slack workspace's random channel?"# Answer: The available bot in the slack workspace's random channel is the Embedchain bot.
We automatically create a chunker to chunk your slack data, however if you wish to provide your own chunker class. Here is how you can do that: