Skip to content

Commit

Permalink
Automated formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias2660 authored Jul 11, 2024
1 parent bfd3079 commit 05e6fea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
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",
)
)

0 comments on commit 05e6fea

Please sign in to comment.