microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.AI/Messages/FunctionMessage.cs
28lines · modecode
| 1 | using System.Text.Json; |
| 2 | using System.Text.Json.Serialization; |
| 3 | |
| 4 | namespace Microsoft.Teams.AI.Messages; |
| 5 | |
| 6 | public class FunctionMessage : IMessage |
| 7 | { |
| 8 | [JsonPropertyName("role")] |
| 9 | [JsonPropertyOrder(0)] |
| 10 | public Role Role => Role.Function; |
| 11 | |
| 12 | [JsonPropertyName("content")] |
| 13 | [JsonPropertyOrder(1)] |
| 14 | public string? Content { get; set; } |
| 15 | |
| 16 | [JsonPropertyName("function_id")] |
| 17 | [JsonPropertyOrder(2)] |
| 18 | public required string FunctionId { get; set; } |
| 19 | |
| 20 | public override string ToString() |
| 21 | { |
| 22 | return JsonSerializer.Serialize(this, new JsonSerializerOptions() |
| 23 | { |
| 24 | WriteIndented = true, |
| 25 | DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull |
| 26 | }); |
| 27 | } |
| 28 | } |