UrlSupport
Namespace: Vercel.AI.ProviderUtils
public static class UrlSupportChecks whether a model can read a URL natively. Maps to isUrlSupported.
Inheritance: object
Methods
Section titled “Methods”IsUrlSupported(string, string, IReadOnlyDictionary<string, IReadOnlyList<Regex>>)
Section titled “IsUrlSupported(string, string, IReadOnlyDictionary<string, IReadOnlyList<Regex>>)”public static bool IsUrlSupported(string mediaType, string url, IReadOnlyDictionary<string, IReadOnlyList<Regex>> supportedUrls)True when a pattern registered for <code class=“paramref”>mediaType</code>, its type/* prefix, or * matches <code class=“paramref”>url</code>.
The media type is compared in lower case; the URL keeps its case, so patterns decide case sensitivity. A top-level-only media type such as image only matches image/*.
Parameters
| Name | Type | Description |
|---|---|---|
mediaType |
string | |
url |
string | |
supportedUrls |
IReadOnlyDictionary<string, IReadOnlyList<Regex>> |
Returns: bool
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product