Skip to content

Commit

Permalink
Merge pull request #77 from cubenlp/rex/readme
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
RexWzh committed May 1, 2024
2 parents df26473 + c7e0fd8 commit 06e8f79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
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
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

0 comments on commit 06e8f79

Please sign in to comment.