mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12: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 OPEN_TAG = "<think>";
|
||||||
const string CLOSE_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;
|
return input;
|
||||||
|
|
||||||
var endIndex = input.IndexOf(CLOSE_TAG, StringComparison.Ordinal);
|
var endIndex = input.IndexOf(CLOSE_TAG, StringComparison.Ordinal);
|
||||||
|
Loading…
Reference in New Issue
Block a user