Works already, but might not be the ideal solution

This commit is contained in:
Peer Schütt 2025-06-05 12:02:59 +02:00
parent 7a498d524e
commit cccadcea07
2 changed files with 17 additions and 1 deletions

View File

@ -72,7 +72,7 @@
} }
else else
{ {
<MudMarkdown Value="@textContent.Text" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo" CodeBlockTheme="@this.CodeColorPalette"/> <MudMarkdown Value="@textContent.Text.RemoveThinkTags()" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo" CodeBlockTheme="@this.CodeColorPalette"/>
} }
} }
} }

View File

@ -0,0 +1,16 @@
namespace AIStudio.Chat;
public static class StringExtensions
{
public static string RemoveThinkTags(this string input)
{
if (string.IsNullOrEmpty(input) || !input.StartsWith("<think>"))
return input;
int endIndex = input.IndexOf("</think>");
if (endIndex == -1)
return input;
return input.Substring(endIndex + "</think>".Length);
}
}