Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/openai

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/openai - npm Package Compare versions

Comparing version 0.0.53 to 0.0.54

1

./dist/index.js

@@ -1264,2 +1264,3 @@ "use strict";

provider.textEmbedding = createEmbeddingModel;
provider.textEmbeddingModel = createEmbeddingModel;
return provider;

@@ -1266,0 +1267,0 @@ }

46

dist/index.d.ts

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc