@copilotkit/runtime 1.3.11 → 1.3.12-fix-tool-call-dynamic-parameters.0
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/CHANGELOG.md +9 -0
- package/dist/{chunk-7MQDBRXJ.mjs → chunk-24WEOOFX.mjs} +2 -2
- package/dist/{chunk-AP2CCJ3J.mjs → chunk-AOYYOKTP.mjs} +13 -6
- package/dist/chunk-AOYYOKTP.mjs.map +1 -0
- package/dist/{chunk-REA4Z4VP.mjs → chunk-HKLL7TTP.mjs} +2 -2
- package/dist/{chunk-ZUQH5YKI.mjs → chunk-OSJXQNII.mjs} +3 -3
- package/dist/{chunk-ZSMR26MX.mjs → chunk-SIMJ6TZU.mjs} +2 -2
- package/dist/{chunk-BYL3ABWM.mjs → chunk-UYORVPCQ.mjs} +2 -2
- package/dist/{chunk-V7SK6QZN.mjs → chunk-ZEHCLFJ2.mjs} +9 -6
- package/dist/chunk-ZEHCLFJ2.mjs.map +1 -0
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/lib/index.js +19 -9
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -7
- package/dist/lib/integrations/index.js +4 -3
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.js +4 -3
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +3 -3
- package/dist/lib/integrations/node-express/index.js +4 -3
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +3 -3
- package/dist/lib/integrations/node-http/index.js +4 -3
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +2 -2
- package/dist/service-adapters/index.js +8 -5
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +2 -2
- package/package.json +6 -5
- package/src/service-adapters/events.ts +5 -1
- package/src/service-adapters/langchain/utils.test.ts +169 -0
- package/src/service-adapters/langchain/utils.ts +10 -5
- package/dist/chunk-AP2CCJ3J.mjs.map +0 -1
- package/dist/chunk-V7SK6QZN.mjs.map +0 -1
- /package/dist/{chunk-7MQDBRXJ.mjs.map → chunk-24WEOOFX.mjs.map} +0 -0
- /package/dist/{chunk-REA4Z4VP.mjs.map → chunk-HKLL7TTP.mjs.map} +0 -0
- /package/dist/{chunk-ZUQH5YKI.mjs.map → chunk-OSJXQNII.mjs.map} +0 -0
- /package/dist/{chunk-ZSMR26MX.mjs.map → chunk-SIMJ6TZU.mjs.map} +0 -0
- /package/dist/{chunk-BYL3ABWM.mjs.map → chunk-UYORVPCQ.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotRuntime,
|
|
3
3
|
flattenToolCallsNoDuplicates
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OSJXQNII.mjs";
|
|
5
5
|
import {
|
|
6
6
|
AnthropicAdapter,
|
|
7
7
|
GoogleGenerativeAIAdapter,
|
|
@@ -11,25 +11,25 @@ import {
|
|
|
11
11
|
OpenAIAssistantAdapter,
|
|
12
12
|
RemoteChain,
|
|
13
13
|
UnifyAdapter
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-24WEOOFX.mjs";
|
|
15
15
|
import {
|
|
16
16
|
config,
|
|
17
17
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
18
18
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-UYORVPCQ.mjs";
|
|
20
20
|
import {
|
|
21
21
|
copilotRuntimeNestEndpoint
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SIMJ6TZU.mjs";
|
|
23
23
|
import {
|
|
24
24
|
copilotRuntimeNodeExpressEndpoint
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HKLL7TTP.mjs";
|
|
26
26
|
import {
|
|
27
27
|
buildSchema,
|
|
28
28
|
copilotRuntimeNodeHttpEndpoint,
|
|
29
29
|
createContext,
|
|
30
30
|
getCommonConfig
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-AOYYOKTP.mjs";
|
|
32
|
+
import "./chunk-ZEHCLFJ2.mjs";
|
|
33
33
|
import {
|
|
34
34
|
GuardrailsValidationFailureResponse,
|
|
35
35
|
MessageStreamInterruptedResponse,
|
package/dist/lib/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.3.
|
|
47
|
+
version: "1.3.12-fix-tool-call-dynamic-parameters.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -77,15 +77,16 @@ var require_package = __commonJS({
|
|
|
77
77
|
"ts-node": "^10.9.2",
|
|
78
78
|
tsconfig: "workspace:*",
|
|
79
79
|
tsup: "^6.7.0",
|
|
80
|
-
typescript: "^5.2.3"
|
|
80
|
+
typescript: "^5.2.3",
|
|
81
|
+
"zod-to-json-schema": "^3.23.5"
|
|
81
82
|
},
|
|
82
83
|
dependencies: {
|
|
83
84
|
"@anthropic-ai/sdk": "^0.27.3",
|
|
84
85
|
"@copilotkit/shared": "workspace:*",
|
|
85
|
-
"@langchain/google-gauth": "^0.1.0",
|
|
86
86
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
87
87
|
"@langchain/community": "^0.0.53",
|
|
88
88
|
"@langchain/core": "^0.3.13",
|
|
89
|
+
"@langchain/google-gauth": "^0.1.0",
|
|
89
90
|
"@langchain/openai": "^0.0.28",
|
|
90
91
|
"class-transformer": "^0.5.1",
|
|
91
92
|
express: "^4.19.2",
|
|
@@ -493,24 +494,27 @@ __name(convertMessageToLangChainMessage, "convertMessageToLangChainMessage");
|
|
|
493
494
|
function convertJsonSchemaToZodSchema(jsonSchema, required) {
|
|
494
495
|
if (jsonSchema.type === "object") {
|
|
495
496
|
const spec = {};
|
|
497
|
+
if (!jsonSchema.properties || !Object.keys(jsonSchema.properties).length) {
|
|
498
|
+
return !required ? import_zod.z.object(spec).optional() : import_zod.z.object(spec);
|
|
499
|
+
}
|
|
496
500
|
for (const [key, value] of Object.entries(jsonSchema.properties)) {
|
|
497
501
|
spec[key] = convertJsonSchemaToZodSchema(value, jsonSchema.required ? jsonSchema.required.includes(key) : false);
|
|
498
502
|
}
|
|
499
503
|
let schema = import_zod.z.object(spec);
|
|
500
|
-
return
|
|
504
|
+
return required ? schema : schema.optional();
|
|
501
505
|
} else if (jsonSchema.type === "string") {
|
|
502
506
|
let schema = import_zod.z.string().describe(jsonSchema.description);
|
|
503
|
-
return
|
|
507
|
+
return required ? schema : schema.optional();
|
|
504
508
|
} else if (jsonSchema.type === "number") {
|
|
505
509
|
let schema = import_zod.z.number().describe(jsonSchema.description);
|
|
506
|
-
return
|
|
510
|
+
return required ? schema : schema.optional();
|
|
507
511
|
} else if (jsonSchema.type === "boolean") {
|
|
508
512
|
let schema = import_zod.z.boolean().describe(jsonSchema.description);
|
|
509
|
-
return
|
|
513
|
+
return required ? schema : schema.optional();
|
|
510
514
|
} else if (jsonSchema.type === "array") {
|
|
511
515
|
let itemSchema = convertJsonSchemaToZodSchema(jsonSchema.items, true);
|
|
512
516
|
let schema = import_zod.z.array(itemSchema);
|
|
513
|
-
return
|
|
517
|
+
return required ? schema : schema.optional();
|
|
514
518
|
}
|
|
515
519
|
}
|
|
516
520
|
__name(convertJsonSchemaToZodSchema, "convertJsonSchemaToZodSchema");
|
|
@@ -1658,7 +1662,13 @@ async function executeAction(eventStream$, guardrailsResult$, action, actionArgu
|
|
|
1658
1662
|
}
|
|
1659
1663
|
let args = [];
|
|
1660
1664
|
if (actionArguments) {
|
|
1661
|
-
|
|
1665
|
+
try {
|
|
1666
|
+
args = JSON.parse(actionArguments);
|
|
1667
|
+
} catch (e) {
|
|
1668
|
+
console.warn("Action argument unparsable", {
|
|
1669
|
+
actionArguments
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1662
1672
|
}
|
|
1663
1673
|
if (isLangGraphAgentAction(action)) {
|
|
1664
1674
|
eventStream$.sendActionExecutionResult(actionExecutionId, action.name, `${action.name} agent started`);
|