Skip to content

Commit 44df440

Browse files
committed
Add "Async suffix for async methods
1 parent bbb13be commit 44df440

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

OpenAI_API/Chat/Conversation.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,23 @@ public async Task<string> GetResponseFromChatbot()
125125

126126
/// <summary>
127127
/// Calls the API to get a response, which is appended to the current chat's <see cref="Messages"/> as an <see cref="ChatMessageRole.Assistant"/> <see cref="ChatMessage"/>, and streams the results to the <paramref name="resultHandler"/> as they come in. <br/>
128-
/// If you are on the latest C# supporting async enumerables, you may prefer the cleaner syntax of <see cref="StreamResponseEnumerableFromChatbot"/> instead.
128+
/// If you are on the latest C# supporting async enumerables, you may prefer the cleaner syntax of <see cref="StreamResponseEnumerableFromChatbotAsync"/> instead.
129129
/// </summary>
130130
/// <param name="resultHandler">An action to be called as each new result arrives.</param>
131-
public async Task StreamResponseFromChatbot(Action<string> resultHandler)
131+
public async Task StreamResponseFromChatbotAsync(Action<string> resultHandler)
132132
{
133-
await foreach (string res in StreamResponseEnumerableFromChatbot())
133+
await foreach (string res in StreamResponseEnumerableFromChatbotAsync())
134134
{
135135
resultHandler(res);
136136
}
137137
}
138138

139139
/// <summary>
140140
/// Calls the API to get a response, which is appended to the current chat's <see cref="Messages"/> as an <see cref="ChatMessageRole.Assistant"/> <see cref="ChatMessage"/>, and streams the results as they come in. <br/>
141-
/// If you are not using C# 8 supporting async enumerables or if you are using the .NET Framework, you may need to use <see cref="StreamResponseFromChatbot"/> instead.
141+
/// If you are not using C# 8 supporting async enumerables or if you are using the .NET Framework, you may need to use <see cref="StreamResponseFromChatbotAsync"/> instead.
142142
/// </summary>
143143
/// <returns>An async enumerable with each of the results as they come in. See <see href="https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#asynchronous-streams"/> for more details on how to consume an async enumerable.</returns>
144-
public async IAsyncEnumerable<string> StreamResponseEnumerableFromChatbot()
144+
public async IAsyncEnumerable<string> StreamResponseEnumerableFromChatbotAsync()
145145
{
146146
ChatRequest req = new ChatRequest(RequestParameters);
147147
req.Messages = _Messages.ToList();

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Using the new C# 8.0 async iterators:
124124
var chat = api.Chat.CreateConversation();
125125
chat.AppendUserInput("How to make a hamburger?");
126126

127-
await foreach (var res in chat.StreamResponseEnumerableFromChatbot())
127+
await foreach (var res in chat.StreamResponseEnumerableFromChatbotAsync())
128128
{
129129
Console.Write(res);
130130
}
@@ -135,7 +135,7 @@ Or if using classic .NET framework or C# <8.0:
135135
var chat = api.Chat.CreateConversation();
136136
chat.AppendUserInput("How to make a hamburger?");
137137

138-
await chat.StreamResponseFromChatbot(res =>
138+
await chat.StreamResponseFromChatbotAsync(res =>
139139
{
140140
Console.Write(res);
141141
});

0 commit comments

Comments
 (0)