AllInAI.Sharp.API
1.1.0-preview1.0
See the version list below for details.
dotnet add package AllInAI.Sharp.API --version 1.1.0-preview1.0
NuGet\Install-Package AllInAI.Sharp.API -Version 1.1.0-preview1.0
<PackageReference Include="AllInAI.Sharp.API" Version="1.1.0-preview1.0" />
paket add AllInAI.Sharp.API --version 1.1.0-preview1.0
#r "nuget: AllInAI.Sharp.API, 1.1.0-preview1.0"
// Install AllInAI.Sharp.API as a Cake Addin
#addin nuget:?package=AllInAI.Sharp.API&version=1.1.0-preview1.0&prerelease
// Install AllInAI.Sharp.API as a Cake Tool
#tool nuget:?package=AllInAI.Sharp.API&version=1.1.0-preview1.0&prerelease
<div align="center"> <h1>AllInAI.Sharp.API.Sample</h1> </div>
English | 中文简介
AllInAI.Sharp.API is an SDK that calls language models from various platforms, and it helps users quickly integrate with major models. It has integrated OpenAI, chatGLM, Wenxin Qianfan, Synonymous Qianwen, stable-diffusion, etc. It supports setting reverse proxies and streaming interfaces. The AllInAI SDK integrates unified input and output parameters in the chat and image interfaces, making it easy to call.
Completed models include:
- OpenAI
- chatGLM
- Wenxin Qianfan
- Synonymous Qianwen
- stable-diffusion
Usage example
Initiate a chat
Set the basic configurations:
- key: The model secret key
- BaseUrl: The proxy address
- AIType: The model type, corresponds to the Enums.AITypeEnum enumeration
Call the API
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);
- 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);
How to contribute
- Fork & Clone
- Create a branch named Feature/name(your github id)/issuexxx
- Commit with a commit message, like "solve issue xxx, add xxx"
- Create a Pull Request If you would like to contribute, feel free to submit Pull Requests or give us Issues.
Donation
If you find this project helpful, you can buy raokun a coffee to show support. raokun's open-source contribution relies on your support and encouragement. <div style="display:flex;"> <div style="padding-right:24px;"> <p>WeChat</p> <img src="https://www.raokun.top/upload/2023/04/%E5%BE%AE%E4%BF%A1%E6%94%B6%E6%AC%BE.jpg" style="width:200px" /> </div> <div style="padding-right:24px;"> <p>Alipay</p> <img src="https://www.raokun.top/upload/2023/04/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%B6%E6%AC%BE.jpg" style="width:200px" /> </div> </div>
Product | Versions 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. |
-
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 | 272 | 1/25/2024 |
1.2.2-preview2 | 234 | 1/24/2024 |
1.2.2-preview | 273 | 1/10/2024 |
1.2.1 | 408 | 1/9/2024 |
1.2.0 | 344 | 12/27/2023 |
1.1.8 | 355 | 12/22/2023 |
1.1.7 | 331 | 12/22/2023 |
1.1.6 | 390 | 12/12/2023 |
1.1.5 | 341 | 12/8/2023 |
1.1.4 | 352 | 12/7/2023 |
1.1.3 | 389 | 12/4/2023 |
1.1.2 | 343 | 12/4/2023 |
1.1.2-preview2 | 346 | 12/4/2023 |
1.1.2-preview1 | 348 | 12/4/2023 |
1.1.1 | 366 | 11/30/2023 |
1.1.0 | 368 | 11/30/2023 |
1.1.0-preview1.0 | 39 | 11/30/2023 |
1.0.1-preview.1 | 58 | 11/29/2023 |
1.0.0 | 361 | 11/29/2023 |