@ever-works/mistral-plugin 1.0.5 → 1.0.6
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 +12 -10
- package/dist/index.js +13 -11
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -20774,7 +20774,7 @@ function normalizeObjects(node2, strict) {
|
|
|
20774
20774
|
}
|
|
20775
20775
|
}
|
|
20776
20776
|
function toStructuredOutputJsonSchema(schema, strict) {
|
|
20777
|
-
const jsonSchema = external_exports.toJSONSchema(schema, {
|
|
20777
|
+
const { ...jsonSchema } = external_exports.toJSONSchema(schema, {
|
|
20778
20778
|
target: "draft-07",
|
|
20779
20779
|
io: "input",
|
|
20780
20780
|
unrepresentable: "any"
|
|
@@ -20941,7 +20941,7 @@ var AiOperations = class {
|
|
|
20941
20941
|
this.rejectedParams = /* @__PURE__ */ new Map();
|
|
20942
20942
|
}
|
|
20943
20943
|
/**
|
|
20944
|
-
* Create a chat completion using LangChain's
|
|
20944
|
+
* Create a chat completion using LangChain's Chat Completions model.
|
|
20945
20945
|
* Plain text only — for structured JSON output, use `askJson` instead.
|
|
20946
20946
|
*/
|
|
20947
20947
|
async createChatCompletion(options, configOverrides) {
|
|
@@ -21228,7 +21228,7 @@ var AiOperations = class {
|
|
|
21228
21228
|
/**
|
|
21229
21229
|
* Security (SSRF): lexically reject a user-supplied `baseURL` that targets a
|
|
21230
21230
|
* private / loopback / link-local / cloud-metadata host before it is handed
|
|
21231
|
-
* to LangChain's
|
|
21231
|
+
* to LangChain's ChatOpenAICompletions / OpenAIEmbeddings (whose internal fetch we
|
|
21232
21232
|
* cannot route through `safeFetchWithDnsPin`). Undefined `baseURL` means the
|
|
21233
21233
|
* provider's hosted default endpoint is used — that is always allowed.
|
|
21234
21234
|
* DNS-rebinding is only partially covered here (lexical-only); the raw
|
|
@@ -21250,7 +21250,7 @@ var AiOperations = class {
|
|
|
21250
21250
|
modelKwargs.response_format = options.responseFormat;
|
|
21251
21251
|
}
|
|
21252
21252
|
const temperature = skip?.has("temperature") ? void 0 : options?.temperature ?? config2.temperature;
|
|
21253
|
-
return new openai.
|
|
21253
|
+
return new openai.ChatOpenAICompletions({
|
|
21254
21254
|
apiKey: config2.apiKey,
|
|
21255
21255
|
model,
|
|
21256
21256
|
temperature,
|
|
@@ -21290,9 +21290,11 @@ var AiOperations = class {
|
|
|
21290
21290
|
};
|
|
21291
21291
|
}
|
|
21292
21292
|
/**
|
|
21293
|
-
* Bind tools to
|
|
21294
|
-
*
|
|
21295
|
-
*
|
|
21293
|
+
* Bind tools to the chat model when tool definitions are provided.
|
|
21294
|
+
*
|
|
21295
|
+
* The tools ride along as call options (`withConfig`), already in OpenAI's
|
|
21296
|
+
* `{ type: 'function', function }` shape, so the request carries them exactly
|
|
21297
|
+
* as written. LangChain 1.x removed `Runnable.bind()`, which did the same.
|
|
21296
21298
|
*/
|
|
21297
21299
|
bindTools(llm, options, skip) {
|
|
21298
21300
|
if (!options?.tools?.length || skip?.has("tools")) {
|
|
@@ -21306,11 +21308,11 @@ var AiOperations = class {
|
|
|
21306
21308
|
parameters: t.function.parameters ?? {}
|
|
21307
21309
|
}
|
|
21308
21310
|
}));
|
|
21309
|
-
const
|
|
21311
|
+
const callOptions = { tools };
|
|
21310
21312
|
if (options.toolChoice) {
|
|
21311
|
-
|
|
21313
|
+
callOptions.tool_choice = options.toolChoice;
|
|
21312
21314
|
}
|
|
21313
|
-
return llm.
|
|
21315
|
+
return llm.withConfig(callOptions);
|
|
21314
21316
|
}
|
|
21315
21317
|
parseRejectedParam(error62) {
|
|
21316
21318
|
if (!(error62 instanceof Error)) return void 0;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAIEmbeddings,
|
|
1
|
+
import { OpenAIEmbeddings, ChatOpenAICompletions } from '@langchain/openai';
|
|
2
2
|
import { HumanMessage, ToolMessage, AIMessage, SystemMessage } from '@langchain/core/messages';
|
|
3
3
|
import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
|
|
4
4
|
import { isIP } from 'net';
|
|
@@ -20750,7 +20750,7 @@ function normalizeObjects(node2, strict) {
|
|
|
20750
20750
|
}
|
|
20751
20751
|
}
|
|
20752
20752
|
function toStructuredOutputJsonSchema(schema, strict) {
|
|
20753
|
-
const jsonSchema = external_exports.toJSONSchema(schema, {
|
|
20753
|
+
const { ...jsonSchema } = external_exports.toJSONSchema(schema, {
|
|
20754
20754
|
target: "draft-07",
|
|
20755
20755
|
io: "input",
|
|
20756
20756
|
unrepresentable: "any"
|
|
@@ -20917,7 +20917,7 @@ var AiOperations = class {
|
|
|
20917
20917
|
this.rejectedParams = /* @__PURE__ */ new Map();
|
|
20918
20918
|
}
|
|
20919
20919
|
/**
|
|
20920
|
-
* Create a chat completion using LangChain's
|
|
20920
|
+
* Create a chat completion using LangChain's Chat Completions model.
|
|
20921
20921
|
* Plain text only — for structured JSON output, use `askJson` instead.
|
|
20922
20922
|
*/
|
|
20923
20923
|
async createChatCompletion(options, configOverrides) {
|
|
@@ -21204,7 +21204,7 @@ var AiOperations = class {
|
|
|
21204
21204
|
/**
|
|
21205
21205
|
* Security (SSRF): lexically reject a user-supplied `baseURL` that targets a
|
|
21206
21206
|
* private / loopback / link-local / cloud-metadata host before it is handed
|
|
21207
|
-
* to LangChain's
|
|
21207
|
+
* to LangChain's ChatOpenAICompletions / OpenAIEmbeddings (whose internal fetch we
|
|
21208
21208
|
* cannot route through `safeFetchWithDnsPin`). Undefined `baseURL` means the
|
|
21209
21209
|
* provider's hosted default endpoint is used — that is always allowed.
|
|
21210
21210
|
* DNS-rebinding is only partially covered here (lexical-only); the raw
|
|
@@ -21226,7 +21226,7 @@ var AiOperations = class {
|
|
|
21226
21226
|
modelKwargs.response_format = options.responseFormat;
|
|
21227
21227
|
}
|
|
21228
21228
|
const temperature = skip?.has("temperature") ? void 0 : options?.temperature ?? config2.temperature;
|
|
21229
|
-
return new
|
|
21229
|
+
return new ChatOpenAICompletions({
|
|
21230
21230
|
apiKey: config2.apiKey,
|
|
21231
21231
|
model,
|
|
21232
21232
|
temperature,
|
|
@@ -21266,9 +21266,11 @@ var AiOperations = class {
|
|
|
21266
21266
|
};
|
|
21267
21267
|
}
|
|
21268
21268
|
/**
|
|
21269
|
-
* Bind tools to
|
|
21270
|
-
*
|
|
21271
|
-
*
|
|
21269
|
+
* Bind tools to the chat model when tool definitions are provided.
|
|
21270
|
+
*
|
|
21271
|
+
* The tools ride along as call options (`withConfig`), already in OpenAI's
|
|
21272
|
+
* `{ type: 'function', function }` shape, so the request carries them exactly
|
|
21273
|
+
* as written. LangChain 1.x removed `Runnable.bind()`, which did the same.
|
|
21272
21274
|
*/
|
|
21273
21275
|
bindTools(llm, options, skip) {
|
|
21274
21276
|
if (!options?.tools?.length || skip?.has("tools")) {
|
|
@@ -21282,11 +21284,11 @@ var AiOperations = class {
|
|
|
21282
21284
|
parameters: t.function.parameters ?? {}
|
|
21283
21285
|
}
|
|
21284
21286
|
}));
|
|
21285
|
-
const
|
|
21287
|
+
const callOptions = { tools };
|
|
21286
21288
|
if (options.toolChoice) {
|
|
21287
|
-
|
|
21289
|
+
callOptions.tool_choice = options.toolChoice;
|
|
21288
21290
|
}
|
|
21289
|
-
return llm.
|
|
21291
|
+
return llm.withConfig(callOptions);
|
|
21290
21292
|
}
|
|
21291
21293
|
parseRejectedParam(error62) {
|
|
21292
21294
|
if (!(error62 instanceof Error)) return void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ever-works/mistral-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Mistral AI provider plugin for Ever Works platform",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ever Co. LTD",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"test:watch": "vitest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ever-works/plugin": "^1.2.
|
|
36
|
-
"@langchain/openai": "^
|
|
37
|
-
"@langchain/core": "^
|
|
35
|
+
"@ever-works/plugin": "^1.2.13",
|
|
36
|
+
"@langchain/openai": "^1.7.1",
|
|
37
|
+
"@langchain/core": "^1.3.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^26.6.4",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"url": "https://github.com/ever-works/ever-works/issues"
|
|
72
72
|
},
|
|
73
73
|
"everworksRelease": {
|
|
74
|
-
"contentHash": "sha256:
|
|
75
|
-
"commit": "
|
|
76
|
-
"source": "https://github.com/ever-works/ever-works/tree/
|
|
74
|
+
"contentHash": "sha256:d4d7873cf982a9d98a6f22fb66f4c8d9765781ed3215e0ff7a8f9f7a3157d17c",
|
|
75
|
+
"commit": "24837e5bb875bf996052fb319844b6c1d55b7041",
|
|
76
|
+
"source": "https://github.com/ever-works/ever-works/tree/24837e5bb875bf996052fb319844b6c1d55b7041/packages/plugins/mistral"
|
|
77
77
|
}
|
|
78
78
|
}
|