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