TypeSafeAiProvider
Namespace: Vercel.AI.TypeSafeAi
public sealed class TypeSafeAiProviderTypeSafe’s experimental decision capability. It has no language, embedding, or image models.
Inheritance: object
Constructors
Section titled “Constructors”TypeSafeAiProvider(TypeSafeAiOptions?, HttpClient?)
Section titled “TypeSafeAiProvider(TypeSafeAiOptions?, HttpClient?)”public TypeSafeAiProvider(TypeSafeAiOptions? options = null, HttpClient? httpClient = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
options |
TypeSafeAiOptions | |
httpClient |
HttpClient |
Fields
Section titled “Fields”ApiKeyEnvironmentVariable
Section titled “ApiKeyEnvironmentVariable”public const string ApiKeyEnvironmentVariable = "TYPESAFE_AI_API_KEY"Environment variable for the API key.
Value: string
BaseUrlEnvironmentVariable
Section titled “BaseUrlEnvironmentVariable”public const string BaseUrlEnvironmentVariable = "TYPESAFE_AI_BASE_URL"Environment variable for the API base URL.
Value: string
DecisionProviderId
Section titled “DecisionProviderId”public const string DecisionProviderId = "typesafe.decision"Provider id of the decision model.
Value: string
DefaultBaseUrl
Section titled “DefaultBaseUrl”public const string DefaultBaseUrl = "https://api.typesafe.ai/v1"Default API origin.
Value: string
EvaluationProviderId
Section titled “EvaluationProviderId”[Obsolete("Use DecisionProviderId instead.")]public const string EvaluationProviderId = "typesafe.decision"Deprecated alias of DecisionProviderId.
Value: string
Properties
Section titled “Properties”Default
Section titled “Default”public static TypeSafeAiProvider Default { get; }Provider that reads TYPESAFE_AI_API_KEY when a request is made.
It reads TYPESAFE_AI_BASE_URL when it is first created.
Value: TypeSafeAiProvider
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version.
Value: string
Methods
Section titled “Methods”Create(TypeSafeAiOptions?, HttpMessageHandler?)
Section titled “Create(TypeSafeAiOptions?, HttpMessageHandler?)”public static TypeSafeAiProvider Create(TypeSafeAiOptions? options = null, HttpMessageHandler? handler = null)Creates a provider. Pass a handler from tests.
Parameters
| Name | Type | Description |
|---|---|---|
options |
TypeSafeAiOptions | |
handler |
HttpMessageHandler |
Returns: TypeSafeAiProvider
DecisionModel(string)
Section titled “DecisionModel(string)”public TypeSafeAiDecisionModel DecisionModel(string modelId)Returns a decision model. The id may be one this library does not know yet.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: TypeSafeAiDecisionModel
EmbeddingModel(string)
Section titled “EmbeddingModel(string)”public IEmbeddingModel EmbeddingModel(string modelId)TypeSafe has no embedding models.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IEmbeddingModel
EvaluationModel(string)
Section titled “EvaluationModel(string)”[Obsolete("Use DecisionModel instead.")]public TypeSafeAiEvaluationModel EvaluationModel(string modelId)Deprecated alias of DecisionModel(string).
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: TypeSafeAiEvaluationModel
ImageModel(string)
Section titled “ImageModel(string)”public IImageModel ImageModel(string modelId)TypeSafe has no image models.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IImageModel
LanguageModel(string)
Section titled “LanguageModel(string)”public ILanguageModel LanguageModel(string modelId)TypeSafe has no language models.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ILanguageModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product