Skip to content

Commit 0135cf9

Browse files
committed
Small fix
1 parent 76c640c commit 0135cf9

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

99_CSharp/Helper/DumpLoggingProvider.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ internal LLMCall CompleteLLMCall(string correlationId, string function, string a
7272
llmCall.Response = response;
7373
llmCall.ResponseFunctionCall = function;
7474
llmCall.ResponseFunctionCallParameters = arguments;
75+
llmCall.CallEnd = DateTime.UtcNow;
7576
return llmCall;
7677
}
7778
}
@@ -187,7 +188,8 @@ sealed class RequestBodyLogger(ILogger logger) : IHttpClientAsyncLogger
187188
{
188189
CorrelationKey = request.Headers.GetValues("x-ms-client-request-id").First(),
189190
Prompt = jsonObject.GetProperty("messages").ToString(),
190-
PromptFunctions = tools.ToString()
191+
PromptFunctions = tools.ToString(),
192+
CallStart = DateTime.UtcNow
191193
};
192194
DumpLoggingProvider.Instance._logger.AddLLMCall(lLMCall);
193195
}

99_CSharp/Helper/LogHelpers/LLMCall.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace SemanticKernelExperiments.Helper.LogHelpers
1+
using System;
2+
3+
namespace SemanticKernelExperiments.Helper.LogHelpers
24
{
35
public class LLMCall
46
{
@@ -14,6 +16,12 @@ public class LLMCall
1416

1517
public string ResponseFunctionCallParameters { get; set; }
1618

19+
public DateTime CallStart { get; set; }
20+
21+
public DateTime CallEnd { get; set; }
22+
23+
public TimeSpan CallDuration => CallEnd - CallStart;
24+
1725
public string Dump()
1826
{
1927
if (string.IsNullOrEmpty(PromptFunctions))

99_CSharp/Program.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,26 @@ private static async Task Ex05_basic_planner()
216216
#pragma warning disable SKEXP0060 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
217217
var planner = new HandlebarsPlanner();
218218

219-
Console.WriteLine("\n\nProcess followed to answer the question:\n");
220219
var question = "I want to extract summarized timeline from video file C:\\temp\\ssh.mp4";
221-
222220
var plan = await planner.CreatePlanAsync(kernel, question);
223-
224221
var textPlan = plan.ToString();
225222
Console.WriteLine(textPlan);
226223

224+
var llmCalls = _loggingProvider.GetLLMCalls();
225+
var callToExecuteThePlan = llmCalls.Count();
226+
Console.WriteLine("Number of function calls to generate the plan: {0}", callToExecuteThePlan);
227+
228+
var planCall = llmCalls.Single();
227229
//now we can invoke the plan
228230
var result = await plan.InvokeAsync(kernel);
229231

232+
llmCalls = _loggingProvider.GetLLMCalls();
233+
Console.WriteLine("Num of function calls to execute the plan: {0}", llmCalls.Count() - callToExecuteThePlan);
234+
235+
Console.WriteLine("Result: {0}", result);
236+
230237
#pragma warning restore SKEXP0060 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
231238
DumpTextSection("RAW FUNCTION CALLS");
232-
var llmCalls = _loggingProvider.GetLLMCalls();
233239
foreach (var llmCall in llmCalls)
234240
{
235241
Console.WriteLine($"Function {llmCall.ResponseFunctionCall} with arguments {llmCall.ResponseFunctionCallParameters}");

99_CSharp/python/transcript_timeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33

44
def transcript_timeline(audiofile: str) -> str:
5-
model = whisper.load_model("large-v3")
5+
model = whisper.load_model("tiny.en")
66

77
transcription_options = {
88
"verbose" : False,

0 commit comments

Comments
 (0)