@copilotkit/runtime 1.3.16-mme-copilot-suggestions.1 → 1.3.16-mme-reset-chat.2
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 +14 -6
- package/dist/{chunk-ZP2IRHF3.mjs → chunk-7LIN2NIO.mjs} +2 -2
- package/dist/{chunk-SKS2SK3W.mjs → chunk-AXHCROTL.mjs} +2 -2
- package/dist/{chunk-2H4XYEHG.mjs → chunk-DX45O7PM.mjs} +2 -2
- package/dist/chunk-DX45O7PM.mjs.map +1 -0
- package/dist/{chunk-SKKQQVDM.mjs → chunk-KFO5XSPV.mjs} +2 -2
- package/dist/{chunk-VGYN7TGZ.mjs → chunk-SMVZ2NQP.mjs} +29 -19
- package/dist/{chunk-VGYN7TGZ.mjs.map → chunk-SMVZ2NQP.mjs.map} +1 -1
- package/dist/{chunk-XBB3O4AV.mjs → chunk-STQIVH2M.mjs} +3 -3
- package/dist/{groq-adapter-2d3a332a.d.ts → groq-adapter-b122e71f.d.ts} +1 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +29 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +29 -19
- 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 +4 -4
- 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 +2 -2
- 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 +2 -2
- 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 +1 -1
- package/dist/service-adapters/index.d.ts +1 -1
- package/dist/service-adapters/index.js +28 -18
- 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/google/google-genai-adapter.ts +2 -2
- package/src/service-adapters/langchain/langchain-adapter.ts +23 -19
- package/dist/chunk-2H4XYEHG.mjs.map +0 -1
- /package/dist/{chunk-ZP2IRHF3.mjs.map → chunk-7LIN2NIO.mjs.map} +0 -0
- /package/dist/{chunk-SKS2SK3W.mjs.map → chunk-AXHCROTL.mjs.map} +0 -0
- /package/dist/{chunk-SKKQQVDM.mjs.map → chunk-KFO5XSPV.mjs.map} +0 -0
- /package/dist/{chunk-XBB3O4AV.mjs.map → chunk-STQIVH2M.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-STQIVH2M.mjs";
|
|
5
5
|
import {
|
|
6
6
|
AnthropicAdapter,
|
|
7
7
|
GoogleGenerativeAIAdapter,
|
|
@@ -11,24 +11,24 @@ import {
|
|
|
11
11
|
OpenAIAssistantAdapter,
|
|
12
12
|
RemoteChain,
|
|
13
13
|
UnifyAdapter
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SMVZ2NQP.mjs";
|
|
15
15
|
import {
|
|
16
16
|
config,
|
|
17
17
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
18
18
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7LIN2NIO.mjs";
|
|
20
20
|
import {
|
|
21
21
|
copilotRuntimeNestEndpoint
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-KFO5XSPV.mjs";
|
|
23
23
|
import {
|
|
24
24
|
copilotRuntimeNodeExpressEndpoint
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-AXHCROTL.mjs";
|
|
26
26
|
import {
|
|
27
27
|
buildSchema,
|
|
28
28
|
copilotRuntimeNodeHttpEndpoint,
|
|
29
29
|
createContext,
|
|
30
30
|
getCommonConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-DX45O7PM.mjs";
|
|
32
32
|
import "./chunk-MXXPWWBF.mjs";
|
|
33
33
|
import {
|
|
34
34
|
GuardrailsValidationFailureResponse,
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { g as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, c as CreateCopilotRuntimeServerOptions, G as GraphQLContext, e as buildSchema, d as createContext, f as flattenToolCallsNoDuplicates, h as getCommonConfig } from '../copilot-runtime-df3527ad.js';
|
|
2
|
-
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-
|
|
2
|
+
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-b122e71f.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/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.3.16-mme-
|
|
47
|
+
version: "1.3.16-mme-reset-chat.2",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -668,6 +668,7 @@ __name(encodeResult, "encodeResult");
|
|
|
668
668
|
|
|
669
669
|
// src/service-adapters/langchain/langchain-adapter.ts
|
|
670
670
|
var import_shared3 = require("@copilotkit/shared");
|
|
671
|
+
var import_promises = require("@langchain/core/callbacks/promises");
|
|
671
672
|
var LangChainAdapter = class {
|
|
672
673
|
options;
|
|
673
674
|
/**
|
|
@@ -677,23 +678,28 @@ var LangChainAdapter = class {
|
|
|
677
678
|
this.options = options;
|
|
678
679
|
}
|
|
679
680
|
async process(request) {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
await streamLangChainResponse({
|
|
690
|
-
result,
|
|
691
|
-
eventStream$
|
|
681
|
+
try {
|
|
682
|
+
const { eventSource, model, actions, messages, runId } = request;
|
|
683
|
+
const threadId = request.threadId ?? (0, import_shared3.randomId)();
|
|
684
|
+
const result = await this.options.chainFn({
|
|
685
|
+
messages: messages.map(convertMessageToLangChainMessage),
|
|
686
|
+
tools: actions.map(convertActionInputToLangChainTool),
|
|
687
|
+
model,
|
|
688
|
+
threadId,
|
|
689
|
+
runId
|
|
692
690
|
});
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
691
|
+
eventSource.stream(async (eventStream$) => {
|
|
692
|
+
await streamLangChainResponse({
|
|
693
|
+
result,
|
|
694
|
+
eventStream$
|
|
695
|
+
});
|
|
696
|
+
});
|
|
697
|
+
return {
|
|
698
|
+
threadId
|
|
699
|
+
};
|
|
700
|
+
} finally {
|
|
701
|
+
await (0, import_promises.awaitAllCallbacks)();
|
|
702
|
+
}
|
|
697
703
|
}
|
|
698
704
|
};
|
|
699
705
|
__name(LangChainAdapter, "LangChainAdapter");
|
|
@@ -703,12 +709,16 @@ var import_google_gauth = require("@langchain/google-gauth");
|
|
|
703
709
|
var GoogleGenerativeAIAdapter = class extends LangChainAdapter {
|
|
704
710
|
constructor(options) {
|
|
705
711
|
super({
|
|
706
|
-
chainFn: async ({ messages, tools }) => {
|
|
712
|
+
chainFn: async ({ messages, tools, threadId }) => {
|
|
707
713
|
const model = new import_google_gauth.ChatGoogle({
|
|
708
714
|
modelName: (options == null ? void 0 : options.model) ?? "gemini-1.5-pro",
|
|
709
715
|
apiVersion: "v1beta"
|
|
710
716
|
}).bindTools(tools);
|
|
711
|
-
return model.stream(messages
|
|
717
|
+
return model.stream(messages, {
|
|
718
|
+
metadata: {
|
|
719
|
+
conversation_id: threadId
|
|
720
|
+
}
|
|
721
|
+
});
|
|
712
722
|
}
|
|
713
723
|
});
|
|
714
724
|
}
|