Compare commits
No commits in common. "d3aa46e0fce623517d9903d5550264dddbcb0e62" and "47cc5fae55dc5385eff004ba447e06a91b21af70" have entirely different histories.
d3aa46e0fc
...
47cc5fae55
23
Dockerfile
23
Dockerfile
@ -1,23 +0,0 @@
|
||||
# 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"]
|
@ -15,7 +15,7 @@ openai.organization = "org-hNNV1yHjZp7T3pn5pdZWaKLm"
|
||||
URL="https://api.openai.com/v1/completions"
|
||||
|
||||
DATA = {"model": "text-davinci-003",
|
||||
"prompt": settings.PROMPTS[0],
|
||||
"prompt": PROMPTS[0],
|
||||
"temperature":1,
|
||||
"max_tokens": 200
|
||||
}
|
||||
|
@ -1,12 +1,10 @@
|
||||
import os
|
||||
#The hostname used by this app
|
||||
HOSTNAME:str = os.getenv('HOSTNAME') #localhost or some name
|
||||
HOSTNAME:str = os.getenv('HOSTNAME') #localhost
|
||||
#The port to broadcast the server
|
||||
SERVERPORT:int = int(os.getenv('SERVERPORT')) #8087 or the port you want to run on. pass in with docker -e command.
|
||||
SERVERPORT:int = int(os.getenv('SERVERPORT')) #8087
|
||||
#The API key for OpenAI
|
||||
APIKEY:str = os.getenv('APIKEY') #secret key from OpenAPI website
|
||||
if APIKEY is None:
|
||||
raise Exception("APIKEY Environmental Variable must be set")
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user