From 4e70ab006bc4d68aef96ffe3ddd4951d00ba2a81 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Fri, 28 Feb 2025 16:13:55 +0800 Subject: [PATCH] Tweaks for Evaluate AI Responses tests --- .../snippets/evaluate-ai-responses/MyTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/ai/quickstarts/snippets/evaluate-ai-responses/MyTests.cs b/docs/ai/quickstarts/snippets/evaluate-ai-responses/MyTests.cs index 019793d552f77..08488aaa76901 100644 --- a/docs/ai/quickstarts/snippets/evaluate-ai-responses/MyTests.cs +++ b/docs/ai/quickstarts/snippets/evaluate-ai-responses/MyTests.cs @@ -10,7 +10,7 @@ public sealed class MyTests // private static ChatConfiguration? s_chatConfiguration; private static IList s_messages = [ - new ChatMessage( + new ChatMessage( ChatRole.System, """ You're an AI assistant that can answer questions related to astronomy. @@ -28,7 +28,7 @@ Keep your responses concise and try to stay under 100 words. public static async Task InitializeAsync(TestContext _) { /// Set up the , - // which includes the that the + /// which includes the that the /// evaluator uses to communicate with the model. s_chatConfiguration = GetOllamaChatConfiguration(); @@ -39,7 +39,7 @@ public static async Task InitializeAsync(TestContext _) ResponseFormat = ChatResponseFormat.Text }; - /// Fetch the response to be evaluated + // Fetch the response to be evaluated // and store it in a static variable. ChatResponse response = await s_chatConfiguration.ChatClient.GetResponseAsync(s_messages, chatOptions); s_response = response.Message; @@ -49,7 +49,7 @@ public static async Task InitializeAsync(TestContext _) // private static ChatConfiguration GetOllamaChatConfiguration() { - /// Get a chat client for the Ollama endpoint. + // Get a chat client for the Ollama endpoint. IChatClient client = new OllamaChatClient( new Uri("http://localhost:11434"), @@ -72,7 +72,7 @@ public async Task TestCoherence() /// Retrieve the score for coherence from the . NumericMetric coherence = result.Get(CoherenceEvaluator.CoherenceMetricName); - /// Validate the default interpretation + // Validate the default interpretation // for the returned coherence metric. Assert.IsFalse(coherence.Interpretation!.Failed); Assert.IsTrue(coherence.Interpretation.Rating is EvaluationRating.Good or EvaluationRating.Exceptional);