File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ namespace Microsoft.Extensions.AI;
2525/// a <see cref="ReadOnlyMemory{T}"/>. In that case, a data URI will be constructed and returned.
2626/// </para>
2727/// </remarks>
28+ [ DebuggerDisplay ( "{DebuggerDisplay,nq}" ) ]
2829public class DataContent : AIContent
2930{
3031 // Design note:
@@ -193,4 +194,16 @@ public ReadOnlyMemory<byte>? Data
193194 return _data ;
194195 }
195196 }
197+
198+ /// <summary>Gets a string representing this instance to display in the debugger.</summary>
199+ private string DebuggerDisplay
200+ {
201+ get
202+ {
203+ const int MaxLength = 80 ;
204+
205+ string uri = Uri ;
206+ return uri . Length <= MaxLength ? uri : $ "{ uri . Substring ( 0 , MaxLength ) } ...";
207+ }
208+ }
196209}
You can’t perform that action at this time.
0 commit comments