Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Microsoft.Extensions.AI;
/// a <see cref="ReadOnlyMemory{T}"/>. In that case, a data URI will be constructed and returned.
/// </para>
/// </remarks>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class DataContent : AIContent
{
// Design note:
Expand Down Expand Up @@ -193,4 +194,16 @@ public ReadOnlyMemory<byte>? Data
return _data;
}
}

/// <summary>Gets a string representing this instance to display in the debugger.</summary>
private string DebuggerDisplay
{
get
{
const int MaxLength = 80;

string uri = Uri;
return uri.Length <= MaxLength ? uri : $"{uri.Substring(0, MaxLength)}...";
}
}
}