This repository was archived by the owner on Sep 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Discord endpoint #133
Open
piasekj
wants to merge
6
commits into
main
Choose a base branch
from
dc_endpoint
base: main
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
Discord endpoint #133
Conversation
This file contains hidden or 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
This was
linked to
issues
Apr 16, 2024
discord_bot/discord_bot/bot.py
Outdated
|
|
||
| def query_llm(prompt, stop_signs): | ||
| """Returns llm's response.""" | ||
| url = "http://llm:9000/v1/completions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should query our api when will be ready ;)
api/bot/tests.py
Outdated
| @@ -0,0 +1,3 @@ | |||
| from django.test import TestCase | |||
|
|
|||
| # Create your tests here. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: ;)
discord_bot/discord_bot/bot.py
Outdated
Comment on lines
60
to
63
|
|
||
| respose_status_code = 200 | ||
|
|
||
| if response.status_code == respose_status_code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: use HTTPStatus as you did in views.py
discord_bot/discord_bot/bot.py
Outdated
| """Passes the prompt to the llm and returns the answer.""" | ||
| await interaction.response.defer() | ||
|
|
||
| query = "\n\n### Instructions:\n" + prompt + "\n\n### Response:\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: f-strings are significantly faster
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Endpoint to ask LLM a question through Discord and support for (native) slash commands.
Disclaimer: I couldn't find a way to change function
showinto slash command (at least not yet) because native commands do not return more than 1 message, at least not in the way it is coded here.