mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 22:32:56 +00:00
Handle whitespace and add StringComparison
in validation
This commit is contained in:
parent
7c4ddf1164
commit
0d84feb12a
@ -6,7 +6,7 @@ public static class StringExtensions
|
||||
{
|
||||
const string OPEN_TAG = "<think>";
|
||||
const string CLOSE_TAG = "</think>";
|
||||
if (string.IsNullOrEmpty(input) || !input.StartsWith(OPEN_TAG))
|
||||
if (string.IsNullOrWhiteSpace(input) || !input.StartsWith(OPEN_TAG, StringComparison.Ordinal))
|
||||
return input;
|
||||
|
||||
var endIndex = input.IndexOf(CLOSE_TAG, StringComparison.Ordinal);
|
||||
|
Loading…
Reference in New Issue
Block a user