AllInAI.Sharp.API 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AllInAI.Sharp.API --version 1.1.0
                    
NuGet\Install-Package AllInAI.Sharp.API -Version 1.1.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="AllInAI.Sharp.API" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AllInAI.Sharp.API" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AllInAI.Sharp.API" />
                    
Project file
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 AllInAI.Sharp.API --version 1.1.0
                    
#r "nuget: AllInAI.Sharp.API, 1.1.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.
#:package AllInAI.Sharp.API@1.1.0
                    
#: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=AllInAI.Sharp.API&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AllInAI.Sharp.API&version=1.1.0
                    
Install as a Cake Tool

AllInAI.Sharp.API

一款调用各大平台语言模型的SDK,能帮助使用者快速对接各大模型。已整合OpenAI,chatGLM,文心千帆,同义千问,stable-diffusion 等 支持设置反向代理 AllInAI SDK 在聊天和图片接口中整合统一的入参和出参。方便调用。

已完成模型有

  • OpenAI
  • chatGLM
  • 文心千帆
  • 同义千问
  • stable-diffusion

使用文档使用示例

示例项目为:https://github.com/raokun/AllInAI.Sharp.API.Sample

使用范例

发起聊天

1.设置基础配置: key -- 模型的秘钥key BaseUrl -- 代理地址 AIType -- 模型类型,对应枚举Enums.AITypeEnum

2.调用接口 1.chat

AuthOption authOption = new AuthOption() { Key = "sk-***", BaseUrl = "https://api.openai.com", AIType = Enums.AITypeEnum.OpenAi };

ChatService chatService = new ChatService(authOption);
CompletionReq completionReq = new CompletionReq();
List<MessageDto> messages = new List<MessageDto>();
messages.Add(new MessageDto() { Role = "user", Content = "Hello!" });
completionReq.Model = "gpt-3.5-turbo";
completionReq.Messages = messages;
CompletionRes completionRes = await chatService.Completion(completionReq);

2.image

AuthOption authOption = new AuthOption() {BaseUrl = "http://43.134.164.127:77", AIType = Enums.AITypeEnum.SD };
ImgService imgService = new ImgService(authOption);
Txt2ImgReq imgReq = new Txt2ImgReq();
imgReq.Steps = 20;
imgReq.Size = "1024x1024";
imgReq.N = 1;
imgReq.Prompt = "kitty";
imgReq.ResponseFormat = "b64_json";
ImgRes imgRes = await imgService.Txt2Img(imgReq);

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.  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.
  • net7.0

    • No dependencies.

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.2.2-preview3 386 1/25/2024
1.2.2-preview2 317 1/24/2024
1.2.2-preview 355 1/10/2024
1.2.1 817 1/9/2024
1.2.0 442 12/27/2023
1.1.8 476 12/22/2023
1.1.7 431 12/22/2023
1.1.6 505 12/12/2023
1.1.5 458 12/8/2023
1.1.4 454 12/7/2023
1.1.3 488 12/4/2023
1.1.2 433 12/4/2023
1.1.2-preview2 420 12/4/2023
1.1.2-preview1 430 12/4/2023
1.1.1 477 11/30/2023
1.1.0 472 11/30/2023
1.1.0-preview1.0 94 11/30/2023
1.0.1-preview.1 105 11/29/2023
1.0.0 471 11/29/2023