-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Implement Discord API Server Integration #1956
Open
berrytern
wants to merge
13
commits into
langflow-ai:dev
Choose a base branch
from
berrytern:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rd webhook service. # Aider chat conversation: USER: I need you to update my docker-compose.yml to also run my discord webhook that was set, the discord runs at 7880 ASSISTANT: Here are the diffs for the changes to the `docker-compose.yml` file to include the Discord webhook service running at port 7880: ```diff --- docker-compose.yml +++ docker-compose.yml @@ ... @@ backend: build: context: ./ dockerfile: ./dev.Dockerfile env_file: - .env ports: - "7860:7860" + - "7880:7880" volumes: - ./:/app command: bash -c "uvicorn --factory langflow.main:create_app --host 0.0.0.0 --port 7860 --reload --loop asyncio" networks: - langflow ``` This change adds the port `7880` to the `ports` section of the `backend` service in your `docker-compose.yml`, allowing the Discord webhook to be accessible externally on port `7880`.
…n port 7880 in the background when executing `docker-compose up --build`. # Aider chat conversation: USER: THis way it will be already running int he background when I do docker compose up --build ? if not do it this way ASSISTANT: To ensure that the Discord service runs in the background when you execute `docker-compose up --build`, I will modify the `docker-compose.yml` file to include the necessary configuration for the Discord service. This will involve setting up a separate service within the Docker Compose configuration that specifically handles the Discord functionality on port 7880. Here are the diffs for the changes to the `docker-compose.yml` file: ```diff --- docker-compose.yml +++ docker-compose.yml @@ ... @@ backend: build: context: ./ dockerfile: ./dev.Dockerfile env_file: - .env ports: - "7860:7860" volumes: - ./:/app command: bash -c "uvicorn --factory langflow.main:create_app --host 0.0.0.0 --port 7860 --reload --loop asyncio" networks: - langflow + discord: + build: + context: ./ + dockerfile: ./dev.Dockerfile + env_file: + - .env + ports: + - "7880:7880" + volumes: + - ./:/app + command: bash -c "uvicorn --factory langflow.main:create_discord_app --host 0.0.0.0 --port 7880 --reload --loop asyncio" + networks: + - langflow ``` This change adds a new service named `discord` to the `docker-compose.yml` file. It uses the same Dockerfile and environment file as the `backend` service but runs a different command to start the Discord application on port 7880. This ensures that both the main application and the Discord service are up and running when you build and run the Docker Compose setup.
<fix> sharing /temp folder between discord and backend
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import sys | ||
import aiohttp | ||
|
||
with open(file_path, "rb") as file: |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
This path depends on a .
user-provided value
Error loading related location
Loading random_string = "".join(random.choice(characters) for _ in range(64)) | ||
waveform = base64.b64encode(random_string.encode("utf-8")).decode("utf-8") | ||
url = f"https://discord.com/api/v9/channels/{channel_id}/attachments" | ||
with open(file_path, "rb") as file: |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
This path depends on a .
user-provided value
Error loading related location
Loading
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request implements an API server for Discord communication, enabling internal component interactions through various key functionalities:
The implementation separates the Discord functionalities into a distinct Docker image (approximately 300 MB) built using multi-stage builds. We recommend reviewing this approach for potential implementation in the Langflow Dockerfile, for example. The solution is ready for use, and the components to interact with Discord are already available in the store.