4 types derived from MessagePart
Aspire.Dashboard (4)
Model\GenAI\GenAIMessages.cs (4)
28public class TextPart : MessagePart 41public class ToolCallRequestPart : MessagePart 56public class ToolCallResponsePart : MessagePart 70public class GenericPart : MessagePart
64 references to MessagePart
Aspire.Dashboard (60)
GenAIMessagesContext.ChatMessage.g.cs (4)
73var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> 88AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.ChatMessage).GetProperty("Parts", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>), global::System.Array.Empty<global::System.Type>(), null), 91properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>>(options, info1); 135global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart> __value_Parts = ((global::Aspire.Dashboard.Model.GenAI.ChatMessage)value).Parts;
GenAIMessagesContext.GenericPart.g.cs (4)
76DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 78Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 79Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 86AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart).GetProperty("Type", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
GenAIMessagesContext.GetJsonTypeInfo.g.cs (2)
30if (type == typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart)) 54if (type == typeof(global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>))
GenAIMessagesContext.ListMessagePart.g.cs (12)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>>? _ListMessagePart; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> ListMessagePart 22get => _ListMessagePart ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> Create_ListMessagePart(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> jsonTypeInfo)) 29var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> 31ObjectCreator = () => new global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>(), 35jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>, global::Aspire.Dashboard.Model.GenAI.MessagePart>(options, info); 45private void ListMessagePartSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>? value)
GenAIMessagesContext.MessagePart.g.cs (9)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart>? _MessagePart; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> MessagePart 22get => _MessagePart ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> Create_MessagePart(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Model.GenAI.MessagePart>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> jsonTypeInfo)) 29global::System.Text.Json.Serialization.JsonConverter converter = ExpandConverter(typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), new global::Aspire.Dashboard.Model.GenAI.MessagePartConverter(), options); 30jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> (options, converter);
GenAIMessagesContext.TextPart.g.cs (5)
76DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 78Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 79Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 86AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart).GetProperty("Type", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 113string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
GenAIMessagesContext.ToolCallRequestPart.g.cs (5)
116DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 118Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 119Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 126AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart).GetProperty("Type", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 164string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
GenAIMessagesContext.ToolCallResponsePart.g.cs (5)
96DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 98Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 99Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 106AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart).GetProperty("Type", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 139string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
Model\GenAI\GenAIItemPartViewModel.cs (3)
22public MessagePart? MessagePart { get; init; } 46public static GenAIItemPartViewModel CreateMessagePart(MessagePart part) 58private static TextVisualizerViewModel CreateMessagePartVisualizer(MessagePart p)
Model\GenAI\GenAIItemViewModel.cs (3)
40if (ItemParts.Any(p => p.MessagePart?.Type == MessagePart.ToolCallType)) 49if (ItemParts.Any(p => p.MessagePart?.Type == MessagePart.ToolCallType)) 53if (ItemParts.Any(p => p.MessagePart?.Type == MessagePart.ToolCallResponseType))
Model\GenAI\GenAIMessages.cs (8)
83public List<MessagePart> Parts { get; set; } = new(); 103public class MessagePartConverter : JsonConverter<MessagePart> 105public override MessagePart? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 116MessagePart.TextType => JsonSerializer.Deserialize<TextPart>(doc.RootElement.GetRawText(), options), 117MessagePart.ToolCallType => JsonSerializer.Deserialize<ToolCallRequestPart>(doc.RootElement.GetRawText(), options), 118MessagePart.ToolCallResponseType => JsonSerializer.Deserialize<ToolCallResponsePart>(doc.RootElement.GetRawText(), options), 123public override void Write(Utf8JsonWriter writer, MessagePart value, JsonSerializerOptions options) 130[JsonSerializable(typeof(MessagePart))]
Aspire.Dashboard.Components.Tests (1)
Controls\GenAIVisualizerDialogTests.cs (1)
64var systemInstruction = JsonSerializer.Serialize(new List<MessagePart>
Aspire.Dashboard.Tests (3)
Model\GenAIVisualizerDialogViewModelTests.cs (3)
316var systemInstruction = JsonSerializer.Serialize(new List<MessagePart> 439var systemInstruction = JsonSerializer.Serialize(new List<MessagePart> 512var systemInstruction = JsonSerializer.Serialize(new List<MessagePart>