hongmao.HmExtension.AiChat
1.0.1
dotnet add package hongmao.HmExtension.AiChat --version 1.0.1
NuGet\Install-Package hongmao.HmExtension.AiChat -Version 1.0.1
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="hongmao.HmExtension.AiChat" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add hongmao.HmExtension.AiChat --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: hongmao.HmExtension.AiChat, 1.0.1"
#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 hongmao.HmExtension.AiChat as a Cake Addin #addin nuget:?package=hongmao.HmExtension.AiChat&version=1.0.1 // Install hongmao.HmExtension.AiChat as a Cake Tool #tool nuget:?package=hongmao.HmExtension.AiChat&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AI模块
该模块用于简化各种大模型的调用过程
使用方式
后续会不定期添加支持的模型
星火
1. 创建AI客户端
_client = HmAiChatClientFactory.Create(new XingHuoChatOption()
{
ApiUrl = "",
ApiSecret = "",
AppId =""
});
2. 设置AI的身份(可选)
_client.SetSystemMessage("你是一个经验丰富的C#开发工程师");
3. 发送消息
try
{
//更新授权信息(可在创建客户端时设置)
//_client.Option.ApiSecret = AppSecret;
//_client.Option.ApiUrl = ApiUrl;
//((XingHuoChatOption)_client.Option).AppId = AppId;
// 发送并接收消息
var msg = await _client.SendMessageAsync(XinHuoModel.Lite, contentTb.Text);
}
catch (Exception ex)
{
MessageBox.Show($"发生错误:{ex.Message}");
Console.WriteLine(ex.StackTrace);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.1
- hongmao.HmExtension.Commons (>= 1.0.1.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
更新Readme.md文件