mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 02:40:20 +00:00 
			
		
		
		
	Optimization
This commit is contained in:
		
							parent
							
								
									50c1b45735
								
							
						
					
					
						commit
						ccc3089066
					
				@ -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
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user