@copilotkit/runtime 1.4.0 → 1.4.1-pre.1
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 +16 -0
- package/dist/{chunk-RI2I744Y.mjs → chunk-G5X7YZNG.mjs} +2 -2
- package/dist/{chunk-OUQMGVUK.mjs → chunk-IJAXWREA.mjs} +3 -3
- package/dist/chunk-IJAXWREA.mjs.map +1 -0
- package/dist/{chunk-ZOC3UIQP.mjs → chunk-OKQVDDJ2.mjs} +2 -30
- package/dist/chunk-OKQVDDJ2.mjs.map +1 -0
- package/dist/{chunk-6B4PG66A.mjs → chunk-U3SBKRZR.mjs} +2 -2
- package/dist/{chunk-RKI5NCKX.mjs → chunk-YLEXEC6R.mjs} +2 -2
- package/dist/index.js +2 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/lib/index.js +2 -30
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -29
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -1
- package/package.json +4 -4
- package/src/service-adapters/langchain/utils.ts +1 -33
- package/dist/chunk-OUQMGVUK.mjs.map +0 -1
- package/dist/chunk-ZOC3UIQP.mjs.map +0 -1
- package/src/service-adapters/langchain/utils.test.ts +0 -169
- /package/dist/{chunk-RI2I744Y.mjs.map → chunk-G5X7YZNG.mjs.map} +0 -0
- /package/dist/{chunk-6B4PG66A.mjs.map → chunk-U3SBKRZR.mjs.map} +0 -0
- /package/dist/{chunk-RKI5NCKX.mjs.map → chunk-YLEXEC6R.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G5X7YZNG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-U3SBKRZR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YLEXEC6R.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
buildSchema,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getCommonConfig,
|
|
21
21
|
langGraphPlatformEndpoint,
|
|
22
22
|
resolveEndpointType
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IJAXWREA.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AnthropicAdapter,
|
|
26
26
|
GoogleGenerativeAIAdapter,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
OpenAIAssistantAdapter,
|
|
31
31
|
RemoteChain,
|
|
32
32
|
UnifyAdapter
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OKQVDDJ2.mjs";
|
|
34
34
|
import {
|
|
35
35
|
GuardrailsValidationFailureResponse,
|
|
36
36
|
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.4.
|
|
47
|
+
version: "1.4.1-pre.1",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -469,7 +469,6 @@ __name(OpenAIAdapter, "OpenAIAdapter");
|
|
|
469
469
|
// src/service-adapters/langchain/utils.ts
|
|
470
470
|
var import_messages = require("@langchain/core/messages");
|
|
471
471
|
var import_tools = require("@langchain/core/tools");
|
|
472
|
-
var import_zod = require("zod");
|
|
473
472
|
var import_shared2 = require("@copilotkit/shared");
|
|
474
473
|
function convertMessageToLangChainMessage(message) {
|
|
475
474
|
if (message.isTextMessage()) {
|
|
@@ -499,38 +498,11 @@ function convertMessageToLangChainMessage(message) {
|
|
|
499
498
|
}
|
|
500
499
|
}
|
|
501
500
|
__name(convertMessageToLangChainMessage, "convertMessageToLangChainMessage");
|
|
502
|
-
function convertJsonSchemaToZodSchema(jsonSchema, required) {
|
|
503
|
-
if (jsonSchema.type === "object") {
|
|
504
|
-
const spec = {};
|
|
505
|
-
if (!jsonSchema.properties || !Object.keys(jsonSchema.properties).length) {
|
|
506
|
-
return !required ? import_zod.z.object(spec).optional() : import_zod.z.object(spec);
|
|
507
|
-
}
|
|
508
|
-
for (const [key, value] of Object.entries(jsonSchema.properties)) {
|
|
509
|
-
spec[key] = convertJsonSchemaToZodSchema(value, jsonSchema.required ? jsonSchema.required.includes(key) : false);
|
|
510
|
-
}
|
|
511
|
-
let schema = import_zod.z.object(spec).describe(jsonSchema.description);
|
|
512
|
-
return required ? schema : schema.optional();
|
|
513
|
-
} else if (jsonSchema.type === "string") {
|
|
514
|
-
let schema = import_zod.z.string().describe(jsonSchema.description);
|
|
515
|
-
return required ? schema : schema.optional();
|
|
516
|
-
} else if (jsonSchema.type === "number") {
|
|
517
|
-
let schema = import_zod.z.number().describe(jsonSchema.description);
|
|
518
|
-
return required ? schema : schema.optional();
|
|
519
|
-
} else if (jsonSchema.type === "boolean") {
|
|
520
|
-
let schema = import_zod.z.boolean().describe(jsonSchema.description);
|
|
521
|
-
return required ? schema : schema.optional();
|
|
522
|
-
} else if (jsonSchema.type === "array") {
|
|
523
|
-
let itemSchema = convertJsonSchemaToZodSchema(jsonSchema.items, true);
|
|
524
|
-
let schema = import_zod.z.array(itemSchema).describe(jsonSchema.description);
|
|
525
|
-
return required ? schema : schema.optional();
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
__name(convertJsonSchemaToZodSchema, "convertJsonSchemaToZodSchema");
|
|
529
501
|
function convertActionInputToLangChainTool(actionInput) {
|
|
530
502
|
return new import_tools.DynamicStructuredTool({
|
|
531
503
|
name: actionInput.name,
|
|
532
504
|
description: actionInput.description,
|
|
533
|
-
schema: convertJsonSchemaToZodSchema(JSON.parse(actionInput.jsonSchema), true),
|
|
505
|
+
schema: (0, import_shared2.convertJsonSchemaToZodSchema)(JSON.parse(actionInput.jsonSchema), true),
|
|
534
506
|
func: async () => {
|
|
535
507
|
return "";
|
|
536
508
|
}
|