ProviderReferences
Namespace: Vercel.AI.ProviderUtils
public static class ProviderReferencesHelpers for provider references: maps from provider name to a provider-specific id.
Inheritance: object
Methods
Section titled “Methods”IsProviderReference(object?)
Section titled “IsProviderReference(object?)”public static bool IsProviderReference(object? data)True for a plain dictionary without a type key. Strings, URLs, bytes, arrays, and primitives are not references.
Maps to isProviderReference.
Parameters
| Name | Type | Description |
|---|---|---|
data |
object |
Returns: bool
ResolveProviderReference(IReadOnlyDictionary<string, string>, string)
Section titled “ResolveProviderReference(IReadOnlyDictionary<string, string>, string)”public static string ResolveProviderReference(IReadOnlyDictionary<string, string> reference, string provider)Returns the id for <code class=“paramref”>provider</code>. Maps to resolveProviderReference.
Parameters
| Name | Type | Description |
|---|---|---|
reference |
IReadOnlyDictionary<string, string> | |
provider |
string |
Returns: string
Exceptions
| Type | Condition |
|---|---|
| NoSuchProviderReferenceError | The reference has no entry for <code class=“paramref”>provider</code>. |
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product