Skip to content

Commit 3d57c5c

Browse files
Simplify
1 parent ee9df36 commit 3d57c5c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

dotnet/samples/Chat.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
using var _ = session.On(evt =>
77
{
88
Console.ForegroundColor = ConsoleColor.Blue;
9-
var output = evt switch
9+
switch (evt)
1010
{
11-
AssistantReasoningEvent reasoning => $"[reasoning: {reasoning.Data.Content}]",
12-
ToolExecutionStartEvent toolStart => $"[tool: {toolStart.Data.ToolName} {toolStart.Data.Arguments}]",
13-
_ => null
14-
};
15-
if (output != null) Console.WriteLine(output);
11+
case AssistantReasoningEvent reasoning:
12+
Console.WriteLine($"[reasoning: {reasoning.Data.Content}]");
13+
break;
14+
case ToolExecutionStartEvent tool:
15+
Console.WriteLine($"[tool: {tool.Data.ToolName}]");
16+
break;
17+
}
1618
Console.ResetColor();
1719
});
1820

0 commit comments

Comments
 (0)