|
1 year ago | |
---|---|---|
.dockerignore | 1 year ago | |
Dockerfile | 1 year ago | |
README.md | 1 year ago | |
ai.http | 1 year ago | |
ai.takegpt.cn.conf | 1 year ago | |
docker-compose.debug.yml | 1 year ago | |
docker-compose.yml | 1 year ago |
this is a openai-proxy, using ngixn proxy.
docker compose -f "openai-proxy/docker-compose.debug.yml" up -d --build
wget https://git.yoqi.me/lyq/openai-proxy/raw/master/docker-compose.yml
docker-compose up -d
import openai
openai.api_key = api_key
openai.api_base = "ai.takegpt.cn"
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)