Peak.Lib.OpenAI
1.0.0
dotnet add package Peak.Lib.OpenAI --version 1.0.0
NuGet\Install-Package Peak.Lib.OpenAI -Version 1.0.0
<PackageReference Include="Peak.Lib.OpenAI" Version="1.0.0" />
paket add Peak.Lib.OpenAI --version 1.0.0
#r "nuget: Peak.Lib.OpenAI, 1.0.0"
// Install Peak.Lib.OpenAI as a Cake Addin #addin nuget:?package=Peak.Lib.OpenAI&version=1.0.0 // Install Peak.Lib.OpenAI as a Cake Tool #tool nuget:?package=Peak.Lib.OpenAI&version=1.0.0
流返回:
var result = new ChatGPTChatExtension("sk-key......");
await result.AppendUserInputResultMessAgeStream("你好,你是一名语文老师,请用床前明月光、将进酒、五星红旗把歌唱结合编写一首诗,要求含有以上所有诗句的意境", (string message) =>
{
Console.Write(message);
});
非流返回:
var result = new ChatGPTChatExtension("sk-key......");
var content= await result.AppendUserInputResultMessAge("你好,你是一名语文老师,请用床前明月光、将进酒、五星红旗把歌唱结合编写一首诗,要求含有以上所有诗句的意境");
相关方法:
/// <summary>
/// 通过API列出所有型号
/// </summary>
/// <returns></returns>
public List<Model> GetAllModels()
/// <summary>
/// 创建一个角色为<see cref=“ChatMessageRole.System”/>的聊天室并将其附加到聊天室。系统消息有助于设置助手的行为。
/// </summary>
/// <param name="content"></param>
public void AppendSystemMessage(string content)
/// <summary>
/// 发送信息并返回信息
/// </summary>
/// <param name="content"></param>
/// <returns></returns>
public async Task<string> AppendUserInputResultMessAge(string content)
/// <summary>
/// 发送信息并返回信息
/// </summary>
/// <param name="content"></param>
/// <returns></returns>
public async Task AppendUserInputResultMessAgeStream(string content, Action<string> resultHandler)
/// <summary>
/// 指定角色发送信息,并返回信息
/// </summary>
/// <param name="role"></param>
/// <param name="content"></param>
/// <returns></returns>
public async Task<string> AppendMessage(ChatMessageRole role, string content)
/// <summary>
/// 指定角色发送信息,并返回信息
/// </summary>
/// <param name="role"></param>
/// <param name="content"></param>
/// <returns></returns>
public async Task AppendMessageStream(ChatMessageRole role, string content, Action<string> resultHandler)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- OpenAI (>= 1.7.2)
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.0.0 | 649 | 7/20/2023 |