16 instantiations of TextPart
Aspire.Dashboard (5)
GenAIMessagesContext.TextPart.g.cs (1)
31ObjectCreator = () => new global::Aspire.Dashboard.Model.GenAI.TextPart(),
Model\GenAI\GenAIVisualizerDialogViewModel.cs (4)
355GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = content }) 382GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = content }) 457messagePartViewModels.Add(GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = systemOrUserEvent.Content })); 490messagePartViewModels.Add(GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = assistantEvent.Content }));
Aspire.Dashboard.Components.Tests (3)
Controls\GenAIVisualizerDialogTests.cs (3)
66new TextPart { Content = "System!" } 74Parts = [new TextPart { Content = "User!" }] 93Parts = [new TextPart { Content = "Output!" }]
Aspire.Dashboard.Tests (8)
Model\GenAIVisualizerDialogViewModelTests.cs (8)
490new TextPart { Content = "System!" } 498Parts = [new TextPart { Content = "User!" }] 517Parts = [new TextPart { Content = "Output!" }] 613new TextPart { Content = "System!" } 621Parts = [new TextPart { Content = "User!" }] 686new TextPart { Content = "" } 694Parts = [new TextPart { Content = "" }] 713Parts = [new TextPart { Content = "" }]
47 references to TextPart
Aspire.Dashboard (21)
GenAIMessagesContext.GetJsonTypeInfo.g.cs (1)
34if (type == typeof(global::Aspire.Dashboard.Model.GenAI.TextPart))
GenAIMessagesContext.TextPart.g.cs (16)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart>? _TextPart; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart> TextPart 22get => _TextPart ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Model.GenAI.TextPart)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart> Create_TextPart(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Model.GenAI.TextPart>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Dashboard.Model.GenAI.TextPart> 35ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.TextPart).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Dashboard.Model.GenAI.TextPart>(options, objectInfo); 56DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.TextPart), 58Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.TextPart)obj).Content, 59Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.TextPart)obj).Content = value!, 66AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.TextPart).GetProperty("Content", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 98private void TextPartSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Dashboard.Model.GenAI.TextPart? value) 108string __value_Content = ((global::Aspire.Dashboard.Model.GenAI.TextPart)value).Content;
Model\GenAI\GenAIItemPartViewModel.cs (1)
60if (p is TextPart textPart)
Model\GenAI\GenAIMessages.cs (2)
116MessagePart.TextType => JsonSerializer.Deserialize<TextPart>(doc.RootElement.GetRawText(), options), 135[JsonSerializable(typeof(TextPart))]
Model\GenAI\GenAIVisualizerDialogViewModel.cs (1)
207if (partViewModel.MessagePart is TextPart textPart)
Aspire.Dashboard.Tests (26)
Model\GenAIVisualizerDialogViewModelTests.cs (26)
197p => Assert.Equal("System!", Assert.IsType<TextPart>(p.MessagePart).Content)); 204p => Assert.Equal("User!", Assert.IsType<TextPart>(p.MessagePart).Content)); 211p => Assert.Equal("Assistant!", Assert.IsType<TextPart>(p.MessagePart).Content)); 357p => Assert.Equal("System!", Assert.IsType<TextPart>(p.MessagePart).Content)); 364p => Assert.Equal("User!", Assert.IsType<TextPart>(p.MessagePart).Content)); 371p => Assert.Equal("Assistant!", Assert.IsType<TextPart>(p.MessagePart).Content)); 564p => Assert.Equal("System!", Assert.IsType<TextPart>(p.MessagePart).Content)); 571p => Assert.Equal("User!", Assert.IsType<TextPart>(p.MessagePart).Content)); 597p => Assert.Equal("Output!", Assert.IsType<TextPart>(p.MessagePart).Content)); 760p => Assert.Equal("", Assert.IsType<TextPart>(p.MessagePart).Content)); 767p => Assert.Equal("", Assert.IsType<TextPart>(p.MessagePart).Content)); 793p => Assert.Equal("", Assert.IsType<TextPart>(p.MessagePart).Content)); 897p => Assert.Equal("You are a helpful assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 904p => Assert.Equal("Hello, how are you?", Assert.IsType<TextPart>(p.MessagePart).Content)); 911p => Assert.Equal("I'm doing well, thank you!", Assert.IsType<TextPart>(p.MessagePart).Content)); 973p => Assert.Equal("You are a coding assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 980p => Assert.Equal("Write a hello world program.", Assert.IsType<TextPart>(p.MessagePart).Content)); 987p => Assert.Equal("Here's a simple hello world program...", Assert.IsType<TextPart>(p.MessagePart).Content)); 1057p => Assert.Equal("You are a helpful assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 1064p => Assert.Equal("What is 2+2?", Assert.IsType<TextPart>(p.MessagePart).Content)); 1071p => Assert.Equal("Follow up question.", Assert.IsType<TextPart>(p.MessagePart).Content)); 1078p => Assert.Equal("The answer is 4.", Assert.IsType<TextPart>(p.MessagePart).Content)); 1085p => Assert.Equal("Follow up answer.", Assert.IsType<TextPart>(p.MessagePart).Content)); 1362p => Assert.Equal("You are a helpful assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 1368p => Assert.Equal("Hello!", Assert.IsType<TextPart>(p.MessagePart).Content)); 1374p => Assert.Equal("Hi there!", Assert.IsType<TextPart>(p.MessagePart).Content));