koishi-plugin-chatluna-google-gemini-adapter 1.2.25 → 1.3.0-alpha.2
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/lib/index.cjs +3 -3
- package/lib/index.mjs +3 -3
- package/package.json +8 -8
package/lib/index.cjs
CHANGED
|
@@ -66,6 +66,7 @@ var import_stream = require("koishi-plugin-chatluna/utils/stream");
|
|
|
66
66
|
var import_zod_to_json_schema = require("zod-to-json-schema");
|
|
67
67
|
var import_v1_shared_adapter = require("@chatluna/v1-shared-adapter");
|
|
68
68
|
var import_string = require("koishi-plugin-chatluna/utils/string");
|
|
69
|
+
var import_zod = require("zod");
|
|
69
70
|
async function langchainMessageToGeminiMessage(messages, plugin, model) {
|
|
70
71
|
return Promise.all(
|
|
71
72
|
messages.map(async (message) => {
|
|
@@ -293,10 +294,9 @@ function formatToolsToGeminiAITools(tools, config, model) {
|
|
|
293
294
|
__name(formatToolsToGeminiAITools, "formatToolsToGeminiAITools");
|
|
294
295
|
function formatToolToGeminiAITool(tool) {
|
|
295
296
|
const parameters = (0, import_v1_shared_adapter.removeAdditionalProperties)(
|
|
296
|
-
|
|
297
|
-
(0, import_zod_to_json_schema.zodToJsonSchema)(tool.schema, {
|
|
297
|
+
tool.schema instanceof import_zod.ZodSchema ? (0, import_zod_to_json_schema.zodToJsonSchema)(tool.schema, {
|
|
298
298
|
allowedAdditionalProperties: void 0
|
|
299
|
-
})
|
|
299
|
+
}) : tool.schema
|
|
300
300
|
);
|
|
301
301
|
return {
|
|
302
302
|
name: tool.name,
|
package/lib/index.mjs
CHANGED
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
isMessageContentImageUrl,
|
|
64
64
|
isMessageContentText
|
|
65
65
|
} from "koishi-plugin-chatluna/utils/string";
|
|
66
|
+
import { ZodSchema } from "zod";
|
|
66
67
|
async function langchainMessageToGeminiMessage(messages, plugin, model) {
|
|
67
68
|
return Promise.all(
|
|
68
69
|
messages.map(async (message) => {
|
|
@@ -290,10 +291,9 @@ function formatToolsToGeminiAITools(tools, config, model) {
|
|
|
290
291
|
__name(formatToolsToGeminiAITools, "formatToolsToGeminiAITools");
|
|
291
292
|
function formatToolToGeminiAITool(tool) {
|
|
292
293
|
const parameters = removeAdditionalProperties(
|
|
293
|
-
|
|
294
|
-
zodToJsonSchema(tool.schema, {
|
|
294
|
+
tool.schema instanceof ZodSchema ? zodToJsonSchema(tool.schema, {
|
|
295
295
|
allowedAdditionalProperties: void 0
|
|
296
|
-
})
|
|
296
|
+
}) : tool.schema
|
|
297
297
|
);
|
|
298
298
|
return {
|
|
299
299
|
name: tool.name,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-chatluna-google-gemini-adapter",
|
|
3
3
|
"description": "google-gemini adapter for chatluna",
|
|
4
|
-
"version": "1.2
|
|
4
|
+
"version": "1.3.0-alpha.2",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.mjs",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"build": "atsc -b"
|
|
34
34
|
},
|
|
35
35
|
"resolutions": {
|
|
36
|
-
"@langchain/core": "0.3.
|
|
36
|
+
"@langchain/core": "0.3.62",
|
|
37
37
|
"js-tiktoken": "npm:@dingyi222666/js-tiktoken@^1.0.19"
|
|
38
38
|
},
|
|
39
39
|
"overrides": {
|
|
40
|
-
"@langchain/core": "0.3.
|
|
40
|
+
"@langchain/core": "0.3.62",
|
|
41
41
|
"js-tiktoken": "npm:@dingyi222666/js-tiktoken@^1.0.19"
|
|
42
42
|
},
|
|
43
43
|
"pnpm": {
|
|
44
44
|
"overrides": {
|
|
45
|
-
"@langchain/core": "0.3.
|
|
45
|
+
"@langchain/core": "0.3.62",
|
|
46
46
|
"js-tiktoken": "npm:@dingyi222666/js-tiktoken@^1.0.19"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"adapter"
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@chatluna/v1-shared-adapter": "^1.0.
|
|
66
|
-
"@langchain/core": "
|
|
67
|
-
"zod": "
|
|
65
|
+
"@chatluna/v1-shared-adapter": "^1.0.7",
|
|
66
|
+
"@langchain/core": "0.3.62",
|
|
67
|
+
"zod": "3.25.76",
|
|
68
68
|
"zod-to-json-schema": "^3.24.5"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"koishi": "^4.18.7",
|
|
76
|
-
"koishi-plugin-chatluna": "^1.3.0-alpha.
|
|
76
|
+
"koishi-plugin-chatluna": "^1.3.0-alpha.28",
|
|
77
77
|
"koishi-plugin-chatluna-storage-service": "^0.0.8"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|