https://github.com/zetavg/llm_assistant_bot
(WIP) LLM powered Slack Bot for assisting you and your team.
https://github.com/zetavg/llm_assistant_bot
assistant gpt llm slack-bot
Last synced: 2 months ago
JSON representation
(WIP) LLM powered Slack Bot for assisting you and your team.
- Host: GitHub
- URL: https://github.com/zetavg/llm_assistant_bot
- Owner: zetavg
- Created: 2023-06-02T04:20:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-05T11:36:37.000Z (about 2 years ago)
- Last Synced: 2025-04-06T04:49:16.787Z (2 months ago)
- Topics: assistant, gpt, llm, slack-bot
- Language: Python
- Homepage:
- Size: 43 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LLM Assistant Bot
LLM powered Slack Bot for assisting you and your team.
> This is a work in progress and currently have the following security concerns:
>
> 1. It's possible that the bot will leak confidential information by searching on Google with those information as the keyword.
> 2. It's possible that the user can trick the bot to execute arbitrary code with the Python REPL tool.Possible use cases: FAQ help desk, new team member onboarding, etc.
Using tools:
https://github.com/zetavg/llm_assistant_bot/assets/3784687/be18a77b-b4bc-4aba-9ce8-2924fa20bca2
Memory, answer questions based on memorized knowledge or imported documents:

## Up and Running
After preparing the environment (such as `conda create python=3.8 -n llm_assistant_bot`),
1. `pip install -r requirements.txt`.
2. `playwright install`.
3. `cp config.yaml.sample config.yaml` and fill in the blanks.
4. `python slack_bot.py`.To enter the console, run `python console.py`.
## Chat Integrations
### Slack Bot
First, create a new app at https://api.slack.com/apps?new_app.
Choice "From an app manifest", and paste the following with `# Fill me!`s replaced:
```yaml
display_information:
name: # Fill me!
features:
bot_user:
display_name: # Fill me!
always_online: false
oauth_config:
scopes:
bot:
- pins:read
- reactions:read
- users:read
- channels:history
- groups:history
- chat:write
- im:history
- im:read
- im:write
- mpim:history
- mpim:read
- mpim:write
settings:
event_subscriptions:
# Example: https://example.com/slack/events
request_url: # Fill me!
bot_events:
- message.channels
- message.groups
- message.im
- message.mpim
- pin_added
- reaction_added
- team_join
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false
```Then, get the `Signing Secret` of the app and fill it in `config.yaml`.
Details
Also, make sure the Request URL of Event Subscription works.
Details
Finally, install the app to your workspace, get the `Bot User OAuth Token` of the app and fill it in `config.yaml`.
Details
To let users send direct messages to the bot, `Allow users to send Slash commands and messages from the messages tab` should be enabled in the bot's settings.
Details
## Importing Documents
```bash
python console.py
``````py
sitemap_loader = langchain.document_loaders.sitemap.SitemapLoader(web_path="https://langchain.readthedocs.io/sitemap.xml")
docs = sitemap_loader.load()text_splitter = langchain.text_splitter.CharacterTextSplitter.from_tiktoken_encoder(chunk_size=100, chunk_overlap=0)
docs = text_splitter.split_documents(docs)add_docs('langchain_docs', docs)
```(See: https://python.langchain.com/en/latest/modules/indexes/document_loaders.html)