Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Slack Directory Loader #2841

Merged
merged 7 commits into from Apr 14, 2023
Merged

Add Slack Directory Loader #2841

merged 7 commits into from Apr 14, 2023

Conversation

vowelparrot
Copy link
Contributor

Fixes linting issue from #2835

Adds a loader for Slack Exports which can be a very valuable source of
knowledge to use for internal QA bots and other use cases.

# Export data from your Slack Workspace first.
from langchain.document_loaders import SLackDirectoryLoader

SLACK_WORKSPACE_URL = "https://awesome.slack.com"

loader = ("Slack_Exports", SLACK_WORKSPACE_URL)
docs = loader.load()

Copy link
Contributor

@dev2049 dev2049 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth adding simple test or two?

langchain/document_loaders/slack_directory.py Outdated Show resolved Hide resolved
langchain/document_loaders/slack_directory.py Outdated Show resolved Hide resolved
langchain/document_loaders/slack_directory.py Outdated Show resolved Hide resolved
langchain/document_loaders/slack_directory.py Outdated Show resolved Hide resolved
@vowelparrot
Copy link
Contributor Author

@dev2049 refactored, added a couple tests as well.

I also changed the interface to take in a path of a zip file. Why? The user otherwise has to manually unzip the folder, and the default nesting of the export is flat, meaning the directories will all be mixed in if the user unzips it in a pre-populated directory.

This way the user can simply download a zip file and point the loader there and we wont try to load spurious json files

@hwchase17 hwchase17 merged commit bf0887c into master Apr 14, 2023
9 checks passed
@hwchase17 hwchase17 deleted the vwp/slack-directory branch April 14, 2023 04:32
samching pushed a commit to samching/langchain that referenced this pull request May 1, 2023
Fixes linting issue from langchain-ai#2835 

Adds a loader for Slack Exports which can be a very valuable source of
knowledge to use for internal QA bots and other use cases.

```py
# Export data from your Slack Workspace first.
from langchain.document_loaders import SLackDirectoryLoader

SLACK_WORKSPACE_URL = "https://awesome.slack.com"

loader = ("Slack_Exports", SLACK_WORKSPACE_URL)
docs = loader.load()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants