aiqinxuancai / ChatGPTSharp

This project implements ChatGPT continuous dialogue based on ConversationId, which can be quickly integrated with just a few lines of code. It supports models such as gpt-4, gpt-3.5-turbo, and text-davinci-003.
MIT License
29 stars 4 forks source link

希望加入异步数据流的调用方法 #1

Closed Lenloo closed 1 year ago

Lenloo commented 1 year ago

加入异步数据流的调用方法,边获取边输出。

aiqinxuancai commented 1 year ago

没理解,能详细说说吗

Lenloo commented 1 year ago

譬如返回IAsyncEnumerable var client = new ChatGPTClient(File.ReadAllText("KEY.txt"), "gpt-3.5-turbo"); IAsyncEnumerable<T> asyncResult = client.EnumerableAsync("你是谁?"); await foreach (var item in asyncResult) { onsole.WriteLine(item.Content); } 就类似这样

aiqinxuancai commented 1 year ago

我觉得业务自行实现吧,async是挺标准的sdk方法了。