Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions FlowVision/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ private void allowUserInput(bool enable)
private async void SendButton_Click(object sender, EventArgs e)
{
allowUserInput(false);
var toolConfig = ToolConfig.LoadConfig("toolsconfig");

// Check if the user input is empty
string userInput = userInputTextBox.Text;
Expand All @@ -367,16 +368,16 @@ private async void SendButton_Click(object sender, EventArgs e)

// Add user message to UI
AddMessage("You", userInput, false);

try
{
string aiResponse = await GetAIResponseAsync(userInput);
AddMessage("AI", aiResponse, true);

// Check if we should retain chat history
var toolConfig = ToolConfig.LoadConfig("toolsconfig");

if (!toolConfig.RetainChatHistory)
{

// Keep only the latest exchange in chat history
if (chatHistory.Count > 2)
{
Expand Down
Loading