KimiAI_API 1.0.2
See the version list below for details.
dotnet add package KimiAI_API --version 1.0.2
NuGet\Install-Package KimiAI_API -Version 1.0.2
<PackageReference Include="KimiAI_API" Version="1.0.2" />
<PackageVersion Include="KimiAI_API" Version="1.0.2" />
<PackageReference Include="KimiAI_API" />
paket add KimiAI_API --version 1.0.2
#r "nuget: KimiAI_API, 1.0.2"
#:package KimiAI_API@1.0.2
#addin nuget:?package=KimiAI_API&version=1.0.2
#tool nuget:?package=KimiAI_API&version=1.0.2
KimiAI API NuGet 包
这个 NuGet 包是根据 KimiAI 提供的官方 SDK 改编的,旨在方便您在 C# 语言中使用 KimiAI 提供的 API。它目前处于初步版本,提供了基本的对话接口功能,并计划在未来更新中包含更多由 KimiAI 支持的功能。 包含内容
相关类:包内包含所有必要的类以进行 API 交互。
调用方法:所有 API 交互方法都封装在 KimiAI 类中。
聊天接口 SendChat() 方法:此方法向 Moonshot AI API 发送聊天请求,并返回一个 HttpResponseMessage。 响应处理: HandleStream():处理来自 Moonshot AI API 的流式响应,并返回一个 IAsyncEnumerable<ChatResponse?>。此方法需要使用 foreach 语句进行处理。 HandleChat():处理非流式响应,并返回一个 ChatResponse 对象,或者您可以根据自己的需要进行处理。
示例用法: var response = await SendChat(chatReq); await foreach (ChatResponse? result in HandleStream(response)) { // ...your code... }
附加功能 DeleteFileAsync():异步删除 API 中的文件。 ListFiles():列出用户上传的所有文件。 UploadFile():上传文件并返回文件信息。 UploadFileStream():上传文件流并返回文件信息。 GetFileContent():检索指定文件的内容。 HandleFile():处理文件并直接返回文件解析后的内容。
数据模型 包中包含各种数据模型以便于与 API 交互,例如 ChatReq、ChatResponse、FileItem 等。
注意 此包正在积极开发中,API 可能会有变动。请参阅官方 KimiAI 文档以获取最新信息。
KimiAI API NuGet Package
This NuGet package is adapted from the official SDK provided by KimiAI, designed to facilitate the use of KimiAI's APIs in the C# language. It is currently in its preliminary version, offering basic chat interface functionalities, with plans to include more features supported by KimiAI in future updates. Package Contents
Related Classes: The package includes all necessary classes for API interaction.
Calling Methods: All methods for API interaction are encapsulated within the KimiAI class.
Chat Interface SendChat() Method: This method sends a chat request to the Moonshot AI API and returns an HttpResponseMessage. Response Handling: HandleStream(): Processes the streaming response from the Moonshot AI API and returns an IAsyncEnumerable<ChatResponse?>. This method requires processing with a foreach statement. HandleChat(): Processes the non-streaming response and returns a ChatResponse object, or you can handle it according to your needs.
Example Usage
var response = await SendChat(chatReq);
await foreach (ChatResponse? result in HandleStream(response))
{
// ...your code...
}
Additional Functionalities
DeleteFileAsync(): Asynchronously deletes a file from the API.
ListFiles(): Lists all files uploaded by the user.
UploadFile(): Uploads a file and returns file information.
UploadFileStream(): Uploads a file stream and returns file information.
GetFileContent(): Retrieves the content of a specified file.
HandleFile(): handles the file and returns the parsed contents of the file directly.
Data Models
The package includes various data models to facilitate interaction with the API, such as ChatReq, ChatResponse, FileItem, and others.
Installation
Note
This package is under active development, and the API may change. Please refer to the official KimiAI documentation for the most up-to-date information.
| Product | Versions 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. 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. |
-
net6.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.