-
Notifications
You must be signed in to change notification settings - Fork 0
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
POC: AI #65
base: main
Are you sure you want to change the base?
POC: AI #65
Conversation
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.
Try this one-liner
Or you could use numpy.array_split
for this, though I guess it's a little overkill and you need to convert them all back into strings later
], | ||
stream=False | ||
) | ||
return completion.choices[0].message.content |
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.
needs error handling pain (a try catch maybe)
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.
Will need to fix integration tests for this lol (monkeypatch away OpenAI
)
models = list_models() | ||
await interaction.followup.send("\n".join(models)) | ||
except Exception as e: | ||
await interaction.followup.send(f"An error occurred: {e}") |
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.
ephemeral=True
on error maybe
guilds=guilds, | ||
) | ||
@app_commands.describe(question="The question you want to ask the AI") | ||
async def llm(interaction: discord.Interaction, question: str, model: str = ""): |
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.
- I think the list of models already be specified as discord
Choice
s - Provide a default one since users probably don't care/know the differences between each model
Proof of concept of LLM implementation
Requires the following environment variables in
.env
:You could use an OpenAI API key to test it
For use with Ollama models, refer to this. The bot deployment will be using a model deployed on my server