FaceMan.SemanticHub 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FaceMan.SemanticHub --version 1.0.2                
NuGet\Install-Package FaceMan.SemanticHub -Version 1.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="FaceMan.SemanticHub" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FaceMan.SemanticHub --version 1.0.2                
#r "nuget: FaceMan.SemanticHub, 1.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.
// Install FaceMan.SemanticHub as a Cake Addin
#addin nuget:?package=FaceMan.SemanticHub&version=1.0.2

// Install FaceMan.SemanticHub as a Cake Tool
#tool nuget:?package=FaceMan.SemanticHub&version=1.0.2                

SemanticHub

.Net 基于SK接入大语言模型的SDK,帮助使用者快速对接各大模型,目前仅支持对话模型

  • 支持流式接口在聊天接口中整合统一的入参和出参,方便调用。
  • 支持传入模型参数。

已完成对话模型

  • AzureOpenAI
  • OpenAI
  • 通义千问
  • 讯飞星火
  • 文心一言
  • 智谱AI

也可以直接搜索Nuget包FaceMan.SemanticHub引入 image

计划功能

  • 图像接口
  • 语音转文字接口
  • 增加chatGLM、Gemini 等更多大模型
  • 未完待续

Version

  • v1.0.1 添加AzureOpenAI、OpenAI、通义千问、智谱AI、讯飞星火、文心一言对话模型。
  • v1.0.2 自定义代理地址

使用方法

QianWenChatCompletionService chatgpt = new("你的key", "对话模型:例如qwen-turbo");
ChatHistory historys = new ChatHistory();
historys.AddSystemMessage("你是一个c#编程高手,你将用代码回答我关于.net编程的技术问题,下面是我的第一个问题:");
historys.AddUserMessage("用c#写一个冒泡排序");

//创建模型参数
 OpenAIPromptExecutionSettings settings = new OpenAIPromptExecutionSettings()
 {
     MaxTokens = 1024,
     Temperature=0.7,
     TopP=1.0,
     //....其他参数
 };
//对话
var result = await chatgpt.GetChatMessageContentsAsync(historys,settings);
Console.WriteLine(result);
//流式对话
await foreach (string item in chatgpt.GetStreamingChatMessageContentsAsync(historys,settings))
{
    Console.Write(item);
}

如何贡献

如果你希望参与贡献,欢迎 Pull Requests,或给我们 Issues

Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

支持自定义代理地址,统一AzureOpenAI、OpenAI与其他模型的写法