@copilotkit/runtime 1.8.11 → 1.8.12-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/dist/{chunk-LNG6GETF.mjs → chunk-4NX7XJUN.mjs} +2 -2
- package/dist/{chunk-VTW33IV3.mjs → chunk-4VQCEN2S.mjs} +2 -2
- package/dist/{chunk-C4YF3HSK.mjs → chunk-BFSBAHMC.mjs} +7 -7
- package/dist/chunk-BFSBAHMC.mjs.map +1 -0
- package/dist/{chunk-RTHOFK2V.mjs → chunk-DEXQNM4P.mjs} +2 -2
- package/dist/{chunk-EY6RUVB7.mjs → chunk-Y4H3U52G.mjs} +12 -4
- package/dist/chunk-Y4H3U52G.mjs.map +1 -0
- package/dist/{groq-adapter-4848f8e8.d.ts → groq-adapter-25a2bd35.d.ts} +16 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +11 -3
- 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.d.ts +1 -1
- package/dist/service-adapters/index.js +11 -3
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -1
- package/package.json +2 -2
- package/src/service-adapters/anthropic/anthropic-adapter.ts +1 -1
- package/src/service-adapters/openai/openai-adapter.ts +14 -1
- package/src/service-adapters/openai/openai-assistant-adapter.ts +11 -1
- package/dist/chunk-C4YF3HSK.mjs.map +0 -1
- package/dist/chunk-EY6RUVB7.mjs.map +0 -1
- /package/dist/{chunk-LNG6GETF.mjs.map → chunk-4NX7XJUN.mjs.map} +0 -0
- /package/dist/{chunk-VTW33IV3.mjs.map → chunk-4VQCEN2S.mjs.map} +0 -0
- /package/dist/{chunk-RTHOFK2V.mjs.map → chunk-DEXQNM4P.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-4VQCEN2S.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DEXQNM4P.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4NX7XJUN.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
addCustomHeaderPlugin,
|
|
@@ -25,7 +25,12 @@ import {
|
|
|
25
25
|
getCommonConfig,
|
|
26
26
|
langGraphPlatformEndpoint,
|
|
27
27
|
resolveEndpointType
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BFSBAHMC.mjs";
|
|
29
|
+
import {
|
|
30
|
+
GuardrailsValidationFailureResponse,
|
|
31
|
+
MessageStreamInterruptedResponse,
|
|
32
|
+
UnknownErrorResponse
|
|
33
|
+
} from "./chunk-5BIEM2UU.mjs";
|
|
29
34
|
import {
|
|
30
35
|
AnthropicAdapter,
|
|
31
36
|
EmptyAdapter,
|
|
@@ -38,12 +43,7 @@ import {
|
|
|
38
43
|
OpenAIAssistantAdapter,
|
|
39
44
|
RemoteChain,
|
|
40
45
|
UnifyAdapter
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
GuardrailsValidationFailureResponse,
|
|
44
|
-
MessageStreamInterruptedResponse,
|
|
45
|
-
UnknownErrorResponse
|
|
46
|
-
} from "./chunk-5BIEM2UU.mjs";
|
|
46
|
+
} from "./chunk-Y4H3U52G.mjs";
|
|
47
47
|
import "./chunk-SHBDMA63.mjs";
|
|
48
48
|
import "./chunk-2OZAGFV3.mjs";
|
|
49
49
|
import "./chunk-FHD4JECV.mjs";
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-
|
|
1
|
+
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-25a2bd35.js';
|
|
2
2
|
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-0c31d7c5.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
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.8.
|
|
47
|
+
version: "1.8.12-next.1",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -349,6 +349,7 @@ var OpenAIAdapter = class {
|
|
|
349
349
|
model = DEFAULT_MODEL;
|
|
350
350
|
disableParallelToolCalls = false;
|
|
351
351
|
_openai;
|
|
352
|
+
keepSystemRole = false;
|
|
352
353
|
get openai() {
|
|
353
354
|
return this._openai;
|
|
354
355
|
}
|
|
@@ -358,12 +359,15 @@ var OpenAIAdapter = class {
|
|
|
358
359
|
this.model = params.model;
|
|
359
360
|
}
|
|
360
361
|
this.disableParallelToolCalls = (params == null ? void 0 : params.disableParallelToolCalls) || false;
|
|
362
|
+
this.keepSystemRole = (params == null ? void 0 : params.keepSystemRole) ?? false;
|
|
361
363
|
}
|
|
362
364
|
async process(request) {
|
|
363
365
|
const { threadId: threadIdFromRequest, model = this.model, messages, actions, eventSource, forwardedParameters } = request;
|
|
364
366
|
const tools = actions.map(convertActionInputToOpenAITool);
|
|
365
367
|
const threadId = threadIdFromRequest ?? (0, import_shared2.randomUUID)();
|
|
366
|
-
let openaiMessages = messages.map((m) => convertMessageToOpenAIMessage(m
|
|
368
|
+
let openaiMessages = messages.map((m) => convertMessageToOpenAIMessage(m, {
|
|
369
|
+
keepSystemRole: this.keepSystemRole
|
|
370
|
+
}));
|
|
367
371
|
openaiMessages = limitMessagesToTokenCount(openaiMessages, tools, model);
|
|
368
372
|
let toolChoice = forwardedParameters == null ? void 0 : forwardedParameters.toolChoice;
|
|
369
373
|
if ((forwardedParameters == null ? void 0 : forwardedParameters.toolChoice) === "function") {
|
|
@@ -760,12 +764,14 @@ var OpenAIAssistantAdapter = class {
|
|
|
760
764
|
assistantId;
|
|
761
765
|
fileSearchEnabled;
|
|
762
766
|
disableParallelToolCalls;
|
|
767
|
+
keepSystemRole = false;
|
|
763
768
|
constructor(params) {
|
|
764
769
|
this.openai = params.openai || new import_openai2.default({});
|
|
765
770
|
this.codeInterpreterEnabled = params.codeInterpreterEnabled === false || true;
|
|
766
771
|
this.fileSearchEnabled = params.fileSearchEnabled === false || true;
|
|
767
772
|
this.assistantId = params.assistantId;
|
|
768
773
|
this.disableParallelToolCalls = (params == null ? void 0 : params.disableParallelToolCalls) || false;
|
|
774
|
+
this.keepSystemRole = (params == null ? void 0 : params.keepSystemRole) ?? false;
|
|
769
775
|
}
|
|
770
776
|
async process(request) {
|
|
771
777
|
var _a, _b;
|
|
@@ -826,7 +832,9 @@ var OpenAIAssistantAdapter = class {
|
|
|
826
832
|
];
|
|
827
833
|
const instructionsMessage = messages.shift();
|
|
828
834
|
const instructions = instructionsMessage.isTextMessage() ? instructionsMessage.content : "";
|
|
829
|
-
const userMessage = messages.map((m) => convertMessageToOpenAIMessage(m
|
|
835
|
+
const userMessage = messages.map((m) => convertMessageToOpenAIMessage(m, {
|
|
836
|
+
keepSystemRole: this.keepSystemRole
|
|
837
|
+
})).map(convertSystemMessageToAssistantAPI).at(-1);
|
|
830
838
|
if (userMessage.role !== "user") {
|
|
831
839
|
throw new Error("No user message found");
|
|
832
840
|
}
|