@copilotkit/runtime 1.9.2-next.12 → 1.9.2-next.13
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 +7 -0
- package/dist/{chunk-5242BPKE.mjs → chunk-6V6X7HZO.mjs} +2 -2
- package/dist/{chunk-67FD4ROM.mjs → chunk-CSXEYW65.mjs} +19 -19
- package/dist/chunk-CSXEYW65.mjs.map +1 -0
- package/dist/{chunk-GS7DO47Q.mjs → chunk-JTFQ5GIL.mjs} +1 -25
- package/dist/chunk-JTFQ5GIL.mjs.map +1 -0
- package/dist/{chunk-QYYJ4HZT.mjs → chunk-LNXBP675.mjs} +2 -2
- package/dist/{chunk-XRRSRDZR.mjs → chunk-NV2UY5BF.mjs} +2 -2
- package/dist/{chunk-26EZI2OL.mjs → chunk-WY337BWR.mjs} +2 -2
- package/dist/index.js +17 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/lib/index.js +17 -41
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +6 -6
- 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 +0 -24
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -1
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +17 -15
- package/src/service-adapters/openai/openai-adapter.ts +0 -14
- package/dist/chunk-67FD4ROM.mjs.map +0 -1
- package/dist/chunk-GS7DO47Q.mjs.map +0 -1
- /package/dist/{chunk-5242BPKE.mjs.map → chunk-6V6X7HZO.mjs.map} +0 -0
- /package/dist/{chunk-QYYJ4HZT.mjs.map → chunk-LNXBP675.mjs.map} +0 -0
- /package/dist/{chunk-XRRSRDZR.mjs.map → chunk-NV2UY5BF.mjs.map} +0 -0
- /package/dist/{chunk-26EZI2OL.mjs.map → chunk-WY337BWR.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CustomEventNames,
|
|
3
3
|
LangGraphAgent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WY337BWR.mjs";
|
|
5
5
|
import {
|
|
6
6
|
config,
|
|
7
7
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
8
8
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NV2UY5BF.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNestEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LNXBP675.mjs";
|
|
13
13
|
import {
|
|
14
14
|
copilotRuntimeNodeExpressEndpoint
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6V6X7HZO.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotRuntime,
|
|
18
18
|
addCustomHeaderPlugin,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getCommonConfig,
|
|
29
29
|
langGraphPlatformEndpoint,
|
|
30
30
|
resolveEndpointType
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CSXEYW65.mjs";
|
|
32
32
|
import "./chunk-SHBDMA63.mjs";
|
|
33
33
|
import {
|
|
34
34
|
AnthropicAdapter,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
OpenAIAssistantAdapter,
|
|
44
44
|
RemoteChain,
|
|
45
45
|
UnifyAdapter
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-JTFQ5GIL.mjs";
|
|
47
47
|
import {
|
|
48
48
|
GuardrailsValidationFailureResponse,
|
|
49
49
|
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.9.2-next.
|
|
47
|
+
version: "1.9.2-next.13",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -420,7 +420,6 @@ var OpenAIAdapter = class {
|
|
|
420
420
|
const { threadId: threadIdFromRequest, model = this.model, messages, actions, eventSource, forwardedParameters } = request;
|
|
421
421
|
const tools = actions.map(convertActionInputToOpenAITool);
|
|
422
422
|
const threadId = threadIdFromRequest ?? (0, import_shared3.randomUUID)();
|
|
423
|
-
console.log("messages", messages);
|
|
424
423
|
const validToolUseIds = /* @__PURE__ */ new Set();
|
|
425
424
|
for (const message of messages) {
|
|
426
425
|
if (message.isActionExecutionMessage()) {
|
|
@@ -450,29 +449,6 @@ var OpenAIAdapter = class {
|
|
|
450
449
|
}
|
|
451
450
|
};
|
|
452
451
|
}
|
|
453
|
-
console.log("INPUT", {
|
|
454
|
-
model,
|
|
455
|
-
stream: true,
|
|
456
|
-
messages: openaiMessages,
|
|
457
|
-
...tools.length > 0 && {
|
|
458
|
-
tools
|
|
459
|
-
},
|
|
460
|
-
...(forwardedParameters == null ? void 0 : forwardedParameters.maxTokens) && {
|
|
461
|
-
max_tokens: forwardedParameters.maxTokens
|
|
462
|
-
},
|
|
463
|
-
...(forwardedParameters == null ? void 0 : forwardedParameters.stop) && {
|
|
464
|
-
stop: forwardedParameters.stop
|
|
465
|
-
},
|
|
466
|
-
...toolChoice && {
|
|
467
|
-
tool_choice: toolChoice
|
|
468
|
-
},
|
|
469
|
-
...this.disableParallelToolCalls && {
|
|
470
|
-
parallel_tool_calls: false
|
|
471
|
-
},
|
|
472
|
-
...(forwardedParameters == null ? void 0 : forwardedParameters.temperature) && {
|
|
473
|
-
temperature: forwardedParameters.temperature
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
452
|
try {
|
|
477
453
|
const stream = this.openai.beta.chat.completions.stream({
|
|
478
454
|
model,
|
|
@@ -4771,25 +4747,25 @@ please use an LLM adapter instead.`
|
|
|
4771
4747
|
const propertyHeaders = graphqlContext.properties.authorization ? {
|
|
4772
4748
|
authorization: `Bearer ${graphqlContext.properties.authorization}`
|
|
4773
4749
|
} : null;
|
|
4774
|
-
|
|
4775
|
-
if (
|
|
4776
|
-
|
|
4777
|
-
apiUrl: agent.endpoint.deploymentUrl,
|
|
4778
|
-
apiKey: agent.endpoint.langsmithApiKey,
|
|
4779
|
-
defaultHeaders: {
|
|
4780
|
-
...propertyHeaders
|
|
4781
|
-
}
|
|
4782
|
-
});
|
|
4783
|
-
} else {
|
|
4784
|
-
const aguiAgent = graphqlContext._copilotkit.runtime.agents[agent.name];
|
|
4785
|
-
if (!aguiAgent) {
|
|
4786
|
-
throw new Error(`Agent: ${agent.name} could not be resolved`);
|
|
4787
|
-
}
|
|
4788
|
-
client = aguiAgent.client;
|
|
4750
|
+
const aguiAgent = graphqlContext._copilotkit.runtime.agents[agent.name];
|
|
4751
|
+
if (!aguiAgent) {
|
|
4752
|
+
throw new Error(`Agent: ${agent.name} could not be resolved`);
|
|
4789
4753
|
}
|
|
4790
4754
|
let state = {};
|
|
4791
4755
|
try {
|
|
4792
|
-
|
|
4756
|
+
let client;
|
|
4757
|
+
if ("endpoint" in agent && agent.endpoint.type === EndpointType.LangGraphPlatform) {
|
|
4758
|
+
client = new import_langgraph_sdk2.Client({
|
|
4759
|
+
apiUrl: agent.endpoint.deploymentUrl,
|
|
4760
|
+
apiKey: agent.endpoint.langsmithApiKey,
|
|
4761
|
+
defaultHeaders: {
|
|
4762
|
+
...propertyHeaders
|
|
4763
|
+
}
|
|
4764
|
+
});
|
|
4765
|
+
} else {
|
|
4766
|
+
client = aguiAgent.client ?? null;
|
|
4767
|
+
}
|
|
4768
|
+
state = client ? (await client.threads.getState(threadId)).values : {};
|
|
4793
4769
|
} catch (error) {
|
|
4794
4770
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
4795
4771
|
console.debug(`Agent '${agentName}' configuration issue: ${errorMessage}`);
|