FaceMan.SemanticHub 1.0.4

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

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

SemanticHub

.Net 基于SK接入大语言模型的SDK,帮助使用者快速对接各大模型。

计划功能

  • 对话模型

    • AzureOpenAI
    • OpenAI
    • 通义千问
    • 讯飞星火
    • 文心一言
    • 智谱AI
  • 支持返回Token

  • 支持自定义代理地址

  • 图像接口

    • Azure
    • 通义万象
  • 文本处理接口

  • 语音转文字接口

  • 增加chatGLM、Gemini 等更多大模型

  • 未完待续。。。

Version

  • v1.0.1
    • 添加AzureOpenAI、OpenAI、通义千问、智谱AI、讯飞星火、文心一言对话模型,支持传入模型参数。
  • v1.0.2
    • 自定义代理地址
    • 增加单元测试
    • 统一AzureOpenAI、OpenAI与其他模型的写法
  • v1.0.3
    • 返回消耗的token数
  • v1.0.4
    • 集成图像接口,仅支持通义万象,其他暂不对接,如有需要请提issue
    • 重构对话接口,采用Kernel的写法实现ITextGenerationService、IChatCompletionService、ITextToImageService,使其更灵活。
    • 更新单元测试

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

使用方法

项目地址:faceman0814/SemanticHub (github.com)

参考单元测试内容

Tips

  • 单元测试时的时候不要并发点,会报错,因为他是websocket访问。
  • OpenAI 采用流式方法对话时,不会返回消耗的token。
  • 各模型厂商对token的消耗计算是不一样的,可以通过单元测试对比结果。
  • 测试中通义千问流式方法消耗的token比直接对话的要多一点。
  • 文心一言实际调用中的模型并不叫模型名,要跟官方的对标好比如ernie-bot实际在代码中的传参是completions,这个后续优化。
  • 文心一言有概率乱答

如何贡献

如果你希望参与贡献,欢迎 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.

支持返回消耗的token数