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

fix(api-call): endpoint error #245

Merged
merged 1 commit into from
Feb 18, 2025
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
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
Loading