@copilotkit/runtime 1.5.20 → 1.6.0-next.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/__snapshots__/schema/schema.graphql +1 -0
- package/dist/{chunk-BLOO7P5D.mjs → chunk-A25FIW7J.mjs} +2 -2
- package/dist/{chunk-U4EZU7AQ.mjs → chunk-C7GTLEVO.mjs} +2 -2
- package/dist/{chunk-HEILVP57.mjs → chunk-CCQ73DAH.mjs} +2 -2
- package/dist/{chunk-YAEZPJTK.mjs → chunk-CHDIEE43.mjs} +27 -9
- package/dist/chunk-CHDIEE43.mjs.map +1 -0
- package/dist/{copilot-runtime-084fb9c7.d.ts → copilot-runtime-67033bfa.d.ts} +1 -1
- package/dist/{groq-adapter-3b894689.d.ts → groq-adapter-9d15c927.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{langserve-3a591089.d.ts → langserve-7cc5be48.d.ts} +1 -0
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +26 -8
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +8 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +8 -1
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +8 -1
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +8 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/service-adapters/index.d.ts +3 -3
- package/package.json +2 -2
- package/src/graphql/inputs/agent-state.input.ts +3 -0
- package/src/lib/runtime/remote-action-constructors.ts +10 -4
- package/src/lib/runtime/remote-lg-action.ts +5 -0
- package/dist/chunk-YAEZPJTK.mjs.map +0 -1
- /package/dist/{chunk-BLOO7P5D.mjs.map → chunk-A25FIW7J.mjs.map} +0 -0
- /package/dist/{chunk-U4EZU7AQ.mjs.map → chunk-C7GTLEVO.mjs.map} +0 -0
- /package/dist/{chunk-HEILVP57.mjs.map → chunk-CCQ73DAH.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @copilotkit/runtime
|
|
2
2
|
|
|
3
|
+
## 1.6.0-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @copilotkit/shared@1.6.0-next.1
|
|
8
|
+
|
|
9
|
+
## 1.6.0-next.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 7d061d9: - feat(configurable): execute langgraph with user config
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- @copilotkit/shared@1.6.0-next.0
|
|
18
|
+
|
|
3
19
|
## 1.5.20
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CHDIEE43.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-A25FIW7J.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CHDIEE43.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNestEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-C7GTLEVO.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CHDIEE43.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
config,
|
|
78
78
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-CCQ73DAH.mjs.map
|
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
publishConfig: {
|
|
40
40
|
access: "public"
|
|
41
41
|
},
|
|
42
|
-
version: "1.
|
|
42
|
+
version: "1.6.0-next.1",
|
|
43
43
|
sideEffects: false,
|
|
44
44
|
main: "./dist/index.js",
|
|
45
45
|
module: "./dist/index.mjs",
|
|
@@ -667,6 +667,7 @@ __name(_ts_metadata8, "_ts_metadata");
|
|
|
667
667
|
var AgentStateInput = class {
|
|
668
668
|
agentName;
|
|
669
669
|
state;
|
|
670
|
+
configurable;
|
|
670
671
|
};
|
|
671
672
|
__name(AgentStateInput, "AgentStateInput");
|
|
672
673
|
_ts_decorate8([
|
|
@@ -677,6 +678,12 @@ _ts_decorate8([
|
|
|
677
678
|
Field8(() => String),
|
|
678
679
|
_ts_metadata8("design:type", String)
|
|
679
680
|
], AgentStateInput.prototype, "state", void 0);
|
|
681
|
+
_ts_decorate8([
|
|
682
|
+
Field8(() => String, {
|
|
683
|
+
nullable: true
|
|
684
|
+
}),
|
|
685
|
+
_ts_metadata8("design:type", String)
|
|
686
|
+
], AgentStateInput.prototype, "configurable", void 0);
|
|
680
687
|
AgentStateInput = _ts_decorate8([
|
|
681
688
|
InputType8()
|
|
682
689
|
], AgentStateInput);
|
|
@@ -1685,7 +1692,7 @@ async function execute(args) {
|
|
|
1685
1692
|
__name(execute, "execute");
|
|
1686
1693
|
async function streamEvents(controller, args) {
|
|
1687
1694
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1688
|
-
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
1695
|
+
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, configurable, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
1689
1696
|
let nodeName = initialNodeName;
|
|
1690
1697
|
let state = initialState;
|
|
1691
1698
|
const { name, assistantId: initialAssistantId } = agent;
|
|
@@ -1785,6 +1792,13 @@ async function streamEvents(controller, args) {
|
|
|
1785
1792
|
throw new Error("No agent id found");
|
|
1786
1793
|
}
|
|
1787
1794
|
const assistantId = retrievedAssistant.assistant_id;
|
|
1795
|
+
if (configurable) {
|
|
1796
|
+
await client.assistants.update(assistantId, {
|
|
1797
|
+
config: {
|
|
1798
|
+
configurable
|
|
1799
|
+
}
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1788
1802
|
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
1789
1803
|
let streamingStateExtractor = new StreamingStateExtractor([]);
|
|
1790
1804
|
let prevNodeName = null;
|
|
@@ -2200,7 +2214,6 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
2200
2214
|
handler: async (_args) => {
|
|
2201
2215
|
},
|
|
2202
2216
|
langGraphAgentHandler: async ({ name, actionInputsWithoutAgents, threadId, nodeName, additionalMessages = [], metaEvents }) => {
|
|
2203
|
-
var _a;
|
|
2204
2217
|
logger2.debug({
|
|
2205
2218
|
actionName: agent.name
|
|
2206
2219
|
}, "Executing LangGraph Platform agent");
|
|
@@ -2211,10 +2224,12 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
2211
2224
|
hashedLgcKey: createHash2("sha256").update(endpoint.langsmithApiKey).digest("hex")
|
|
2212
2225
|
});
|
|
2213
2226
|
let state = {};
|
|
2227
|
+
let configurable = {};
|
|
2214
2228
|
if (agentStates) {
|
|
2215
|
-
const jsonState =
|
|
2229
|
+
const jsonState = agentStates.find((state2) => state2.agentName === name);
|
|
2216
2230
|
if (jsonState) {
|
|
2217
|
-
state = JSON.parse(jsonState);
|
|
2231
|
+
state = JSON.parse(jsonState.state);
|
|
2232
|
+
configurable = JSON.parse(jsonState.configurable);
|
|
2218
2233
|
}
|
|
2219
2234
|
}
|
|
2220
2235
|
try {
|
|
@@ -2232,6 +2247,7 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
2232
2247
|
...additionalMessages
|
|
2233
2248
|
],
|
|
2234
2249
|
state,
|
|
2250
|
+
configurable,
|
|
2235
2251
|
properties: graphqlContext.properties,
|
|
2236
2252
|
actions: actionInputsWithoutAgents.map((action) => ({
|
|
2237
2253
|
name: action.name,
|
|
@@ -2328,7 +2344,6 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2328
2344
|
handler: async (_args) => {
|
|
2329
2345
|
},
|
|
2330
2346
|
langGraphAgentHandler: async ({ name, actionInputsWithoutAgents, threadId, nodeName, additionalMessages = [], metaEvents }) => {
|
|
2331
|
-
var _a;
|
|
2332
2347
|
logger2.debug({
|
|
2333
2348
|
actionName: agent.name
|
|
2334
2349
|
}, "Executing remote agent");
|
|
@@ -2339,10 +2354,12 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2339
2354
|
agentsAmount: json["agents"].length
|
|
2340
2355
|
});
|
|
2341
2356
|
let state = {};
|
|
2357
|
+
let configurable = {};
|
|
2342
2358
|
if (agentStates) {
|
|
2343
|
-
const jsonState =
|
|
2359
|
+
const jsonState = agentStates.find((state2) => state2.agentName === name);
|
|
2344
2360
|
if (jsonState) {
|
|
2345
|
-
state = JSON.parse(jsonState);
|
|
2361
|
+
state = JSON.parse(jsonState.state);
|
|
2362
|
+
configurable = JSON.parse(jsonState.configurable);
|
|
2346
2363
|
}
|
|
2347
2364
|
}
|
|
2348
2365
|
const fetchUrl = `${url}/agents/execute`;
|
|
@@ -2359,6 +2376,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2359
2376
|
...additionalMessages
|
|
2360
2377
|
],
|
|
2361
2378
|
state,
|
|
2379
|
+
configurable,
|
|
2362
2380
|
properties: graphqlContext.properties,
|
|
2363
2381
|
actions: actionInputsWithoutAgents.map((action) => ({
|
|
2364
2382
|
name: action.name,
|
|
@@ -4244,4 +4262,4 @@ export {
|
|
|
4244
4262
|
getCommonConfig,
|
|
4245
4263
|
copilotRuntimeNodeHttpEndpoint
|
|
4246
4264
|
};
|
|
4247
|
-
//# sourceMappingURL=chunk-
|
|
4265
|
+
//# sourceMappingURL=chunk-CHDIEE43.mjs.map
|