@@ -26,6 +26,8 @@ Console.WriteLine(completion)
2626Install NuGet package ` Cnblogs.DashScope.Sdk `
2727``` csharp
2828var client = new DashScopeClient (" your-api-key" );
29+ // you could use different api base, example:
30+ // var client = new DashScopeClient("your-api-key", "https://dashscope-intl.aliyuncs.com/api/v1/");
2931var completion = await client .GetTextCompletionAsync (
3032 new ModelRequest <TextGenerationInput , ITextGenerationParameters >()
3133 {
@@ -57,7 +59,8 @@ builder.AddDashScopeClient(builder.Configuration);
5759``` json
5860{
5961 "DashScope" : {
60- "ApiKey" : " your-api-key"
62+ "ApiKey" : " your-api-key" ,
63+ "BaseAddress" : " https://dashscope-intl.aliyuncs.com/api/v1"
6164 }
6265}
6366```
@@ -90,15 +93,15 @@ public class YourService(IDashScopeClient client)
9093## Supported APIs
9194- [ Text Generation] ( #text-generation ) - QWen3, DeepSeek, etc. Supports reasoning/tool calling/web search/translation scenarios
9295 - [ Conversation] ( #conversation )
93- - [ Deep Thinking] ( #deep- thinking )
96+ - [ Thinking Models ] ( #thinking-models )
9497 - [ Web Search] ( #web-search )
9598 - [ Tool Calling] ( #tool-calling )
9699 - [ Prefix Completion] ( #prefix-completion )
97100 - [ Long Context (Qwen-Long)] ( #long-context-qwen-long )
98101- [ Multimodal] ( #multimodal ) - QWen-VL, QVQ, etc. Supports reasoning/visual understanding/OCR/audio understanding
99102- [ Text-to-Speech] ( #text-to-speech ) - CosyVoice, Sambert, etc. For TTS applications
100103- [ Image Generation] ( #image-generation ) - wanx2.1, etc. For text-to-image and portrait style transfer
101- - [ Application Invocation ] ( #application-invocation )
104+ - [ Application Call ] ( #application-call )
102105- [ Text Embeddings] ( #text-embeddings )
103106
104107
@@ -167,13 +170,12 @@ while (true)
167170}
168171```
169172
170- #### Thinking Models
173+ ### Thinking Models
171174
172175The model's thinking process is stored in a separate ` ReasoningContent ` property. When saving to conversation history, ignore it and only keep the model's reply ` Content ` .
173176
174177Some models accept ` EnableThinking ` to control deep thinking, which can be set in ` Parameters ` .
175178
176- For more settings on thinking models, see [ Deep Thinking] ( #deep-thinking ) below.
177179``` csharp
178180var messages = new List <TextChatMessage >();
179181messages .Add (TextChatMessage .System (" You are a helpful assistant" ));
@@ -504,7 +506,7 @@ Console.WriteLine(completion.Output.Choices[0].Message.Content);
504506await dashScopeClient .DeleteFileAsync (uploadedFile .Id );
505507```
506508
507- ### Multimodal
509+ ## Multimodal
508510Use ` GetMultimodalGenerationAsync ` /` GetMultimodalGenerationStreamAsync `
509511[ Official Documentation] ( https://help.aliyun.com/zh/model-studio/multimodal )
510512
@@ -562,7 +564,7 @@ await foreach (var modelResponse in response)
562564 }
563565}
564566```
565- ### Text-to-Speech
567+ ## Text-to-Speech
566568
567569Create a speech synthesis session using ` dashScopeClient.CreateSpeechSynthesizerSocketSessionAsync() ` .
568570
@@ -583,8 +585,8 @@ await foreach (var b in tts.GetAudioAsync())
583585}
584586Console .WriteLine ($" Audio saved to {file .FullName }" );
585587```
586- ### Image Generation
587- #### Text-to-Image
588+ ## Image Generation
589+ ### Text-to-Image
588590Use shortcuts for Wanx models:
589591``` csharp
590592var task = await dashScopeClient .CreateWanxImageSynthesisTaskAsync (
@@ -610,7 +612,7 @@ Use `CreateWanxImageGenerationTaskAsync` and `GetWanxImageGenerationTaskAsync`
610612
611613Use ` CreateWanxBackgroundGenerationTaskAsync ` and ` GetWanxBackgroundGenerationTaskAsync `
612614
613- ### Application Call
615+ ## Application Call
614616``` csharp
615617var request =
616618 new ApplicationRequest ()
@@ -670,7 +672,7 @@ var response = await client.GetApplicationResponseAsync("your-application-id", r
670672Console .WriteLine (response .Output .Text );
671673```
672674
673- ### Text Vectorization
675+ ## Text Embeddings
674676
675677``` csharp
676678var text = " Sample text for embedding" ;
0 commit comments