Compare commits
3 Commits
47cc5fae55
...
d3aa46e0fc
Author | SHA1 | Date | |
---|---|---|---|
|
d3aa46e0fc | ||
|
72e545a0da | ||
|
baa241ca14 |
23
Dockerfile
Normal file
23
Dockerfile
Normal 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"]
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user