Skip to content

Commit

Permalink
Logic comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
crickman committed Aug 15, 2023
1 parent bdaa654 commit 1f6cb8d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webapi/Skills/ChatSkills/ChatSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ private async Task<ChatMessage> GetChatResponseAsync(string chatId, string userI
var chatHistoryTokenLimit = remainingToken - TokenUtilities.TokenCount(chatContextText) - TokenUtilities.TokenCount(planResult);

string chatHistory = string.Empty;

// Append the chat history, if allowed.
if (chatHistoryTokenLimit > 0)
{
await this.UpdateBotResponseStatusOnClient(chatId, "Extracting chat history");
Expand All @@ -396,6 +398,7 @@ private async Task<ChatMessage> GetChatResponseAsync(string chatId, string userI
chatContextText = $"{chatContextText}\n{chatHistory}";
}

// Append the plan result, if exists.
if (!string.IsNullOrWhiteSpace(planResult))
{
chatContextText = $"{chatContextText}\n{planResult}";
Expand Down

0 comments on commit 1f6cb8d

Please sign in to comment.