@digipair/skill-openai 0.116.3 → 0.116.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.esm.js +4 -4
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4,11 +4,11 @@ var openai = require('@langchain/openai');
|
|
|
4
4
|
|
|
5
5
|
let OpenAIService = class OpenAIService {
|
|
6
6
|
async model(params, _pinsSettingsList, context) {
|
|
7
|
-
const { modelName = 'gpt-4o-mini', temperature = 0, baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'],
|
|
7
|
+
const { modelName = 'gpt-4o-mini', temperature = 0, baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'], apiKey = context.privates.OPENAI_API_KEY ?? process.env['OPENAI_API_KEY'], configuration = {} } = params;
|
|
8
8
|
const model = new openai.ChatOpenAI({
|
|
9
9
|
modelName,
|
|
10
10
|
temperature,
|
|
11
|
-
|
|
11
|
+
apiKey,
|
|
12
12
|
configuration: {
|
|
13
13
|
baseURL
|
|
14
14
|
},
|
|
@@ -29,13 +29,13 @@ let OpenAIService = class OpenAIService {
|
|
|
29
29
|
return model;
|
|
30
30
|
}
|
|
31
31
|
async embeddings(params, _pinsSettingsList, context) {
|
|
32
|
-
const { modelName = 'text-embedding-3-small', baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'],
|
|
32
|
+
const { modelName = 'text-embedding-3-small', baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'], apiKey = context.privates.OPENAI_API_KEY ?? process.env['OPENAI_API_KEY'], dimensions, configuration = {} } = params;
|
|
33
33
|
const config = {
|
|
34
34
|
configuration: {
|
|
35
35
|
baseURL
|
|
36
36
|
},
|
|
37
37
|
modelName,
|
|
38
|
-
|
|
38
|
+
apiKey,
|
|
39
39
|
...configuration
|
|
40
40
|
};
|
|
41
41
|
const modelInstance = new openai.OpenAIEmbeddings(!!dimensions ? {
|
package/dist/index.esm.js
CHANGED
|
@@ -116328,11 +116328,11 @@ var _class;
|
|
|
116328
116328
|
|
|
116329
116329
|
let OpenAIService = class OpenAIService {
|
|
116330
116330
|
async model(params, _pinsSettingsList, context) {
|
|
116331
|
-
const { modelName = 'gpt-4o-mini', temperature = 0, baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'],
|
|
116331
|
+
const { modelName = 'gpt-4o-mini', temperature = 0, baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'], apiKey = context.privates.OPENAI_API_KEY ?? process.env['OPENAI_API_KEY'], configuration = {} } = params;
|
|
116332
116332
|
const model = new ChatOpenAI({
|
|
116333
116333
|
modelName,
|
|
116334
116334
|
temperature,
|
|
116335
|
-
|
|
116335
|
+
apiKey,
|
|
116336
116336
|
configuration: {
|
|
116337
116337
|
baseURL
|
|
116338
116338
|
},
|
|
@@ -116353,13 +116353,13 @@ let OpenAIService = class OpenAIService {
|
|
|
116353
116353
|
return model;
|
|
116354
116354
|
}
|
|
116355
116355
|
async embeddings(params, _pinsSettingsList, context) {
|
|
116356
|
-
const { modelName = 'text-embedding-3-small', baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'],
|
|
116356
|
+
const { modelName = 'text-embedding-3-small', baseURL = context.privates.OPENAI_SERVER ?? process.env['OPENAI_SERVER'], apiKey = context.privates.OPENAI_API_KEY ?? process.env['OPENAI_API_KEY'], dimensions, configuration = {} } = params;
|
|
116357
116357
|
const config = {
|
|
116358
116358
|
configuration: {
|
|
116359
116359
|
baseURL
|
|
116360
116360
|
},
|
|
116361
116361
|
modelName,
|
|
116362
|
-
|
|
116362
|
+
apiKey,
|
|
116363
116363
|
...configuration
|
|
116364
116364
|
};
|
|
116365
116365
|
const modelInstance = new OpenAIEmbeddings(!!dimensions ? {
|