Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme #77

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ export OPENAI_API_BASE_URL="https://api.example.com" # 可选

Win 在系统中设置环境变量。

注:环境变量中,`OPENAI_API_BASE` 优先于 `OPENAI_API_BASE_URL`,二者选其一即可。
也可以在代码中设置:

```py
import chattool
chattool.api_key = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
chattool.api_base = "https://api.example.com/v1"
```

注:`OPENAI_API_BASE` 优先于 `OPENAI_API_BASE_URL`,二者选其一即可。

### 示例

Expand Down
14 changes: 12 additions & 2 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,20 @@ Set environment variables in `~/.bashrc` or `~/.zshrc`:

```bash
export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export OPENAI_API_BASE_URL="https://api.example.com"
export OPENAI_API_BASE="https://api.example.com/v1"
export OPENAI_API_BASE="https://api.example.com/v1"
export OPENAI_API_BASE_URL="https://api.example.com" # optional
```

Or in Python code:

```py
import chattool
chattool.api_key = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
chattool.api_base = "https://api.example.com/v1"
```

Note: `OPENAI_API_BASE` is prior to `OPENAI_API_BASE_URL`, and you only need to set one of them.

## Examples

Example 1, simulate multi-turn dialogue:
Expand Down
Loading