upload README

This commit is contained in:
LanQian 2024-04-05 05:11:25 +08:00
parent fe558933bf
commit 3fee10e2a4
3 changed files with 104 additions and 0 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 aurora-develop
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

70
README.md Normal file
View File

@ -0,0 +1,70 @@
# CHAT2API
免费的GPT3.5 api
### 注仅ip属地支持免登录使用ChatGpt可以使用
## Deploy
### 直接部署
```bash
git clone https://github.com/LanQian528/chat2api
cd chat2api
pip install -r requirements.txt
python chat2api.py
```
### Docker部署
您需要安装Docker和Docker Compose。
```bash
docker run -d \
--name chat2api \
-p 5005:5005 \
lanqian528/chat2api:latest
```
### Docker Compose部署
创建一个新的目录例如chat2api并进入该目录
```bash
mkdir chat2api
cd chat2api
```
在此目录中下载库中的docker-compose.yml文件
```bash
docker-compose up -d
```
## Usage
```bash
curl --location 'http://127.0.0.1:5005/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"stream": true
}'
```
## 高级设置
默认情况不需要设置,除非你有需求
### 环境变量
```
PROXY_URL=http://username:password@proxy:port
CHATGPT_BASE_URL=https://chat.openai.com/backend-anon
HISTORY_DISABLED=true
```
[//]: # (## 鸣谢)
[//]: # ()
[//]: # (感谢各位大佬的pr支持感谢。)
## License
MIT License

13
docker-compose.yml Normal file
View File

@ -0,0 +1,13 @@
version: '3'
services:
app:
image: lanqian528/chat2api:latest
container_name: chat2api
restart: unless-stopped
ports:
- '5005:5005'
# environment:
# - PROXY_URL=http://username:password@proxy:port
# - CHATGPT_BASE_URL=https://chat.openai.com/backend-anon
# - HISTORY_DISABLED=true