File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Everywhere.Abstractions/Configuration Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1- using System . Diagnostics ;
2- using System . Diagnostics . CodeAnalysis ;
1+ using System . Diagnostics . CodeAnalysis ;
32using System . Runtime . Serialization ;
43using System . Text . Json . Serialization ;
54using CommunityToolkit . Mvvm . ComponentModel ;
@@ -69,16 +68,18 @@ public T? BindableValue
6968 }
7069 }
7170
71+ [ JsonConstructor ]
7272 public Customizable ( ) { }
7373
7474 [ SetsRequiredMembers ]
7575 public Customizable ( T defaultValue , T ? customValue = default ) : this ( )
7676 {
7777 DefaultValue = defaultValue ;
78- if ( customValue is not null ) CustomValue = customValue ;
78+ CustomValue = customValue ;
7979 }
8080
8181 [ IgnoreDataMember ]
82+ [ field: AllowNull , MaybeNull ]
8283 public IRelayCommand ResetCommand => field ??= new RelayCommand ( Reset ) ;
8384
8485 public void Reset ( )
@@ -89,4 +90,6 @@ public void Reset()
8990 public static implicit operator Customizable < T > ( T value ) => new ( ) { DefaultValue = value } ;
9091
9192 public static implicit operator T ( Customizable < T > customizable ) => customizable . ActualValue ;
93+
94+ public override string ? ToString ( ) => ActualValue . ToString ( ) ;
9295}
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ private IKernelMixin CreateKernelMixin()
8989 var kernelMixin = kernelMixinFactory . GetOrCreate ( settings . Model ) ;
9090 activity ? . SetTag ( "llm.provider.id" , settings . Model . SelectedModelProviderId ?? "unknown" ) ;
9191 activity ? . SetTag ( "llm.model.id" , settings . Model . SelectedModelDefinitionId ?? "unknown" ) ;
92+ activity ? . SetTag ( "llm.model.actual_id" , settings . Model . SelectedModelDefinition ? . ModelId ?? "unknown" ) ;
93+ activity ? . SetTag ( "llm.model.max_tokens" , settings . Model . SelectedModelDefinition ? . MaxTokens . ToString ( ) ?? "unknown" ) ;
9294 return kernelMixin ;
9395 }
9496 catch ( Exception e )
@@ -314,6 +316,10 @@ private async Task GenerateAsync(
314316 using ( var llmStreamActivity = _activitySource . StartActivity ( "ChatCompletionService.GetStreamingChatMessageContents" ) )
315317 {
316318 llmStreamActivity ? . SetTag ( "chat.context.id" , chatContext . Metadata . Id ) ;
319+ llmStreamActivity ? . SetTag ( "llm.provider.id" , settings . Model . SelectedModelProviderId ?? "unknown" ) ;
320+ llmStreamActivity ? . SetTag ( "llm.model.id" , settings . Model . SelectedModelDefinitionId ?? "unknown" ) ;
321+ llmStreamActivity ? . SetTag ( "llm.model.actual_id" , settings . Model . SelectedModelDefinition ? . ModelId ?? "unknown" ) ;
322+ llmStreamActivity ? . SetTag ( "llm.model.max_tokens" , settings . Model . SelectedModelDefinition ? . MaxTokens ? . ToString ( ) ?? "unknown" ) ;
317323
318324 await foreach ( var streamingContent in kernelMixin . ChatCompletionService . GetStreamingChatMessageContentsAsync (
319325 chatHistory ,
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ private static void InitializeLogger()
121121 new JsonFormatter ( ) ,
122122 Path . Combine ( dataPath , "logs" , ".jsonl" ) ,
123123 rollingInterval : RollingInterval . Day )
124- . WriteTo . Sentry ( LogEventLevel . Information , LogEventLevel . Information )
124+ . WriteTo . Sentry ( LogEventLevel . Error , LogEventLevel . Information )
125125 . CreateLogger ( ) ;
126126 }
127127
You can’t perform that action at this time.
0 commit comments