openai-proxy

liuyuqi-dellpc 42518d3f0a init 1 year ago
.dockerignore 42518d3f0a init 1 year ago
Dockerfile 42518d3f0a init 1 year ago
README.md 42518d3f0a init 1 year ago
ai.takegpt.cn.conf 42518d3f0a init 1 year ago
docker-compose.debug.yml 42518d3f0a init 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 build -t jianboy/aitakegpt:latest .
docker-compose up -d

Usage

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