@copilotkit/runtime 1.6.0-next.3 → 1.6.0-next.5
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 +15 -0
- package/dist/{chunk-25Z2ZUVM.mjs → chunk-3C73PW47.mjs} +2 -2
- package/dist/{chunk-OS5YD32G.mjs → chunk-7EXH7PVD.mjs} +3 -2
- package/dist/chunk-7EXH7PVD.mjs.map +1 -0
- package/dist/{chunk-J6E3ZTJ3.mjs → chunk-F6WKKTYT.mjs} +29 -31
- package/dist/chunk-F6WKKTYT.mjs.map +1 -0
- package/dist/{chunk-7HPGWUP7.mjs → chunk-I6W6FUR5.mjs} +2 -2
- package/dist/{chunk-ZM4JOETB.mjs → chunk-RG3UJM7Q.mjs} +2 -2
- package/dist/index.js +99 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/lib/index.js +92 -93
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.js +2 -2
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +28 -27
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -1
- package/package.json +3 -3
- package/src/lib/runtime/__tests__/remote-action-constructors.test.ts +236 -0
- package/src/lib/runtime/remote-action-constructors.ts +9 -7
- package/src/lib/runtime/remote-lg-action.ts +2 -6
- package/src/service-adapters/conversion.ts +39 -46
- package/src/service-adapters/openai/utils.ts +2 -1
- package/tsconfig.json +3 -2
- package/dist/chunk-J6E3ZTJ3.mjs.map +0 -1
- package/dist/chunk-OS5YD32G.mjs.map +0 -1
- /package/dist/{chunk-25Z2ZUVM.mjs.map → chunk-3C73PW47.mjs.map} +0 -0
- /package/dist/{chunk-7HPGWUP7.mjs.map → chunk-I6W6FUR5.mjs.map} +0 -0
- /package/dist/{chunk-ZM4JOETB.mjs.map → chunk-RG3UJM7Q.mjs.map} +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { TextEncoder } from "util";
|
|
2
|
+
import { RemoteLangGraphEventSource } from "../../../agents/langgraph/event-source";
|
|
3
|
+
import telemetry from "../../telemetry-client";
|
|
4
|
+
import {
|
|
5
|
+
constructLGCRemoteAction,
|
|
6
|
+
constructRemoteActions,
|
|
7
|
+
createHeaders,
|
|
8
|
+
} from "../remote-action-constructors";
|
|
9
|
+
import { execute } from "../remote-lg-action";
|
|
10
|
+
|
|
11
|
+
// Mock external dependencies
|
|
12
|
+
jest.mock("../remote-lg-action", () => ({
|
|
13
|
+
execute: jest.fn(),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
jest.mock("../../telemetry-client", () => ({
|
|
17
|
+
capture: jest.fn(),
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
jest.mock("../../../agents/langgraph/event-source", () => ({
|
|
21
|
+
RemoteLangGraphEventSource: jest.fn(),
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
// Dummy logger
|
|
25
|
+
const logger = {
|
|
26
|
+
debug: jest.fn(),
|
|
27
|
+
error: jest.fn(),
|
|
28
|
+
child: jest.fn(() => logger),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Dummy graphqlContext
|
|
32
|
+
const graphqlContext = { properties: { dummyProp: "value" } } as any;
|
|
33
|
+
|
|
34
|
+
// Dummy agent state
|
|
35
|
+
const agentStates = [{ agentName: "agent1", state: "{}", configurable: "{}" }];
|
|
36
|
+
|
|
37
|
+
// Dummy agent used in constructLGCRemoteAction
|
|
38
|
+
const dummyAgent = { name: "agent1", description: "test agent" };
|
|
39
|
+
const endpoint = {
|
|
40
|
+
agents: [dummyAgent],
|
|
41
|
+
deploymentUrl: "http://dummy.deployment",
|
|
42
|
+
langsmithApiKey: "dummykey",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Clear mocks before each test
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
jest.clearAllMocks();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe("remote action constructors", () => {
|
|
51
|
+
describe("constructLGCRemoteAction", () => {
|
|
52
|
+
it("should create an agent with langGraphAgentHandler that processes events", async () => {
|
|
53
|
+
// Arrange: simulate execute returning a dummy ReadableStream
|
|
54
|
+
const dummyEncodedEvent = new TextEncoder().encode(JSON.stringify({ event: "test" }) + "\n");
|
|
55
|
+
const readerMock = {
|
|
56
|
+
read: jest
|
|
57
|
+
.fn()
|
|
58
|
+
.mockResolvedValueOnce({ done: false, value: dummyEncodedEvent })
|
|
59
|
+
.mockResolvedValueOnce({ done: true, value: new Uint8Array() }),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const dummyResponse = {
|
|
63
|
+
getReader: () => readerMock,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
(execute as jest.Mock).mockResolvedValue(dummyResponse);
|
|
67
|
+
|
|
68
|
+
// Mock RemoteLangGraphEventSource to return a dummy processed result
|
|
69
|
+
const processLangGraphEventsMock = jest.fn(() => "processed events");
|
|
70
|
+
(RemoteLangGraphEventSource as jest.Mock).mockImplementation(() => ({
|
|
71
|
+
eventStream$: { next: jest.fn(), complete: jest.fn(), error: jest.fn() },
|
|
72
|
+
processLangGraphEvents: processLangGraphEventsMock,
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
// Act: build the action and call langGraphAgentHandler
|
|
76
|
+
const actions = constructLGCRemoteAction({
|
|
77
|
+
endpoint,
|
|
78
|
+
graphqlContext,
|
|
79
|
+
logger,
|
|
80
|
+
messages: [],
|
|
81
|
+
agentStates,
|
|
82
|
+
});
|
|
83
|
+
expect(actions).toHaveLength(1);
|
|
84
|
+
const action = actions[0];
|
|
85
|
+
expect(action.name).toEqual(dummyAgent.name);
|
|
86
|
+
|
|
87
|
+
const result = await action.langGraphAgentHandler({
|
|
88
|
+
name: dummyAgent.name,
|
|
89
|
+
actionInputsWithoutAgents: [],
|
|
90
|
+
threadId: "thread1",
|
|
91
|
+
nodeName: "node1",
|
|
92
|
+
additionalMessages: [],
|
|
93
|
+
metaEvents: [],
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Assert: processLangGraphEvents is called and result returned
|
|
97
|
+
expect(processLangGraphEventsMock).toHaveBeenCalled();
|
|
98
|
+
expect(result).toBe("processed events");
|
|
99
|
+
|
|
100
|
+
// Check telemetry.capture was called with agentExecution true
|
|
101
|
+
expect(telemetry.capture).toHaveBeenCalledWith(
|
|
102
|
+
"oss.runtime.remote_action_executed",
|
|
103
|
+
expect.objectContaining({
|
|
104
|
+
agentExecution: true,
|
|
105
|
+
type: "langgraph-platform",
|
|
106
|
+
agentsAmount: 1,
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe("constructRemoteActions", () => {
|
|
113
|
+
const json = {
|
|
114
|
+
agents: [{ name: "agent2", description: "agent desc" }],
|
|
115
|
+
actions: [
|
|
116
|
+
{
|
|
117
|
+
name: "action1",
|
|
118
|
+
description: "action desc",
|
|
119
|
+
parameters: { param: "value" },
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
const url = "http://dummy.api";
|
|
124
|
+
const onBeforeRequest = jest.fn(() => ({ headers: { Authorization: "Bearer token" } }));
|
|
125
|
+
|
|
126
|
+
it("should create remote action handler that calls fetch and returns the result", async () => {
|
|
127
|
+
// Arrange: mock fetch for action handler
|
|
128
|
+
global.fetch = jest.fn().mockResolvedValue({
|
|
129
|
+
ok: true,
|
|
130
|
+
json: jest.fn().mockResolvedValue({ result: "action result" }),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const actionsArray = constructRemoteActions({
|
|
134
|
+
json,
|
|
135
|
+
url,
|
|
136
|
+
onBeforeRequest,
|
|
137
|
+
graphqlContext,
|
|
138
|
+
logger,
|
|
139
|
+
messages: [],
|
|
140
|
+
agentStates,
|
|
141
|
+
});
|
|
142
|
+
// There should be one action (from json.actions) and one agent (from json.agents)
|
|
143
|
+
expect(actionsArray).toHaveLength(2);
|
|
144
|
+
const actionHandler = actionsArray[0].handler;
|
|
145
|
+
|
|
146
|
+
const result = await actionHandler({ foo: "bar" });
|
|
147
|
+
expect(result).toEqual("action result");
|
|
148
|
+
|
|
149
|
+
expect(global.fetch).toHaveBeenCalledWith(
|
|
150
|
+
`${url}/actions/execute`,
|
|
151
|
+
expect.objectContaining({
|
|
152
|
+
method: "POST",
|
|
153
|
+
headers: expect.objectContaining({
|
|
154
|
+
"Content-Type": "application/json",
|
|
155
|
+
Authorization: "Bearer token",
|
|
156
|
+
}),
|
|
157
|
+
body: expect.any(String),
|
|
158
|
+
}),
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it("should create remote agent handler that processes events", async () => {
|
|
163
|
+
// Arrange: mock fetch for agent handler to return a dummy stream
|
|
164
|
+
const dummyEncodedAgentEvent = new TextEncoder().encode('{"event":"data"}\n');
|
|
165
|
+
const agentReaderMock = {
|
|
166
|
+
read: jest
|
|
167
|
+
.fn()
|
|
168
|
+
.mockResolvedValueOnce({ done: false, value: dummyEncodedAgentEvent })
|
|
169
|
+
.mockResolvedValueOnce({ done: true, value: new Uint8Array() }),
|
|
170
|
+
};
|
|
171
|
+
const dummyStreamResponse = {
|
|
172
|
+
getReader: () => agentReaderMock,
|
|
173
|
+
};
|
|
174
|
+
global.fetch = jest.fn().mockResolvedValue({
|
|
175
|
+
ok: true,
|
|
176
|
+
text: jest.fn().mockResolvedValue("ok"),
|
|
177
|
+
body: dummyStreamResponse,
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const processLangGraphEventsMock = jest.fn(() => "agent events processed");
|
|
181
|
+
(RemoteLangGraphEventSource as jest.Mock).mockImplementation(() => ({
|
|
182
|
+
eventStream$: { next: jest.fn(), complete: jest.fn(), error: jest.fn() },
|
|
183
|
+
processLangGraphEvents: processLangGraphEventsMock,
|
|
184
|
+
}));
|
|
185
|
+
|
|
186
|
+
const actionsArray = constructRemoteActions({
|
|
187
|
+
json,
|
|
188
|
+
url,
|
|
189
|
+
onBeforeRequest,
|
|
190
|
+
graphqlContext,
|
|
191
|
+
logger,
|
|
192
|
+
messages: [],
|
|
193
|
+
agentStates,
|
|
194
|
+
});
|
|
195
|
+
// The remote agent is the second item in the array
|
|
196
|
+
expect(actionsArray).toHaveLength(2);
|
|
197
|
+
const remoteAgentHandler = (actionsArray[1] as any).langGraphAgentHandler;
|
|
198
|
+
const result = await remoteAgentHandler({
|
|
199
|
+
name: "agent2",
|
|
200
|
+
actionInputsWithoutAgents: [],
|
|
201
|
+
threadId: "thread2",
|
|
202
|
+
nodeName: "node2",
|
|
203
|
+
additionalMessages: [],
|
|
204
|
+
metaEvents: [],
|
|
205
|
+
});
|
|
206
|
+
expect(processLangGraphEventsMock).toHaveBeenCalled();
|
|
207
|
+
expect(result).toBe("agent events processed");
|
|
208
|
+
|
|
209
|
+
// Check telemetry.capture for agent execution
|
|
210
|
+
expect(telemetry.capture).toHaveBeenCalledWith(
|
|
211
|
+
"oss.runtime.remote_action_executed",
|
|
212
|
+
expect.objectContaining({
|
|
213
|
+
agentExecution: true,
|
|
214
|
+
type: "self-hosted",
|
|
215
|
+
agentsAmount: 1,
|
|
216
|
+
}),
|
|
217
|
+
);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
describe("createHeaders", () => {
|
|
222
|
+
it("should merge headers from onBeforeRequest", () => {
|
|
223
|
+
const onBeforeRequest = jest.fn(() => ({ headers: { "X-Test": "123" } }));
|
|
224
|
+
const headers = createHeaders(onBeforeRequest, graphqlContext);
|
|
225
|
+
expect(headers).toEqual({
|
|
226
|
+
"Content-Type": "application/json",
|
|
227
|
+
"X-Test": "123",
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("should return only Content-Type if no additional headers", () => {
|
|
232
|
+
const headers = createHeaders(undefined, graphqlContext);
|
|
233
|
+
expect(headers).toEqual({ "Content-Type": "application/json" });
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
@@ -18,6 +18,8 @@ import { LangGraphEvent } from "../../agents/langgraph/events";
|
|
|
18
18
|
import { execute } from "./remote-lg-action";
|
|
19
19
|
import { CopilotKitError, CopilotKitLowLevelError } from "@copilotkit/shared";
|
|
20
20
|
import { CopilotKitApiDiscoveryError, ResolvedCopilotKitError } from "@copilotkit/shared";
|
|
21
|
+
import { parseJson, tryMap } from "@copilotkit/shared";
|
|
22
|
+
import { ActionInput } from "../../graphql/inputs/action.input";
|
|
21
23
|
|
|
22
24
|
export function constructLGCRemoteAction({
|
|
23
25
|
endpoint,
|
|
@@ -59,8 +61,8 @@ export function constructLGCRemoteAction({
|
|
|
59
61
|
if (agentStates) {
|
|
60
62
|
const jsonState = agentStates.find((state) => state.agentName === name);
|
|
61
63
|
if (jsonState) {
|
|
62
|
-
state =
|
|
63
|
-
configurable =
|
|
64
|
+
state = parseJson(jsonState.state, {});
|
|
65
|
+
configurable = parseJson(jsonState.configurable, {});
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -76,10 +78,10 @@ export function constructLGCRemoteAction({
|
|
|
76
78
|
state,
|
|
77
79
|
configurable,
|
|
78
80
|
properties: graphqlContext.properties,
|
|
79
|
-
actions: actionInputsWithoutAgents
|
|
81
|
+
actions: tryMap(actionInputsWithoutAgents, (action: ActionInput) => ({
|
|
80
82
|
name: action.name,
|
|
81
83
|
description: action.description,
|
|
82
|
-
parameters: JSON.parse(action.jsonSchema)
|
|
84
|
+
parameters: JSON.parse(action.jsonSchema),
|
|
83
85
|
})),
|
|
84
86
|
metaEvents,
|
|
85
87
|
});
|
|
@@ -203,8 +205,8 @@ export function constructRemoteActions({
|
|
|
203
205
|
if (agentStates) {
|
|
204
206
|
const jsonState = agentStates.find((state) => state.agentName === name);
|
|
205
207
|
if (jsonState) {
|
|
206
|
-
state =
|
|
207
|
-
configurable =
|
|
208
|
+
state = parseJson(jsonState.state, {});
|
|
209
|
+
configurable = parseJson(jsonState.configurable, {});
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
|
|
@@ -221,7 +223,7 @@ export function constructRemoteActions({
|
|
|
221
223
|
state,
|
|
222
224
|
configurable,
|
|
223
225
|
properties: graphqlContext.properties,
|
|
224
|
-
actions: actionInputsWithoutAgents
|
|
226
|
+
actions: tryMap(actionInputsWithoutAgents, (action: ActionInput) => ({
|
|
225
227
|
name: action.name,
|
|
226
228
|
description: action.description,
|
|
227
229
|
parameters: JSON.parse(action.jsonSchema),
|
|
@@ -13,6 +13,7 @@ import telemetry from "../telemetry-client";
|
|
|
13
13
|
import { MetaEventInput } from "../../graphql/inputs/meta-event.input";
|
|
14
14
|
import { MetaEventName } from "../../graphql/types/meta-events.type";
|
|
15
15
|
import { RunsStreamPayload } from "@langchain/langgraph-sdk/dist/types";
|
|
16
|
+
import { parseJson } from "@copilotkit/shared";
|
|
16
17
|
|
|
17
18
|
type State = Record<string, any>;
|
|
18
19
|
|
|
@@ -164,12 +165,7 @@ async function streamEvents(controller: ReadableStreamDefaultController, args: E
|
|
|
164
165
|
}
|
|
165
166
|
if (lgInterruptMetaEvent?.response) {
|
|
166
167
|
let response = lgInterruptMetaEvent.response;
|
|
167
|
-
|
|
168
|
-
payload.command = { resume: JSON.parse(response) };
|
|
169
|
-
// In case of unparsable string, we keep the event as is
|
|
170
|
-
} catch (e) {
|
|
171
|
-
payload.command = { resume: response };
|
|
172
|
-
}
|
|
168
|
+
payload.command = { resume: parseJson(response, response) };
|
|
173
169
|
}
|
|
174
170
|
|
|
175
171
|
if (mode === "continue" && !activeInterruptEvent) {
|
|
@@ -7,58 +7,51 @@ import {
|
|
|
7
7
|
} from "../graphql/types/converted";
|
|
8
8
|
import { MessageInput } from "../graphql/inputs/message.input";
|
|
9
9
|
import { plainToInstance } from "class-transformer";
|
|
10
|
+
import { tryMap } from "@copilotkit/shared";
|
|
10
11
|
|
|
11
12
|
export function convertGqlInputToMessages(inputMessages: MessageInput[]): Message[] {
|
|
12
|
-
const messages
|
|
13
|
-
|
|
14
|
-
for (const message of inputMessages) {
|
|
13
|
+
const messages = tryMap(inputMessages, (message) => {
|
|
15
14
|
if (message.textMessage) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}),
|
|
24
|
-
);
|
|
15
|
+
return plainToInstance(TextMessage, {
|
|
16
|
+
id: message.id,
|
|
17
|
+
createdAt: message.createdAt,
|
|
18
|
+
role: message.textMessage.role,
|
|
19
|
+
content: message.textMessage.content,
|
|
20
|
+
parentMessageId: message.textMessage.parentMessageId,
|
|
21
|
+
});
|
|
25
22
|
} else if (message.actionExecutionMessage) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}),
|
|
34
|
-
);
|
|
23
|
+
return plainToInstance(ActionExecutionMessage, {
|
|
24
|
+
id: message.id,
|
|
25
|
+
createdAt: message.createdAt,
|
|
26
|
+
name: message.actionExecutionMessage.name,
|
|
27
|
+
arguments: JSON.parse(message.actionExecutionMessage.arguments),
|
|
28
|
+
parentMessageId: message.actionExecutionMessage.parentMessageId,
|
|
29
|
+
});
|
|
35
30
|
} else if (message.resultMessage) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
);
|
|
31
|
+
return plainToInstance(ResultMessage, {
|
|
32
|
+
id: message.id,
|
|
33
|
+
createdAt: message.createdAt,
|
|
34
|
+
actionExecutionId: message.resultMessage.actionExecutionId,
|
|
35
|
+
actionName: message.resultMessage.actionName,
|
|
36
|
+
result: message.resultMessage.result,
|
|
37
|
+
});
|
|
45
38
|
} else if (message.agentStateMessage) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
return plainToInstance(AgentStateMessage, {
|
|
40
|
+
id: message.id,
|
|
41
|
+
threadId: message.agentStateMessage.threadId,
|
|
42
|
+
createdAt: message.createdAt,
|
|
43
|
+
agentName: message.agentStateMessage.agentName,
|
|
44
|
+
nodeName: message.agentStateMessage.nodeName,
|
|
45
|
+
runId: message.agentStateMessage.runId,
|
|
46
|
+
active: message.agentStateMessage.active,
|
|
47
|
+
role: message.agentStateMessage.role,
|
|
48
|
+
state: JSON.parse(message.agentStateMessage.state),
|
|
49
|
+
running: message.agentStateMessage.running,
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
return null;
|
|
60
53
|
}
|
|
61
|
-
}
|
|
54
|
+
});
|
|
62
55
|
|
|
63
|
-
return messages;
|
|
56
|
+
return messages.filter((m) => m);
|
|
64
57
|
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ChatCompletionAssistantMessageParam,
|
|
8
8
|
ChatCompletionSystemMessageParam,
|
|
9
9
|
} from "openai/resources";
|
|
10
|
+
import { parseJson } from "@copilotkit/shared";
|
|
10
11
|
|
|
11
12
|
export function limitMessagesToTokenCount(
|
|
12
13
|
messages: any[],
|
|
@@ -113,7 +114,7 @@ export function convertActionInputToOpenAITool(action: ActionInput): ChatComplet
|
|
|
113
114
|
function: {
|
|
114
115
|
name: action.name,
|
|
115
116
|
description: action.description,
|
|
116
|
-
parameters:
|
|
117
|
+
parameters: parseJson(action.jsonSchema, {}),
|
|
117
118
|
},
|
|
118
119
|
};
|
|
119
120
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../utilities/tsconfig/base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
+
"types": ["node", "jest"],
|
|
4
5
|
"lib": ["es2017", "dom"],
|
|
5
6
|
"emitDecoratorMetadata": true,
|
|
6
7
|
"experimentalDecorators": true,
|
|
7
8
|
"strict": false,
|
|
8
9
|
"resolveJsonModule": true
|
|
9
10
|
},
|
|
10
|
-
"include": ["./src/**/*.ts"],
|
|
11
|
-
"exclude": ["dist", "build", "node_modules"
|
|
11
|
+
"include": ["./src/**/*.ts", "./src/**/*.test.ts", "./src/**/__tests__/*"],
|
|
12
|
+
"exclude": ["dist", "build", "node_modules"]
|
|
12
13
|
}
|