@agentica/core 0.16.4 → 0.16.7
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/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +128 -193
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/call.js +13 -18
- package/lib/orchestrate/call.js.map +1 -1
- package/lib/orchestrate/cancel.js +3 -2
- package/lib/orchestrate/cancel.js.map +1 -1
- package/lib/orchestrate/execute.js +0 -7
- package/lib/orchestrate/execute.js.map +1 -1
- package/lib/orchestrate/internal/cancelFunction.js +13 -24
- package/lib/orchestrate/internal/cancelFunction.js.map +1 -1
- package/lib/utils/ChatGptCompletionMessageUtil.js +316 -368
- package/lib/utils/ChatGptCompletionMessageUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/orchestrate/call.ts +15 -22
- package/src/orchestrate/cancel.ts +3 -2
- package/src/orchestrate/execute.ts +0 -7
- package/src/orchestrate/internal/cancelFunction.ts +4 -4
- package/src/utils/ChatGptCompletionMessageUtil.ts +7 -5
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.cancelFunction = cancelFunction;
|
|
13
4
|
const events_1 = require("../../factory/events");
|
|
@@ -16,20 +7,18 @@ const operations_1 = require("../../factory/operations");
|
|
|
16
7
|
* @internal
|
|
17
8
|
*/
|
|
18
9
|
function cancelFunction(ctx, reference) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return item;
|
|
33
|
-
});
|
|
10
|
+
const index = ctx.stack.findIndex(item => item.operation.name === reference.name);
|
|
11
|
+
if (index === -1) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const item = ctx.stack[index];
|
|
15
|
+
ctx.stack.splice(index, 1);
|
|
16
|
+
ctx.dispatch((0, events_1.createCancelEvent)({
|
|
17
|
+
selection: (0, operations_1.createOperationSelection)({
|
|
18
|
+
operation: item.operation,
|
|
19
|
+
reason: reference.reason,
|
|
20
|
+
}),
|
|
21
|
+
})).catch(() => { });
|
|
22
|
+
return item;
|
|
34
23
|
}
|
|
35
24
|
//# sourceMappingURL=cancelFunction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancelFunction.js","sourceRoot":"","sources":["../../../src/orchestrate/internal/cancelFunction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cancelFunction.js","sourceRoot":"","sources":["../../../src/orchestrate/internal/cancelFunction.ts"],"names":[],"mappings":";;AAYA,wCAsBC;AA5BD,iDAAyD;AACzD,yDAAoE;AAEpE;;GAEG;AACH,SAAgB,cAAc,CAC5B,GAA2B,EAC3B,SAAmC;IAEnC,MAAM,KAAK,GAAW,GAAG,CAAC,KAAK,CAAC,SAAS,CACvC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAC/C,CAAC;IACF,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAsC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAE,CAAC;IAClE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,GAAG,CAAC,QAAQ,CACV,IAAA,0BAAiB,EAAC;QAChB,SAAS,EAAE,IAAA,qCAAwB,EAAC;YAClC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,MAAM,EAAE,SAAS,CAAC,MAAM;SACzB,CAAC;KACH,CAAC,CACH,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAClB,OAAO,IAAI,CAAC;AACd,CAAC"}
|