mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 03:52:57 +00:00
Works already, but might not be the ideal solution
This commit is contained in:
parent
7a498d524e
commit
cccadcea07
@ -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"/>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
app/MindWork AI Studio/Chat/StringExtension.cs
Normal file
16
app/MindWork AI Studio/Chat/StringExtension.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user