-
Notifications
You must be signed in to change notification settings - Fork 1
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
Discord endpoint #133
base: main
Are you sure you want to change the base?
Discord endpoint #133
Conversation
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
|
||
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
Endpoint to ask LLM a question through Discord and support for (native) slash commands.
Disclaimer: I couldn't find a way to change function
show
into 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.