openai-proxy

liuyuqi-dellpc 4bac23e8f2 0 1 year ago
.dockerignore 42518d3f0a init 1 year ago
Dockerfile 42518d3f0a init 1 year ago
README.md 4bac23e8f2 0 1 year ago
ai.http 4bac23e8f2 0 1 year ago
ai.takegpt.cn.conf 42518d3f0a init 1 year ago
docker-compose.debug.yml 4bac23e8f2 0 1 year ago
docker-compose.yml 42518d3f0a init 1 year ago

README.md

ai.takegpt.cn

this is a openai-proxy, using ngixn proxy.

Develop

docker compose -f "openai-proxy/docker-compose.debug.yml" up -d --build

Usage

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?"}
    ]
)