This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Conversation
This was
linked to
issues
Apr 16, 2024
|
|
||
| def query_llm(prompt, stop_signs): | ||
| """Returns llm's response.""" | ||
| url = "http://llm:9000/v1/completions" |
Collaborator
There was a problem hiding this comment.
You should query our api when will be ready ;)
| @@ -0,0 +1,3 @@ | |||
| from django.test import TestCase | |||
|
|
|||
| # Create your tests here. | |||
Comment on lines
+60
to
+63
|
|
||
| respose_status_code = 200 | ||
|
|
||
| if response.status_code == respose_status_code: |
Member
There was a problem hiding this comment.
nitpick: use HTTPStatus as you did in views.py
| """Passes the prompt to the llm and returns the answer.""" | ||
| await interaction.response.defer() | ||
|
|
||
| query = "\n\n### Instructions:\n" + prompt + "\n\n### Response:\n" |
Member
There was a problem hiding this comment.
nitpick: f-strings are significantly faster
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
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.