Skip to content

Commit 7023a12

Browse files
committed
feat: add zh-hans readme
1 parent d24c657 commit 7023a12

File tree

2 files changed

+72
-5
lines changed

2 files changed

+72
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
English | [简体中文](README.zh-Hans.md)
2+
13
# Cnblogs.DashScopeSDK
24

35
An unofficial DashScope SDK maintained by Cnblogs.
@@ -44,8 +46,14 @@ public class YourService(IDashScopeClient client)
4446
}
4547
```
4648

47-
# Supported API
48-
49-
- Text Embedding API
50-
- Text Generation API(qwen-turbo, qwen-max, etc.)
51-
- Multimodal Generation API(qwen-vl-max, etc.)
49+
# Supported APIs
50+
51+
- Text Embedding API - `dashScopeClient.GetTextEmbeddingsAsync()`
52+
- Text Generation API(qwen-turbo, qwen-max, etc.) - `dashScopeClient.GetQwenCompletionAsync()` and `dashScopeClient.GetQWenCompletionStreamAsync()`
53+
- BaiChuan Models - Use `dashScopeClient.GetBaiChuanTextCompletionAsync()`
54+
- LLaMa2 Models - `dashScopeClient.GetLlama2TextCompletionAsync()`
55+
- Multimodal Generation API(qwen-vl-max, etc.) - `dashScopeClient.GetQWenMultimodalCompletionAsync` and `dashScopeClient.GetQWenMultimodalCompletionStreamAsync`
56+
- Wanx Models(Image generation, background generation, etc)
57+
- Image Synthesis - `CreateWanxImageSynthesisTaskAsync()` and `GetWanxImageSynthesisTaskAsync()`
58+
- Image Generation - `CreateWanxImageGenerationTaskAsync` and `GetWanxImageGenerationTaskAsync()`
59+
- Background Image Generation - `CreateWanxBackgroundGenerationTaskAsync` and `GetWanxBackgroundGenerationTaskAsync`

README.zh-Hans.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[English](README.md) | 简体中文
2+
3+
# Cnblogs.DashScopeSDK
4+
5+
由博客园维护并使用的非官方灵积服务 SDK
6+
7+
# 使用方法
8+
9+
## 控制台应用
10+
11+
安装 NuGet 包 `Cnblogs.DashScope.Sdk`
12+
13+
```csharp
14+
var client = new DashScopeClient("your-api-key");
15+
var completion = await client.GetQWenCompletionAsync(QWenLlm.QWenMax, prompt);
16+
Console.WriteLine(completion.Output.Text);
17+
```
18+
19+
## ASP.NET Core 应用
20+
21+
安装 NuGet 包 `Cnblogs.DashScope.AspNetCore`
22+
23+
`Program.cs`
24+
```csharp
25+
builder.AddDashScopeClient(builder.Configuration);
26+
```
27+
28+
`appsettings.json`
29+
```json
30+
{
31+
"DashScope": {
32+
"ApiKey": "your-api-key"
33+
}
34+
}
35+
```
36+
37+
应用类中
38+
```csharp
39+
public class YourService(IDashScopeClient client)
40+
{
41+
public async Task<string> CompletePromptAsync(string prompt)
42+
{
43+
var completion = await client.GetQWenCompletionAsync(QWenLlm.QWenMax, prompt);
44+
return completion.Output.Text;
45+
}
46+
}
47+
```
48+
49+
# 支持的 API
50+
51+
- 通用文本向量 - `dashScopeClient.GetTextEmbeddingsAsync()`
52+
- 通义千问(`qwen-turbo``qwen-max` 等) - `dashScopeClient.GetQwenCompletionAsync()` and `dashScopeClient.GetQWenCompletionStreamAsync()`
53+
- 百川开源大模型 - Use `dashScopeClient.GetBaiChuanTextCompletionAsync()`
54+
- LLaMa2 大语言模型 - `dashScopeClient.GetLlama2TextCompletionAsync()`
55+
- 通义千问 VL 和通义千问 Audio(`qwen-vl-max``qwen-audio`) - `dashScopeClient.GetQWenMultimodalCompletionAsync` and `dashScopeClient.GetQWenMultimodalCompletionStreamAsync`
56+
- 通义万相系列
57+
- 文生图 - `CreateWanxImageSynthesisTaskAsync()` and `GetWanxImageSynthesisTaskAsync()`
58+
- 人像风格重绘 - `CreateWanxImageGenerationTaskAsync` and `GetWanxImageGenerationTaskAsync()`
59+
- 图像背景生成 - `CreateWanxBackgroundGenerationTaskAsync` and `GetWanxBackgroundGenerationTaskAsync`

0 commit comments

Comments
 (0)