DataContent Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DataContent(ReadOnlyMemory<Byte>, String) |
Initializes a new instance of the DataContent class. |
DataContent(String, String) |
Initializes a new instance of the DataContent class. |
DataContent(Uri, String) |
Initializes a new instance of the DataContent class. |
DataContent(ReadOnlyMemory<Byte>, String)
- Source:
- DataContent.cs
Initializes a new instance of the DataContent class.
public:
DataContent(ReadOnlyMemory<System::Byte> data, System::String ^ mediaType);
public DataContent(ReadOnlyMemory<byte> data, string mediaType);
new Microsoft.Extensions.AI.DataContent : ReadOnlyMemory<byte> * string -> Microsoft.Extensions.AI.DataContent
Public Sub New (data As ReadOnlyMemory(Of Byte), mediaType As String)
Parameters
- data
- ReadOnlyMemory<Byte>
The byte contents.
- mediaType
- String
The media type (also known as MIME type) represented by the content.
Exceptions
mediaType
is null.
mediaType
is empty or composed entirely of whitespace.
Applies to
DataContent(String, String)
- Source:
- DataContent.cs
Initializes a new instance of the DataContent class.
[System.Text.Json.Serialization.JsonConstructor]
public DataContent(string uri, string? mediaType = default);
[<System.Text.Json.Serialization.JsonConstructor>]
new Microsoft.Extensions.AI.DataContent : string * string -> Microsoft.Extensions.AI.DataContent
Public Sub New (uri As String, Optional mediaType As String = Nothing)
Parameters
- uri
- String
The data URI containing the content.
- mediaType
- String
The media type (also known as MIME type) represented by the content.
- Attributes
Exceptions
uri
is null
.
mediaType
is an invalid media type.
Applies to
DataContent(Uri, String)
- Source:
- DataContent.cs
Initializes a new instance of the DataContent class.
public DataContent(Uri uri, string? mediaType = default);
new Microsoft.Extensions.AI.DataContent : Uri * string -> Microsoft.Extensions.AI.DataContent
Public Sub New (uri As Uri, Optional mediaType As String = Nothing)
Parameters
- uri
- Uri
The data URI containing the content.
- mediaType
- String
The media type (also known as MIME type) represented by the content. If not provided,
it must be provided as part of the uri
.
Exceptions
uri
is null
.
mediaType
is an invalid media type.