refactor: Rename TrueCV to RealCV throughout codebase
- Renamed all directories (TrueCV.* -> RealCV.*) - Renamed all project files (.csproj) - Renamed solution file (TrueCV.sln -> RealCV.sln) - Updated all namespaces in C# and Razor files - Updated project references - Updated CSS variable names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
32
src/RealCV.Infrastructure/Helpers/JsonResponseHelper.cs
Normal file
32
src/RealCV.Infrastructure/Helpers/JsonResponseHelper.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace RealCV.Infrastructure.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Helper methods for processing AI/LLM JSON responses.
|
||||
/// </summary>
|
||||
public static class JsonResponseHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Cleans a JSON response by removing markdown code block formatting.
|
||||
/// </summary>
|
||||
public static string CleanJsonResponse(string response)
|
||||
{
|
||||
var trimmed = response.Trim();
|
||||
|
||||
// Remove markdown code blocks
|
||||
if (trimmed.StartsWith("```json", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
trimmed = trimmed[7..];
|
||||
}
|
||||
else if (trimmed.StartsWith("```"))
|
||||
{
|
||||
trimmed = trimmed[3..];
|
||||
}
|
||||
|
||||
if (trimmed.EndsWith("```"))
|
||||
{
|
||||
trimmed = trimmed[..^3];
|
||||
}
|
||||
|
||||
return trimmed.Trim();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user