Compare commits

...

3 Commits

Author SHA1 Message Date
adamoutler
d3aa46e0fc GAF to add dockerfile 2023-02-05 23:58:19 +00:00
adamoutler
72e545a0da GAF to add descriptions to settings 2023-02-05 23:58:05 +00:00
adamoutler
baa241ca14 GAF to fix error inn settings migration 2023-02-05 23:57:52 +00:00
3 changed files with 29 additions and 4 deletions

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
# docker build -t aidgaf .
#for test
# docker run --rm -eSERVERPORT=8087 -eAPIKEY=sk-AaKV.........................HZ4v2ipzFm6 -p8087:8087 -it aidgaf
# curl -X PATCH http://127.0.0.1:8087 -d "{\"message\":{\"command\":\"aidgaf\",\"data\":{\"username\":\"AdamOutler\"}}}"
#for deployment
# docker run --rm \
# -eSERVERPORT=8087 \
# -eHOSTNAME=localhost \
# -eHASHKEY=Password123 \
# -eAPIKEY=sk-AaKV.........................HZ4v2ipzFm6 \
# -p8087:8087 \
# --restart=always \
# aidgaf
FROM alpine:latest
RUN apk add python3 py3-pip \
&& pip3 install openai\
&& mkdir /app
COPY src/aidgaf /app
RUN
CMD aidgaf
ENTRYPOINT ["/usr/bin/python","/app/aidgaf-server/__main__.py"]

View File

@ -15,7 +15,7 @@ openai.organization = "org-hNNV1yHjZp7T3pn5pdZWaKLm"
URL="https://api.openai.com/v1/completions" URL="https://api.openai.com/v1/completions"
DATA = {"model": "text-davinci-003", DATA = {"model": "text-davinci-003",
"prompt": PROMPTS[0], "prompt": settings.PROMPTS[0],
"temperature":1, "temperature":1,
"max_tokens": 200 "max_tokens": 200
} }

View File

@ -1,10 +1,12 @@
import os import os
#The hostname used by this app #The hostname used by this app
HOSTNAME:str = os.getenv('HOSTNAME') #localhost HOSTNAME:str = os.getenv('HOSTNAME') #localhost or some name
#The port to broadcast the server #The port to broadcast the server
SERVERPORT:int = int(os.getenv('SERVERPORT')) #8087 SERVERPORT:int = int(os.getenv('SERVERPORT')) #8087 or the port you want to run on. pass in with docker -e command.
#The API key for OpenAI #The API key for OpenAI
APIKEY:str = os.getenv('APIKEY') #secret key APIKEY:str = os.getenv('APIKEY') #secret key from OpenAPI website
if APIKEY is None:
raise Exception("APIKEY Environmental Variable must be set")
#The hash key #The hash key
HASHKEY:str = os.getenv('HASHKEY') #shared secret for hmac of message HASHKEY:str = os.getenv('HASHKEY') #shared secret for hmac of message
#The prompts used for OpenAI. #The prompts used for OpenAI.