Skip to content

Commit

Permalink
chore: update readme, pypi keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
KenyonY committed May 21, 2023
1 parent cff310c commit 6f376a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ api的服务器上,通过该服务转发OpenAI的请求。即搭建反向代

---

本项目搭建的长期代理地址
> https://api.openai-forward.top/v1/chat/completions
由本项目搭建的长期代理地址
> https://api.openai-forward.top
或者说 https://api.openai-forward.top 等价于 https://api.openai.com

---

## 目录

Expand All @@ -70,8 +68,8 @@ api的服务器上,通过该服务转发OpenAI的请求。即搭建反向代

**高级功能**
- [x] 实时记录聊天记录(包括流式响应的聊天内容)
- [x] 允许输入多个openai api key 形成轮询池
- [x] 自定义forward api key 代替 openai api key (见高级配置)
- [x] 允许输入多个openai api key 组成轮询池
- [x] 自定义 api key (见高级配置)
- [x] 支持请求IP验证(IP白名单与黑名单)

## 部署指南
Expand Down Expand Up @@ -122,7 +120,7 @@ docker run -d \
openai.api_key = "sk-******"
```

**bash**
**gpt-3.5-turbo**
```bash
curl https://api.openai-forward.top/v1/chat/completions \
-H "Content-Type: application/json" \
Expand All @@ -133,6 +131,7 @@ curl https://api.openai-forward.top/v1/chat/completions \
}'
```

**Image Generation (DALL-E)**
```bash
curl --location 'https://api.openai-forward.top/v1/images/generations' \
--header 'Authorization: Bearer sk-******' \
Expand All @@ -154,6 +153,8 @@ curl --location 'https://api.openai-forward.top/v1/images/generations' \
| --port | 服务端口号 | 8000 |
| --workers | 工作进程数 | 1 |

更多参数 `openai-forward run --help` 查看

**环境变量配置项**
支持从运行目录下的`.env`文件中读取:

Expand All @@ -167,21 +168,6 @@ curl --location 'https://api.openai-forward.top/v1/images/generations' \
| IP_WHITELIST | ip白名单, 空格分开 ||
| IP_BLACKLIST | ip黑名单, 空格分开 ||

## 聊天日志

保存路径在当前目录下的`Log/`路径中。
聊天日志以 `chat_`开头, 默认每5轮对话写入一次文件
记录格式为

```text
{'host': xxx, 'model': xxx, 'message': [{'user': xxx}, {'assistant': xxx}]}
{'assistant': xxx}
{'host': ...}
{'assistant': ...}
...
```

## 高级配置

Expand All @@ -199,7 +185,7 @@ FORWARD_KEY=fk-****** # 这里fk-token由我们自己定义
```bash
curl https://api.openai-forward.top/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fk-mytoken-abcd" \
-H "Authorization: Bearer fk-******" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
Expand All @@ -222,6 +208,22 @@ docker run -d \
yidadaa/chatgpt-next-web
```

## 聊天日志

保存路径在当前目录下的`Log/`路径中。
聊天日志以 `chat_`开头, 默认每5轮对话写入一次文件
记录格式为

```text
{'host': xxx, 'model': xxx, 'message': [{'user': xxx}, {'assistant': xxx}]}
{'assistant': xxx}
{'host': ...}
{'assistant': ...}
...
```

## Backer and Sponsor

<a href="https://www.jetbrains.com/?from=beidongjiedeguang/openai-forward" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
license = "MIT"
requires-python = ">=3.6"
readme = "README.md"
keywords = ["openai", "chatgpt", "openai-api", "openai-proxy", "forward", "streaming-api", "fastapi", "python"]
keywords = ["openai", "chatgpt", "openai-api", "openai-proxy", "OpenAI API Forwarding", "streaming-api", "fastapi", "python", "httpx"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
Expand Down

0 comments on commit 6f376a8

Please sign in to comment.