@ai-sdk/openai
Advanced tools
Comparing version 0.0.53 to 0.0.54
@@ -1264,2 +1264,3 @@ "use strict"; | ||
provider.textEmbedding = createEmbeddingModel; | ||
provider.textEmbeddingModel = createEmbeddingModel; | ||
return provider; | ||
@@ -1266,0 +1267,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider'; | ||
import { LanguageModelV1, ProviderV1, EmbeddingModelV1 } from '@ai-sdk/provider'; | ||
import { FetchFunction } from '@ai-sdk/provider-utils'; | ||
@@ -175,44 +175,32 @@ | ||
type OpenAIEmbeddingConfig = { | ||
provider: string; | ||
url: (options: { | ||
modelId: string; | ||
path: string; | ||
}) => string; | ||
headers: () => Record<string, string | undefined>; | ||
fetch?: FetchFunction; | ||
}; | ||
declare class OpenAIEmbeddingModel implements EmbeddingModelV1<string> { | ||
readonly specificationVersion = "v1"; | ||
readonly modelId: OpenAIEmbeddingModelId; | ||
private readonly config; | ||
private readonly settings; | ||
get provider(): string; | ||
get maxEmbeddingsPerCall(): number; | ||
get supportsParallelCalls(): boolean; | ||
constructor(modelId: OpenAIEmbeddingModelId, settings: OpenAIEmbeddingSettings, config: OpenAIEmbeddingConfig); | ||
doEmbed({ values, headers, abortSignal, }: Parameters<EmbeddingModelV1<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV1<string>['doEmbed']>>>; | ||
} | ||
interface OpenAIProvider { | ||
interface OpenAIProvider extends ProviderV1 { | ||
(modelId: 'gpt-3.5-turbo-instruct', settings?: OpenAICompletionSettings): OpenAICompletionLanguageModel; | ||
(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): OpenAIChatLanguageModel; | ||
(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): LanguageModelV1; | ||
/** | ||
Creates an OpenAI model for text generation. | ||
*/ | ||
languageModel(modelId: 'gpt-3.5-turbo-instruct', settings?: OpenAICompletionSettings): OpenAICompletionLanguageModel; | ||
languageModel(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): OpenAIChatLanguageModel; | ||
languageModel(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): LanguageModelV1; | ||
/** | ||
Creates an OpenAI chat model for text generation. | ||
*/ | ||
chat(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): OpenAIChatLanguageModel; | ||
chat(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): LanguageModelV1; | ||
/** | ||
Creates an OpenAI completion model for text generation. | ||
*/ | ||
completion(modelId: OpenAICompletionModelId, settings?: OpenAICompletionSettings): OpenAICompletionLanguageModel; | ||
completion(modelId: OpenAICompletionModelId, settings?: OpenAICompletionSettings): LanguageModelV1; | ||
/** | ||
Creates a model for text embeddings. | ||
*/ | ||
embedding(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): OpenAIEmbeddingModel; | ||
embedding(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): EmbeddingModelV1<string>; | ||
/** | ||
Creates a model for text embeddings. | ||
@deprecated Use `textEmbeddingModel` instead. | ||
*/ | ||
textEmbedding(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): OpenAIEmbeddingModel; | ||
textEmbedding(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): EmbeddingModelV1<string>; | ||
/** | ||
Creates a model for text embeddings. | ||
*/ | ||
textEmbeddingModel(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): EmbeddingModelV1<string>; | ||
} | ||
@@ -219,0 +207,0 @@ interface OpenAIProviderSettings { |
@@ -1264,2 +1264,3 @@ "use strict"; | ||
provider.textEmbedding = createEmbeddingModel; | ||
provider.textEmbeddingModel = createEmbeddingModel; | ||
return provider; | ||
@@ -1266,0 +1267,0 @@ } |
{ | ||
"name": "@ai-sdk/openai", | ||
"version": "0.0.53", | ||
"version": "0.0.54", | ||
"license": "Apache-2.0", | ||
@@ -28,4 +28,4 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@ai-sdk/provider": "0.0.21", | ||
"@ai-sdk/provider-utils": "1.0.16" | ||
"@ai-sdk/provider": "0.0.22", | ||
"@ai-sdk/provider-utils": "1.0.17" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
544005
6507
+ Added@ai-sdk/provider@0.0.22(transitive)
+ Added@ai-sdk/provider-utils@1.0.17(transitive)
- Removed@ai-sdk/provider@0.0.21(transitive)
- Removed@ai-sdk/provider-utils@1.0.16(transitive)
Updated@ai-sdk/provider@0.0.22