GAF to migrate items to settings and set up security for later

This commit is contained in:
adamoutler 2023-02-05 21:57:03 +00:00
parent df753d77ee
commit 47cc5fae55
2 changed files with 10 additions and 5 deletions

View File

@ -13,9 +13,7 @@ openai.organization = "org-hNNV1yHjZp7T3pn5pdZWaKLm"
URL="https://api.openai.com/v1/completions"
PROMPTS=["Say \"USERNAME does not give a fuck\" in a thoughtful and clever paragraph of 5 sentences.",
"Say \"USERNAME does not give a fuck\" in a Dr Suess poem.",
"Tell me all about how much \"USERNAME does not give a fuck\" using your most colorful words."]
DATA = {"model": "text-davinci-003",
"prompt": PROMPTS[0],
"temperature":1,
@ -49,6 +47,7 @@ class IDGAFServer(BaseHTTPRequestHandler):
def get_response_base_object(text):
resultObject={}
resultObject["message"]={}
resultObject["service"]="AIDGAF Server"
resultObject["message"]["data"]={}
resultObject["message"]["data"]["resultObject"]=text
resultObject["timestamp"]=datetime.utcnow().timestamp()
@ -65,7 +64,7 @@ def parse_idgaf_request(command):
return [gpt_response.status_code,json_result]
def get_prompt(command):
my_prompt=random.choice(PROMPTS)
my_prompt=random.choice(settings.PROMPTS)
my_prompt=my_prompt.replace("USERNAME",command['message']['data']['username'])
print("Prompt selected: "+my_prompt)

View File

@ -4,4 +4,10 @@ HOSTNAME:str = os.getenv('HOSTNAME') #localhost
#The port to broadcast the server
SERVERPORT:int = int(os.getenv('SERVERPORT')) #8087
#The API key for OpenAI
APIKEY:str = os.getenv('APIKEY') #secret key
APIKEY:str = os.getenv('APIKEY') #secret key
#The hash key
HASHKEY:str = os.getenv('HASHKEY') #shared secret for hmac of message
#The prompts used for OpenAI.
PROMPTS=["Say \"USERNAME does not give a fuck\" in a thoughtful and clever paragraph of 5 sentences.",
"Say \"USERNAME does not give a fuck\" in a Dr Suess poem.",
"Tell me all about how much \"USERNAME does not give a fuck\" using your most colorful words."]