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