microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.AI/Messages/FunctionMessage.cs
32lines · 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 | [Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")] |
| 10 | public class FunctionMessage : IMessage |
| 11 | { |
| 12 | [JsonPropertyName("role")] |
| 13 | [JsonPropertyOrder(0)] |
| 14 | public Role Role => Role.Function; |
| 15 | |
| 16 | [JsonPropertyName("content")] |
| 17 | [JsonPropertyOrder(1)] |
| 18 | public string? Content { get; set; } |
| 19 | |
| 20 | [JsonPropertyName("function_id")] |
| 21 | [JsonPropertyOrder(2)] |
| 22 | public required string FunctionId { get; set; } |
| 23 | |
| 24 | public override string ToString() |
| 25 | { |
| 26 | return JsonSerializer.Serialize(this, new JsonSerializerOptions() |
| 27 | { |
| 28 | WriteIndented = true, |
| 29 | DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull |
| 30 | }); |
| 31 | } |
| 32 | } |