mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12:56 +00:00
16 lines
424 B
C#
16 lines
424 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|