4 types derived from MessagePart
Aspire.Dashboard (4)
Model\GenAI\GenAIMessages.cs (4)
26public class TextPart : MessagePart 39public class ToolCallRequestPart : MessagePart 54public class ToolCallResponsePart : MessagePart 68public class GenericPart : MessagePart
58 references to MessagePart
Aspire.Dashboard (54)
GenAIMessagesContext.ChatMessage.g.cs (3)
67var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> 84properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>>(options, info1); 125global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart> __value_Parts = ((global::Aspire.Dashboard.Model.GenAI.ChatMessage)value).Parts;
GenAIMessagesContext.GenericPart.g.cs (3)
72DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 74Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 75Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!,
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; 18public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> ListMessagePart 20get => _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>)); 23private 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) 25if (!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)) 27var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues<global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>> 29ObjectCreator = () => new global::System.Collections.Generic.List<global::Aspire.Dashboard.Model.GenAI.MessagePart>(), 33jsonTypeInfo = 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); 43private 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; 18public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> MessagePart 20get => _MessagePart ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart)); 23private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> Create_MessagePart(global::System.Text.Json.JsonSerializerOptions options) 25if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Model.GenAI.MessagePart>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> jsonTypeInfo)) 27global::System.Text.Json.Serialization.JsonConverter converter = ExpandConverter(typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), new global::Aspire.Dashboard.Model.GenAI.MessagePartConverter(), options); 28jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::Aspire.Dashboard.Model.GenAI.MessagePart> (options, converter);
GenAIMessagesContext.TextPart.g.cs (4)
72DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 74Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 75Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 106string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
GenAIMessagesContext.ToolCallRequestPart.g.cs (4)
110DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 112Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 113Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 155string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
GenAIMessagesContext.ToolCallResponsePart.g.cs (4)
91DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.MessagePart), 93Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type, 94Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type = value!, 131string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
Model\GenAI\GenAIItemPartViewModel.cs (3)
21public MessagePart? MessagePart { get; init; } 39public static GenAIItemPartViewModel CreateMessagePart(MessagePart part) 51private static TextVisualizerViewModel CreateMessagePartVisualizer(MessagePart p)
Model\GenAI\GenAIItemViewModel.cs (2)
40if (ItemParts.Any(p => p.MessagePart?.Type == MessagePart.ToolCallType)) 49if (ItemParts.Any(p => p.MessagePart?.Type == MessagePart.ToolCallType))
Model\GenAI\GenAIMessages.cs (8)
81public List<MessagePart> Parts { get; set; } = new(); 89public class MessagePartConverter : JsonConverter<MessagePart> 91public override MessagePart? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 102MessagePart.TextType => JsonSerializer.Deserialize<TextPart>(doc.RootElement.GetRawText(), options), 103MessagePart.ToolCallType => JsonSerializer.Deserialize<ToolCallRequestPart>(doc.RootElement.GetRawText(), options), 104MessagePart.ToolCallResponseType => JsonSerializer.Deserialize<ToolCallResponsePart>(doc.RootElement.GetRawText(), options), 109public override void Write(Utf8JsonWriter writer, MessagePart value, JsonSerializerOptions options) 116[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)
315var systemInstruction = JsonSerializer.Serialize(new List<MessagePart> 438var systemInstruction = JsonSerializer.Serialize(new List<MessagePart> 511var systemInstruction = JsonSerializer.Serialize(new List<MessagePart>