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.28 to 0.0.29

31

./dist/index.js

@@ -264,3 +264,4 @@ "use strict";

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -309,3 +310,4 @@ const { messages: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -772,3 +774,4 @@ const { messages: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -805,3 +808,4 @@ const { prompt: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -1007,3 +1011,4 @@ const { prompt: rawPrompt, ...rawSettings } = args;

),
abortSignal
abortSignal,
fetch: this.config.fetch
});

@@ -1043,3 +1048,4 @@ return {

headers: getHeaders,
compatibility
compatibility,
fetch: options.fetch
});

@@ -1050,3 +1056,4 @@ const createCompletionModel = (modelId, settings = {}) => new OpenAICompletionLanguageModel(modelId, settings, {

headers: getHeaders,
compatibility
compatibility,
fetch: options.fetch
});

@@ -1056,5 +1063,6 @@ const createEmbeddingModel = (modelId, settings = {}) => new OpenAIEmbeddingModel(modelId, settings, {

baseURL,
headers: getHeaders
headers: getHeaders,
fetch: options.fetch
});
const provider = function(modelId, settings) {
const createLanguageModel = (modelId, settings) => {
if (new.target) {

@@ -1073,5 +1081,10 @@ throw new Error(

};
const provider = function(modelId, settings) {
return createLanguageModel(modelId, settings);
};
provider.languageModel = createLanguageModel;
provider.chat = createChatModel;
provider.completion = createCompletionModel;
provider.embedding = createEmbeddingModel;
provider.textEmbedding = createEmbeddingModel;
return provider;

@@ -1078,0 +1091,0 @@ }

@@ -51,2 +51,3 @@ import { LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';

}) => string;
fetch?: typeof fetch;
};

@@ -115,2 +116,3 @@ declare class OpenAIChatLanguageModel implements LanguageModelV1 {

headers: () => Record<string, string | undefined>;
fetch?: typeof fetch;
};

@@ -156,2 +158,3 @@ declare class OpenAICompletionLanguageModel implements LanguageModelV1 {

headers: () => Record<string, string | undefined>;
fetch?: typeof fetch;
};

@@ -173,2 +176,4 @@ declare class OpenAIEmbeddingModel implements EmbeddingModelV1<string> {

(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): OpenAIChatLanguageModel;
languageModel(modelId: 'gpt-3.5-turbo-instruct', settings?: OpenAICompletionSettings): OpenAICompletionLanguageModel;
languageModel(modelId: OpenAIChatModelId, settings?: OpenAIChatSettings): OpenAIChatLanguageModel;
/**

@@ -186,2 +191,6 @@ Creates an OpenAI chat model for text generation.

embedding(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): OpenAIEmbeddingModel;
/**
Creates a model for text embeddings.
*/
textEmbedding(modelId: OpenAIEmbeddingModelId, settings?: OpenAIEmbeddingSettings): OpenAIEmbeddingModel;
}

@@ -219,2 +228,7 @@ interface OpenAIProviderSettings {

compatibility?: 'strict' | 'compatible';
/**
Custom fetch implementation. You can use it as a middleware to intercept requests,
or to provide a custom fetch implementation for e.g. testing.
*/
fetch?: typeof fetch;
}

@@ -221,0 +235,0 @@ /**

@@ -264,3 +264,4 @@ "use strict";

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -309,3 +310,4 @@ const { messages: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -772,3 +774,4 @@ const { messages: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -805,3 +808,4 @@ const { prompt: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -1007,3 +1011,4 @@ const { prompt: rawPrompt, ...rawSettings } = args;

),
abortSignal
abortSignal,
fetch: this.config.fetch
});

@@ -1043,3 +1048,4 @@ return {

headers: getHeaders,
compatibility
compatibility,
fetch: options.fetch
});

@@ -1050,3 +1056,4 @@ const createCompletionModel = (modelId, settings = {}) => new OpenAICompletionLanguageModel(modelId, settings, {

headers: getHeaders,
compatibility
compatibility,
fetch: options.fetch
});

@@ -1056,5 +1063,6 @@ const createEmbeddingModel = (modelId, settings = {}) => new OpenAIEmbeddingModel(modelId, settings, {

baseURL,
headers: getHeaders
headers: getHeaders,
fetch: options.fetch
});
const provider = function(modelId, settings) {
const createLanguageModel = (modelId, settings) => {
if (new.target) {

@@ -1073,5 +1081,10 @@ throw new Error(

};
const provider = function(modelId, settings) {
return createLanguageModel(modelId, settings);
};
provider.languageModel = createLanguageModel;
provider.chat = createChatModel;
provider.completion = createCompletionModel;
provider.embedding = createEmbeddingModel;
provider.textEmbedding = createEmbeddingModel;
return provider;

@@ -1078,0 +1091,0 @@ }

@@ -51,2 +51,3 @@ import { LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';

}) => string;
fetch?: typeof fetch;
};

@@ -115,2 +116,3 @@ declare class OpenAIChatLanguageModel implements LanguageModelV1 {

headers: () => Record<string, string | undefined>;
fetch?: typeof fetch;
};

@@ -156,2 +158,3 @@ declare class OpenAICompletionLanguageModel implements LanguageModelV1 {

headers: () => Record<string, string | undefined>;
fetch?: typeof fetch;
};

@@ -158,0 +161,0 @@ declare class OpenAIEmbeddingModel implements EmbeddingModelV1<string> {

@@ -261,3 +261,4 @@ "use strict";

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -306,3 +307,4 @@ const { messages: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -769,3 +771,4 @@ const { messages: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -802,3 +805,4 @@ const { prompt: rawPrompt, ...rawSettings } = args;

),
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
fetch: this.config.fetch
});

@@ -955,3 +959,4 @@ const { prompt: rawPrompt, ...rawSettings } = args;

),
abortSignal
abortSignal,
fetch: this.config.fetch
});

@@ -958,0 +963,0 @@ return {

{
"name": "@ai-sdk/openai",
"version": "0.0.28",
"version": "0.0.29",
"license": "Apache-2.0",

@@ -29,3 +29,3 @@ "sideEffects": false,

"@ai-sdk/provider": "0.0.10",
"@ai-sdk/provider-utils": "0.0.13"
"@ai-sdk/provider-utils": "0.0.14"
},

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

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