DotNetCore.Dashscope.Sdk
1.0.0
dotnet add package DotNetCore.Dashscope.Sdk --version 1.0.0
NuGet\Install-Package DotNetCore.Dashscope.Sdk -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetCore.Dashscope.Sdk" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetCore.Dashscope.Sdk --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DotNetCore.Dashscope.Sdk, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DotNetCore.Dashscope.Sdk as a Cake Addin
#addin nuget:?package=DotNetCore.Dashscope.Sdk&version=1.0.0
// Install DotNetCore.Dashscope.Sdk as a Cake Tool
#tool nuget:?package=DotNetCore.Dashscope.Sdk&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dashscope.Net
该项目是阿里灵积大模型 SDK 的 C# 版本(.Net 6.0)
参考的版本为:dashscope-sdk-java 2.2.0
使用方式可参考官方的指南:灵积模型API文档
单轮问答
var gen = new Generation();
var param = new QwenParam()
{
Model = Generation.Models.QWEN_V1,
Prompt = "你是谁?",
TopP = 0.8,
};
var result = gen.Call(param);
var returnVal = JsonUtils.ToJson(result);
Console.WriteLine(returnVal);
多轮对话
private static Generation _gen = new();
private static QwenParam _param = new()
{
Model = Generation.Models.QWEN_V1,
TopP = 0.8,
};
public static void MultipleQueryTests()
{
_param.Prompt = "你是谁?";
var result = _gen.Call(_param, true);
var returnVal = JsonUtils.ToJson(result);
Console.WriteLine(returnVal);
_param.Prompt = "我的上一个问题是什么?";
// 注意这里多了一个参数true,代表是否记录并传递对话历史
result = _gen.Call(_param, true);
returnVal = JsonUtils.ToJson(result);
Console.WriteLine(returnVal);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 123 | 8/31/2023 |