File tree Expand file tree Collapse file tree 2 files changed +72
-5
lines changed Expand file tree Collapse file tree 2 files changed +72
-5
lines changed Original file line number Diff line number Diff line change
1
+ English | [ 简体中文] ( README.zh-Hans.md )
2
+
1
3
# Cnblogs.DashScopeSDK
2
4
3
5
An unofficial DashScope SDK maintained by Cnblogs.
@@ -44,8 +46,14 @@ public class YourService(IDashScopeClient client)
44
46
}
45
47
```
46
48
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 `
Original file line number Diff line number Diff line change
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 `
You can’t perform that action at this time.
0 commit comments