IntelligentAI 0.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package IntelligentAI --version 0.0.2
NuGet\Install-Package IntelligentAI -Version 0.0.2
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="IntelligentAI" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IntelligentAI" Version="0.0.2" />
<PackageReference Include="IntelligentAI" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IntelligentAI --version 0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IntelligentAI, 0.0.2"
#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.
#:package IntelligentAI@0.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IntelligentAI&version=0.0.2
#tool nuget:?package=IntelligentAI&version=0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Code Setup
Getting Started
Using our dotnet package
To start using the Intelligent SDK from scratch, you first need to install the main Nuget package in the project you want to use the components. You can use the NuGet package manager in your IDE for that or use the following command when using a CLI:
dotnet add package IntelligentAI
Register Services
Add the following in Program.cs:
builder.Services.AddAiService(new AiOptions("intelligent api address"));
Quick Start
This is literally all you need in your services to use intelligent components.
private readonly IAiModelService _model;
public YourClass(IAiModelService model)
{
_model = model;
}
Argument
var request = new AiArguments("杭州西湖哪里好玩?");
int model = 6; // 编号为 6 代表阿里云在线 qwen-long 模型
var _cts = new CancellationTokenSource();
var promptId = "prompt10";
var replaces = new Dictionary<string, string>()
{
["正文"] = Content // 提示词占位符替换
};
Text answer
var answer = await _model.AnswerTextAsync(request, model, cancellationToken: _cts.Token);
Streaming answer
StringBuilder streamingContentBuilder = new StringBuilder();
string botAnswer;
// ReturnType: IAsyncEnumerable<string>
// Requirements: .net 8.0 or above
var stream = _model.AnswerStringsAsync(request, model, cancellationToken: _cts.Token);
// ContentType: text/event-stream
var stream = _model.AnswerStreamAsync(request, model, cancellationToken: _cts.Token);
await foreach (var message in stream)
{
streamingContentBuilder.Append(message);
// You can get the answer here
botAnswer = streamingContentBuilder.ToString();
}
// Or you can get the full answer here
botAnswer = streamingContentBuilder.ToString();
Prompt answer
var answer = await _model.AnswerTextByPromptAsync(promptId, replaces, 6, cancellationToken);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Confluent.Kafka (>= 2.5.0)
- F23.StringSimilarity (>= 6.0.0)
- HtmlAgilityPack (>= 1.11.61)
- Microsoft.Extensions.Http (>= 8.0.0)
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.1.0 | 109 | 6/4/2026 | |
| 1.0.2 | 283 | 5/15/2025 | |
| 1.0.1 | 169 | 1/22/2025 | |
| 1.0.0 | 539 | 10/17/2024 | |
| 0.1.1-beta | 219 | 9/11/2024 | |
| 0.1.0-beta | 124 | 9/11/2024 | |
| 0.0.8 | 222 | 9/3/2024 | |
| 0.0.7 | 251 | 8/27/2024 | |
| 0.0.6 | 268 | 8/13/2024 | |
| 0.0.5 | 220 | 8/12/2024 | |
| 0.0.4 | 231 | 8/9/2024 | |
| 0.0.3 | 218 | 8/9/2024 | |
| 0.0.2 | 213 | 8/7/2024 | |
| 0.0.1 | 206 | 8/7/2024 | |
| 0.0.1-alpha | 165 | 8/5/2024 |
- 新增了许可证
- 更新了文档