| File: Contents\TextContent.cs | Web Access |
| Project: src\src\Libraries\Microsoft.Extensions.AI.Abstractions\Microsoft.Extensions.AI.Abstractions.csproj (Microsoft.Extensions.AI.Abstractions) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.Diagnostics.CodeAnalysis; namespace Microsoft.Extensions.AI; /// <summary> /// Represents text content in a chat. /// </summary> [DebuggerDisplay("{DebuggerDisplay,nq}")] public sealed class TextContent : AIContent { /// <summary> /// Initializes a new instance of the <see cref="TextContent"/> class. /// </summary> /// <param name="text">The text content.</param> public TextContent(string? text) { Text = text; } /// <summary> /// Gets or sets the text content. /// </summary> [AllowNull] public string Text { get => field ?? string.Empty; set; } /// <inheritdoc/> public override string ToString() => Text; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private string DebuggerDisplay => $"Text = \"{Text}\""; }