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)
346GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = content }) 373GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = content }) 448messagePartViewModels.Add(GenAIItemPartViewModel.CreateMessagePart(new TextPart { Content = systemOrUserEvent.Content })); 481messagePartViewModels.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)
318new TextPart { Content = "System!" } 326Parts = [new TextPart { Content = "User!" }] 345Parts = [new TextPart { Content = "Output!" }] 441new TextPart { Content = "System!" } 449Parts = [new TextPart { Content = "User!" }] 514new TextPart { Content = "" } 522Parts = [new TextPart { Content = "" }] 541Parts = [new TextPart { Content = "" }]
44 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), 131[JsonSerializable(typeof(TextPart))]
Model\GenAI\GenAIVisualizerDialogViewModel.cs (1)
201if (partViewModel.MessagePart is TextPart textPart)
Aspire.Dashboard.Tests (23)
Model\GenAIVisualizerDialogViewModelTests.cs (23)
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)); 289p => Assert.Equal("System!", Assert.IsType<TextPart>(p.MessagePart).Content)); 296p => Assert.Equal("User!", Assert.IsType<TextPart>(p.MessagePart).Content)); 303p => Assert.Equal("Assistant!", Assert.IsType<TextPart>(p.MessagePart).Content)); 392p => Assert.Equal("System!", Assert.IsType<TextPart>(p.MessagePart).Content)); 399p => Assert.Equal("User!", Assert.IsType<TextPart>(p.MessagePart).Content)); 425p => Assert.Equal("Output!", Assert.IsType<TextPart>(p.MessagePart).Content)); 588p => Assert.Equal("", Assert.IsType<TextPart>(p.MessagePart).Content)); 595p => Assert.Equal("", Assert.IsType<TextPart>(p.MessagePart).Content)); 621p => Assert.Equal("", Assert.IsType<TextPart>(p.MessagePart).Content)); 725p => Assert.Equal("You are a helpful assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 732p => Assert.Equal("Hello, how are you?", Assert.IsType<TextPart>(p.MessagePart).Content)); 739p => Assert.Equal("I'm doing well, thank you!", Assert.IsType<TextPart>(p.MessagePart).Content)); 801p => Assert.Equal("You are a coding assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 808p => Assert.Equal("Write a hello world program.", Assert.IsType<TextPart>(p.MessagePart).Content)); 815p => Assert.Equal("Here's a simple hello world program...", Assert.IsType<TextPart>(p.MessagePart).Content)); 885p => Assert.Equal("You are a helpful assistant.", Assert.IsType<TextPart>(p.MessagePart).Content)); 892p => Assert.Equal("What is 2+2?", Assert.IsType<TextPart>(p.MessagePart).Content)); 899p => Assert.Equal("Follow up question.", Assert.IsType<TextPart>(p.MessagePart).Content)); 906p => Assert.Equal("The answer is 4.", Assert.IsType<TextPart>(p.MessagePart).Content)); 913p => Assert.Equal("Follow up answer.", Assert.IsType<TextPart>(p.MessagePart).Content));