Skip to content

Commit

Permalink
🐛 Bug: Fix bug in total time calculation
Browse files Browse the repository at this point in the history
✨ Feature: Add support for storing the number ofinput and output tokens to the database.

📖 Docs: Update documentation

💻 Code: Refactor code: Use UUID for each request
  • Loading branch information
yym68686 committed Sep 28, 2024
1 parent b5244f2 commit 09c584b
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 53 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ node_modules
*.png
*.db
.aider*
.idea
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ api_keys:
AUTO_RETRY: true
```
If you do not want to set available channels for each `api` one by one in `api_keys`, `uni-api` supports setting the `api key` to be able to use all models. The configuration is as follows:

```yaml
# ... providers configuration unchanged ...
api_keys:
- api: sk-LjjI60Yf0JFWxfgRmXqFWyGtWUd9GZnmi3KlvowmRWpWpQRo # API Key, users need an API key to request uni-api, required
model: # The model that can be used with this API Key, required
- * # Can use all models in all channels set under providers, no need to add available channels one by one.
# ... other configurations unchanged ...
```

## Environment Variables

- CONFIG_URL: The download address of the configuration file, it can be a local file or a remote file, optional
Expand Down
11 changes: 11 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ api_keys:
AUTO_RETRY: true
```
如果你不想在 `api_keys` 里面给每个 `api` 一个个设置可用渠道,`uni-api` 支持将 `api key` 设置为可以使用所有模型,配置如下:

```yaml
# ... providers 配置不变 ...
api_keys:
- api: sk-LjjI60Yf0JFWxfgRmXqFWyGtWUd9GZnmi3KlvowmRWpWpQRo # API Key,用户请求 uni-api 需要 API key,必填
model: # 该 API Key 可以使用的模型,必填
- * # 可以使用 providers 下面设置的所有渠道里面的所有模型,不需要一个个添加可用渠道。
# ... 其他配置不变 ...
```

## 环境变量

- CONFIG_URL: 配置文件的下载地址,可以是本地文件,也可以是远程文件,选填
Expand Down
Loading

0 comments on commit 09c584b

Please sign in to comment.