Skip to content

Commit

Permalink
Merge pull request #33 from UMLCloudComputing/cleanup
Browse files Browse the repository at this point in the history
chore: cleanup unnecessary imports and return information
  • Loading branch information
ultralapse authored Jun 10, 2024
2 parents fb8b4d8 + 45e4430 commit 87a93a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/app/llm.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import boto3
import json
# from dotenv import load_dotenv
import os
import requests

# load_dotenv()

def invoke_llm(input, token):
bedrock = boto3.client(
service_name='bedrock-runtime',
Expand Down Expand Up @@ -35,6 +32,8 @@ def invoke_llm(input, token):

print(token)

print(outputText)

id = os.environ.get("ID")

url = f"https://discord.com/api/webhooks/{id}/{token}/messages/@original"
Expand Down
6 changes: 1 addition & 5 deletions src/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
from mangum import Mangum
from asgiref.wsgi import WsgiToAsgi
from discord_interactions import verify_key_decorator
import threading
import json
import boto3


DISCORD_PUBLIC_KEY = os.environ.get("DISCORD_PUBLIC_KEY")

Expand Down Expand Up @@ -68,7 +64,7 @@ def interact(raw_request):
response = requests.post(url, json=callback_data)
original_message = data["options"][0]["value"]
llm.invoke_llm(original_message, token)
message_content = f"Token {token} \n ID: {id}"
message_content = "none"

# Command /weather [arg1: city]
# Gets the weather in just Lowell for now. Ignores the argument for city
Expand Down

0 comments on commit 87a93a2

Please sign in to comment.