UriContent 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
| Name | Description |
|---|---|
| UriContent(String, String) |
Initializes a new instance of the UriContent class. |
| UriContent(Uri, String) |
Initializes a new instance of the UriContent class. |
UriContent(String, String)
- Source:
- UriContent.cs
Initializes a new instance of the UriContent class.
public:
UriContent(System::String ^ uri, System::String ^ mediaType);
public UriContent(string uri, string mediaType);
new Microsoft.Extensions.AI.UriContent : string * string -> Microsoft.Extensions.AI.UriContent
Public Sub New (uri As String, mediaType As String)
Parameters
- uri
- String
The URI to the represented content.
- mediaType
- String
The media type (also known as MIME type) represented by the content.
Exceptions
uri is an invalid URL.
mediaType is null.
mediaType is an invalid media type.
uri is an invalid URL.
Remarks
A media type must be specified, so that consumers know what to do with the content. If an exact media type is not known, but the category (e.g. image) is known, a wildcard may be used (e.g. "image/*").
Applies to
UriContent(Uri, String)
- Source:
- UriContent.cs
Initializes a new instance of the UriContent class.
public:
UriContent(Uri ^ uri, System::String ^ mediaType);
[System.Text.Json.Serialization.JsonConstructor]
public UriContent(Uri uri, string mediaType);
[<System.Text.Json.Serialization.JsonConstructor>]
new Microsoft.Extensions.AI.UriContent : Uri * string -> Microsoft.Extensions.AI.UriContent
Public Sub New (uri As Uri, mediaType As String)
Parameters
- uri
- Uri
The URI to the represented content.
- mediaType
- String
The media type (also known as MIME type) represented by the content.
- Attributes
Exceptions
mediaType is null.
mediaType is an invalid media type.
Remarks
A media type must be specified, so that consumers know what to do with the content. If an exact media type is not known, but the category (e.g. image) is known, a wildcard may be used (e.g. "image/*").