Skip to content

ProviderReferences

Namespace: Vercel.AI.ProviderUtils

public static class ProviderReferences

Helpers for provider references: maps from provider name to a provider-specific id.

Inheritance: object

View source

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

View source

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>.

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product