Skip to content

Commit

Permalink
Merge pull request #245 from samzong/fix/api-call
Browse files Browse the repository at this point in the history
fix(api-call): endpoint error
  • Loading branch information
windsonsea authored Feb 18, 2025
2 parents 496b99f + 94834c1 commit 6b86b2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/zh/docs/en/models/api-call.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ A model endpoint is a URL or API address that allows users to access and send re
| Invocation Method | Endpoint |
| ----------------- | ------------------- |
| MaaS by Token | `chat.d.run` |
| Model Service | `<region>-02.d.run` |
| Model Service | `<region>.d.run` |

## API Invocation Examples

Expand Down Expand Up @@ -67,7 +67,7 @@ print(response.choices[0].text)
To invoke models using the Model Service method, follow these steps:

1. **Obtain API Key**: Log in to your user console and create a new API Key
2. **Set Endpoint**: Replace the SDK endpoint with `<region>-02.d.run`
2. **Set Endpoint**: Replace the SDK endpoint with `<region>.d.run`
3. **Invoke Model**: Use the official model name along with the new API Key for invocation

**Example Code (Python)**:
Expand All @@ -76,7 +76,7 @@ To invoke models using the Model Service method, follow these steps:
import openai

openai.api_key = "your-api-key" # Replace with your API Key
openai.api_base = "<region>-02.d.run"
openai.api_base = "<region>.d.run"

response = openai.Completion.create(
model="u-1100a15812cc/qwen2",
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/docs/models/api-call.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ d.run 提供了两种大模型的托管方式,您可以根据需求选择其
| 调用方式 | Endpoint |
| ------------- | ------------------- |
| MaaS by Token | `chat.d.run` |
| 模型服务 | `<region>-02.d.run` |
| 模型服务 | `<region>.d.run` |

## API 调用示例

Expand Down

0 comments on commit 6b86b2b

Please sign in to comment.