ApiOrProvider<TApi, TProvider>
Namespace: Vercel.AI
public sealed class ApiOrProvider<TApi, TProvider> where TApi : class where TProvider : classAn API or a provider that exposes one. Maps to the upstream Api | ProviderV4 unions.
Type parameters
| Name | Description |
|---|---|
TApi |
The API type. |
TProvider |
The provider type that exposes the API. |
Inheritance: object
Properties
Section titled “Properties”public TApi? Api { get; }The API, when this wraps one.
Value: TApi
Provider
Section titled “Provider”public TProvider? Provider { get; }The provider, when this wraps one.
Value: TProvider
Methods
Section titled “Methods”FromApi(TApi)
Section titled “FromApi(TApi)”public static ApiOrProvider<TApi, TProvider> FromApi(TApi api)Wraps an API.
Parameters
| Name | Type | Description |
|---|---|---|
api |
TApi |
Returns: ApiOrProvider<TApi, TProvider>
FromProvider(TProvider)
Section titled “FromProvider(TProvider)”public static ApiOrProvider<TApi, TProvider> FromProvider(TProvider provider)Wraps a provider.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
TProvider |
Returns: ApiOrProvider<TApi, TProvider>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product