# Discord Langchain
Discord Langchain is a tool for Langchain to use Discord in agents.
It is currently in development and bugs may encounter.
If you find any bugs, please report it to the [issues](https://github.com/0w9/langchain-discord/issues).
Thanks for all your support!
## Installation (and example)
1. Install the package from PyPI.
```bash
$ python3 -m pip install langchain-discord
```
2. Import the package
```python
from langchain_discord import DiscordWebhookTool
```
... and all other required packages for the example
```python
from langchain import OpenAI
from langchain.agents import initialize_agent, AgentType
import os
```
1. Initialize and environment variables
```python
tools = [
DiscordWebhookTool()
]
llm = OpenAI(temperature=0)
agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
os.environ["WEBHOOK_URL"] = "https://discord.com/api/webhooks/<use the webhook url from your discord server>"
os.environ["WEBHOOK_USERNAME"] = "LangChain Agent"
```
2. Run the agent
```python
agent.run("Post a joke to the webhook!")
```
## Notice
This package is in development, more info above.
Currently the package was only tested on the `ZERO_SHOT_REACT_DESCRIPTION` agent.
I'm currently working to add a custom output parser, so it can be used on other agents.
## Support this project
You can support this project by giving a star to this repository, or by reporting all bugs.
I am the only developer of this project, so it may take a while to fix bugs.
You can find more info on my [Twitter](https://twitter.com/lennardeth), or on my [website](https://beachcode.de).
Donations are also welcome, you can donate to my [BuyMeACoffee](https://www.buymeacoffee.com/lennardships).
## License
I don't know a lot about licenses, so I just used the MIT license.
In general it's free to use (both private and for enterprise), but you can't claim it as your own.
Raw data
{
"_id": null,
"home_page": "https://github.com/0w9/langchain-discord",
"name": "langchain-discord",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "AI,LangChain,Discord",
"author": "Lennard Dorst",
"author_email": "Lennard Dorst <lennardsolana@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b0/52/6721524f41bce944d219938eee92845181ea177ba724d96e724286f9ffcd/langchain_discord-1.0.2.tar.gz",
"platform": null,
"description": "# Discord Langchain\n\nDiscord Langchain is a tool for Langchain to use Discord in agents.\nIt is currently in development and bugs may encounter.\nIf you find any bugs, please report it to the [issues](https://github.com/0w9/langchain-discord/issues).\nThanks for all your support!\n\n## Installation (and example)\n\n1. Install the package from PyPI.\n```bash\n$ python3 -m pip install langchain-discord\n```\n\n2. Import the package\n```python\nfrom langchain_discord import DiscordWebhookTool\n```\n\n... and all other required packages for the example\n```python\nfrom langchain import OpenAI\nfrom langchain.agents import initialize_agent, AgentType\nimport os\n```\n\n1. Initialize and environment variables\n```python\ntools = [\n DiscordWebhookTool()\n]\n\nllm = OpenAI(temperature=0)\nagent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)\n\nos.environ[\"WEBHOOK_URL\"] = \"https://discord.com/api/webhooks/<use the webhook url from your discord server>\"\nos.environ[\"WEBHOOK_USERNAME\"] = \"LangChain Agent\"\n```\n\n2. Run the agent\n```python\nagent.run(\"Post a joke to the webhook!\")\n```\n\n## Notice\n\nThis package is in development, more info above.\nCurrently the package was only tested on the `ZERO_SHOT_REACT_DESCRIPTION` agent.\nI'm currently working to add a custom output parser, so it can be used on other agents.\n\n## Support this project\n\nYou can support this project by giving a star to this repository, or by reporting all bugs.\nI am the only developer of this project, so it may take a while to fix bugs.\nYou can find more info on my [Twitter](https://twitter.com/lennardeth), or on my [website](https://beachcode.de). \nDonations are also welcome, you can donate to my [BuyMeACoffee](https://www.buymeacoffee.com/lennardships).\n\n## License\nI don't know a lot about licenses, so I just used the MIT license.\nIn general it's free to use (both private and for enterprise), but you can't claim it as your own. \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A list of tools for LangChain to power Discord (Webhooks, etc.).",
"version": "1.0.2",
"project_urls": {
"Download": "https://github.com/user/reponame/archive/v_01.tar.gz",
"Homepage": "https://github.com/0w9/langchain-discord"
},
"split_keywords": [
"ai",
"langchain",
"discord"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b0526721524f41bce944d219938eee92845181ea177ba724d96e724286f9ffcd",
"md5": "cd9e765f05f89fba1b7a67ed70aaea8f",
"sha256": "e9eac57b12daf6face3bbbc8ceea2c195095bdfd82f23e1c582cf50bef9af4b9"
},
"downloads": -1,
"filename": "langchain_discord-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "cd9e765f05f89fba1b7a67ed70aaea8f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4919,
"upload_time": "2023-05-27T18:50:33",
"upload_time_iso_8601": "2023-05-27T18:50:33.445221Z",
"url": "https://files.pythonhosted.org/packages/b0/52/6721524f41bce944d219938eee92845181ea177ba724d96e724286f9ffcd/langchain_discord-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-27 18:50:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "0w9",
"github_project": "langchain-discord",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "langchain-discord"
}