Optimization

This commit is contained in:
Thorsten Sommer 2025-02-18 15:42:07 +01:00
parent 50c1b45735
commit ccc3089066
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -298,7 +298,7 @@ public sealed class AgentDataSourceSelection (ILogger<AgentDataSourceSelection>
// We know how bad LLM may be in generating JSON without surrounding text. // We know how bad LLM may be in generating JSON without surrounding text.
// Thus, we expect the worst and try to extract the JSON list from the text: // Thus, we expect the worst and try to extract the JSON list from the text:
// //
var json = this.ExtractJson(selectedDataSourcesJson); var json = ExtractJson(selectedDataSourcesJson);
try try
{ {
@ -344,7 +344,7 @@ public sealed class AgentDataSourceSelection (ILogger<AgentDataSourceSelection>
/// </remarks> /// </remarks>
/// <param name="text">The text that may contain the JSON list.</param> /// <param name="text">The text that may contain the JSON list.</param>
/// <returns>The extracted JSON list.</returns> /// <returns>The extracted JSON list.</returns>
private string ExtractJson(string text) => ExtractJson(text.AsSpan()).ToString(); private static string ExtractJson(string text) => ExtractJson(text.AsSpan()).ToString();
/// <summary> /// <summary>
/// Extracts the JSON list from the given text. The text may contain additional /// Extracts the JSON list from the given text. The text may contain additional