Skip to content
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

Automated formatting changes #12

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions cogs/ChatBotPrompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ async def simple_query(
if len(message) < 1:
await interaction.response.send_message("Please provide a query")
return

if "gpt" in model:
response = gptFunctions.perform_gpt_query(query=message, model=model)
elif "gemini" in model:
response = gptFunctions.perform_google_query(query=message, model=model)

embed = discord.Embed(title="Chatbot Prompt", color=discord.Color.blue())
embed.set_author(
name=f"query by {interaction.user.display_name} and response from {model}",
Expand Down Expand Up @@ -78,18 +78,21 @@ async def list_models(self, interaction: discord.Interaction):
)
async def max_context(self, interaction: discord.Interaction):
context = gptFunctions.get_input_contexts()
await interaction.response.send_message("\n".join(f"{key}: {value}" for key, value in context.items()))

await interaction.response.send_message(
"\n".join(f"{key}: {value}" for key, value in context.items())
)

@commands.cooldown(1, 15, commands.BucketType.user)
@app_commands.command(
name="max_output",
description="lists the max number of output tokens a model can have",
)
async def max_output(self, interaction: discord.Interaction):
output = gptFunctions.get_output_contexts()
await interaction.response.send_message("\n".join(f"{key}: {value}" for key, value in output.items()))
await interaction.response.send_message(
"\n".join(f"{key}: {value}" for key, value in output.items())
)



async def setup(client):
await client.add_cog(ChatBotPrompts(client))
8 changes: 7 additions & 1 deletion utils/gptFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,10 @@ def get_output_contexts() -> set:

if __name__ == "__main__":
print("hello")
print(perform_google_query(system_message, "Write a poem about Discord in the writing of Emily Dickenson", "gemini-1.5-pro"))
print(
perform_google_query(
system_message,
"Write a poem about Discord in the writing of Emily Dickenson",
"gemini-1.5-pro",
)
)
Loading