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. Thanks for all your support!
Installation (and example)
- Install the package from PyPI.
$ python3 -m pip install langchain-discord
- Import the package
from langchain_discord import DiscordWebhookTool
... and all other required packages for the example
from langchain import OpenAI
from langchain.agents import initialize_agent, AgentType
import os
- Initialize and environment variables
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"
- Run the agent
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, or on my website. Donations are also welcome, you can donate to my BuyMeACoffee.
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.
Metadata
Release files for langchain-discord 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_discord-1.0.2.tar.gz | 4.9 kB | Without provenance | Details for langchain_discord-1.0.2.tar.gz |
Release files / langchain_discord-1.0.2.tar.gz
| Download URL | langchain_discord-1.0.2.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9eac57b12daf6face3bbbc8ceea2c195095bdfd82f23e1c582cf50bef9af4b9
|
|
BLAKE2b-256 checksum How to use checksums |
b0526721524f41bce944d219938eee92845181ea177ba724d96e724286f9ffcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for langchain-discord 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.