39 references to GenAIHelpers
Aspire.Dashboard (14)
Components\Controls\SpanDetails.razor.cs (1)
119if (GenAIHelpers.IsGenAISpan(ViewModel.Span.Attributes))
Components\Pages\StructuredLogs.razor.cs (1)
574Field = GenAIHelpers.GenAISystem,
Components\Pages\TraceDetail.razor.cs (1)
547return GenAIHelpers.IsGenAISpan(spanViewModel.Span.Attributes);
Components_ResourcesGridColumns_LogMessageColumnDisplay_razor.g.cs (1)
325GenAIHelpers.IsGenAISpan(LogEntry.Attributes))
Model\GenAI\GenAIVisualizerDialogViewModel.cs (10)
70viewModel.ModelName = viewModel.Span.Attributes.GetValue(GenAIHelpers.GenAIResponseModel); 71viewModel.InputTokens = viewModel.Span.Attributes.GetValueAsInteger(GenAIHelpers.GenAIUsageInputTokens); 72viewModel.OutputTokens = viewModel.Span.Attributes.GetValueAsInteger(GenAIHelpers.GenAIUsageOutputTokens); 182var systemInstructions = viewModel.Span.Attributes.GetValue(GenAIHelpers.GenAISystemInstructions); 183var inputMessages = viewModel.Span.Attributes.GetValue(GenAIHelpers.GenAIInputMessages); 184var outputMessages = viewModel.Span.Attributes.GetValue(GenAIHelpers.GenAIOutputInstructions); 190var instructionParts = DeserializeWithErrorHandling(GenAIHelpers.GenAISystemInstructions, systemInstructions, GenAIMessagesContext.Default.ListMessagePart)!; 196ParseMessages(viewModel, inputMessages, GenAIHelpers.GenAIInputMessages, isOutput: false, ref currentIndex); 200ParseMessages(viewModel, outputMessages, GenAIHelpers.GenAIOutputInstructions, isOutput: true, ref currentIndex); 229var content = item.Attributes.GetValue(GenAIHelpers.GenAIEventContent);
Aspire.Dashboard.Components.Tests (3)
Controls\GenAIVisualizerDialogTests.cs (3)
100KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 101KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 102KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages)
Aspire.Dashboard.Tests (22)
Model\GenAIVisualizerDialogViewModelTests.cs (22)
139CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), KeyValuePair.Create("server.address", "ai-server.address")]) 229KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new SystemOrUserEvent { Content = "System!" }, GenAIEventsContext.Default.SystemOrUserEvent)), 230KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 236KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new SystemOrUserEvent { Content = "User!" }, GenAIEventsContext.Default.SystemOrUserEvent)), 237KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 243KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new AssistantEvent { Content = "Assistant!" }, GenAIEventsContext.Default.AssistantEvent)), 249KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new AssistantEvent { Content = "Assistant!" }, GenAIEventsContext.Default.AssistantEvent)), 250KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 267CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), KeyValuePair.Create("server.address", "ai-server.address")], events: events) 350KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 352KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 353KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 354KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 466KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 468KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 469KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 470KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 546KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 548KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 549KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 550KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 633KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"),