@agentica/core 0.13.5 → 0.14.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.
Files changed (189) hide show
  1. package/lib/Agentica.js +8 -10
  2. package/lib/Agentica.js.map +1 -1
  3. package/lib/context/AgenticaCancelPrompt.d.ts +4 -12
  4. package/lib/context/AgenticaCancelPrompt.js +0 -17
  5. package/lib/context/AgenticaCancelPrompt.js.map +1 -1
  6. package/lib/context/AgenticaOperationSelection.d.ts +4 -11
  7. package/lib/context/AgenticaOperationSelection.js +0 -14
  8. package/lib/context/AgenticaOperationSelection.js.map +1 -1
  9. package/lib/context/AgenticaTokenUsage.js.map +1 -1
  10. package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -1
  11. package/lib/events/AgenticaCallEvent.d.ts +23 -13
  12. package/lib/events/AgenticaCallEvent.js +0 -19
  13. package/lib/events/AgenticaCallEvent.js.map +1 -1
  14. package/lib/events/AgenticaCancelEvent.d.ts +4 -10
  15. package/lib/events/AgenticaCancelEvent.js +0 -15
  16. package/lib/events/AgenticaCancelEvent.js.map +1 -1
  17. package/lib/events/AgenticaDescribeEvent.d.ts +8 -27
  18. package/lib/events/AgenticaDescribeEvent.js +0 -52
  19. package/lib/events/AgenticaDescribeEvent.js.map +1 -1
  20. package/lib/events/AgenticaEvent.d.ts +13 -1
  21. package/lib/events/AgenticaEventBase.d.ts +5 -3
  22. package/lib/events/AgenticaEventBase.js +0 -7
  23. package/lib/events/AgenticaEventBase.js.map +1 -1
  24. package/lib/events/AgenticaExecuteEvent.d.ts +15 -15
  25. package/lib/events/AgenticaExecuteEvent.js +0 -30
  26. package/lib/events/AgenticaExecuteEvent.js.map +1 -1
  27. package/lib/events/AgenticaInitializeEvent.d.ts +3 -4
  28. package/lib/events/AgenticaInitializeEvent.js +0 -13
  29. package/lib/events/AgenticaInitializeEvent.js.map +1 -1
  30. package/lib/events/AgenticaRequestEvent.d.ts +5 -24
  31. package/lib/events/AgenticaRequestEvent.js +0 -19
  32. package/lib/events/AgenticaRequestEvent.js.map +1 -1
  33. package/lib/events/AgenticaResponseEvent.d.ts +22 -32
  34. package/lib/events/AgenticaResponseEvent.js +0 -13
  35. package/lib/events/AgenticaResponseEvent.js.map +1 -1
  36. package/lib/events/AgenticaSelectEvent.d.ts +6 -12
  37. package/lib/events/AgenticaSelectEvent.js +0 -23
  38. package/lib/events/AgenticaSelectEvent.js.map +1 -1
  39. package/lib/events/AgenticaTextEvent.d.ts +8 -27
  40. package/lib/events/AgenticaTextEvent.js +0 -52
  41. package/lib/events/AgenticaTextEvent.js.map +1 -1
  42. package/lib/events/AgenticaValidateEvent.d.ts +25 -0
  43. package/lib/events/AgenticaValidateEvent.js +3 -0
  44. package/lib/events/AgenticaValidateEvent.js.map +1 -0
  45. package/lib/factory/events.d.ts +65 -0
  46. package/lib/factory/events.js +173 -0
  47. package/lib/factory/events.js.map +1 -0
  48. package/lib/factory/index.d.ts +3 -0
  49. package/lib/factory/index.js +20 -0
  50. package/lib/factory/index.js.map +1 -0
  51. package/lib/factory/operations.d.ts +7 -0
  52. package/lib/factory/operations.js +14 -0
  53. package/lib/factory/operations.js.map +1 -0
  54. package/lib/factory/prompts.d.ts +30 -0
  55. package/lib/factory/prompts.js +76 -0
  56. package/lib/factory/prompts.js.map +1 -0
  57. package/lib/index.d.ts +2 -0
  58. package/lib/index.js +25 -4
  59. package/lib/index.js.map +1 -1
  60. package/lib/index.mjs +328 -347
  61. package/lib/index.mjs.map +1 -1
  62. package/lib/json/IAgenticaEventJson.d.ts +4 -2
  63. package/lib/json/IAgenticaPromptJson.d.ts +1 -1
  64. package/lib/orchestrate/ChatGptAgent.js.map +1 -0
  65. package/lib/{chatgpt → orchestrate}/ChatGptCallFunctionAgent.d.ts +2 -1
  66. package/lib/{chatgpt → orchestrate}/ChatGptCallFunctionAgent.js +33 -28
  67. package/lib/orchestrate/ChatGptCallFunctionAgent.js.map +1 -0
  68. package/lib/orchestrate/ChatGptCancelFunctionAgent.d.ts +12 -0
  69. package/lib/{chatgpt → orchestrate}/ChatGptCancelFunctionAgent.js +7 -9
  70. package/lib/orchestrate/ChatGptCancelFunctionAgent.js.map +1 -0
  71. package/lib/orchestrate/ChatGptCompletionMessageUtil.d.ts +14 -0
  72. package/lib/{chatgpt → orchestrate}/ChatGptCompletionMessageUtil.js +0 -5
  73. package/lib/orchestrate/ChatGptCompletionMessageUtil.js.map +1 -0
  74. package/lib/{chatgpt → orchestrate}/ChatGptDescribeFunctionAgent.d.ts +3 -2
  75. package/lib/{chatgpt → orchestrate}/ChatGptDescribeFunctionAgent.js +4 -5
  76. package/lib/orchestrate/ChatGptDescribeFunctionAgent.js.map +1 -0
  77. package/lib/{chatgpt → orchestrate}/ChatGptHistoryDecoder.d.ts +2 -1
  78. package/lib/{chatgpt → orchestrate}/ChatGptHistoryDecoder.js +0 -1
  79. package/lib/orchestrate/ChatGptHistoryDecoder.js.map +1 -0
  80. package/lib/{chatgpt → orchestrate}/ChatGptInitializeFunctionAgent.d.ts +2 -1
  81. package/lib/{chatgpt → orchestrate}/ChatGptInitializeFunctionAgent.js +4 -5
  82. package/lib/orchestrate/ChatGptInitializeFunctionAgent.js.map +1 -0
  83. package/lib/{chatgpt → orchestrate}/ChatGptSelectFunctionAgent.d.ts +1 -1
  84. package/lib/{chatgpt → orchestrate}/ChatGptSelectFunctionAgent.js +10 -13
  85. package/lib/orchestrate/ChatGptSelectFunctionAgent.js.map +1 -0
  86. package/lib/orchestrate/ChatGptUsageAggregator.d.ts +10 -0
  87. package/lib/{chatgpt → orchestrate}/ChatGptUsageAggregator.js +0 -3
  88. package/lib/orchestrate/ChatGptUsageAggregator.js.map +1 -0
  89. package/lib/orchestrate/index.d.ts +8 -0
  90. package/lib/orchestrate/index.js +25 -0
  91. package/lib/orchestrate/index.js.map +1 -0
  92. package/lib/prompts/AgenticaCancelPrompt.d.ts +4 -12
  93. package/lib/prompts/AgenticaCancelPrompt.js +0 -17
  94. package/lib/prompts/AgenticaCancelPrompt.js.map +1 -1
  95. package/lib/prompts/AgenticaDescribePrompt.d.ts +4 -12
  96. package/lib/prompts/AgenticaDescribePrompt.js +0 -17
  97. package/lib/prompts/AgenticaDescribePrompt.js.map +1 -1
  98. package/lib/prompts/AgenticaExecutePrompt.d.ts +42 -13
  99. package/lib/prompts/AgenticaExecutePrompt.js +0 -21
  100. package/lib/prompts/AgenticaExecutePrompt.js.map +1 -1
  101. package/lib/prompts/AgenticaPrompt.d.ts +10 -0
  102. package/lib/prompts/AgenticaPromptBase.d.ts +5 -6
  103. package/lib/prompts/AgenticaPromptBase.js +0 -19
  104. package/lib/prompts/AgenticaPromptBase.js.map +1 -1
  105. package/lib/prompts/AgenticaSelectPrompt.d.ts +4 -12
  106. package/lib/prompts/AgenticaSelectPrompt.js +0 -17
  107. package/lib/prompts/AgenticaSelectPrompt.js.map +1 -1
  108. package/lib/prompts/AgenticaTextPrompt.d.ts +4 -12
  109. package/lib/prompts/AgenticaTextPrompt.js +0 -17
  110. package/lib/prompts/AgenticaTextPrompt.js.map +1 -1
  111. package/lib/transformers/AgenticaEventTransformer.d.ts +16 -16
  112. package/lib/transformers/AgenticaEventTransformer.js +12 -30
  113. package/lib/transformers/AgenticaEventTransformer.js.map +1 -1
  114. package/lib/transformers/AgenticaPromptTransformer.d.ts +12 -11
  115. package/lib/transformers/AgenticaPromptTransformer.js +9 -19
  116. package/lib/transformers/AgenticaPromptTransformer.js.map +1 -1
  117. package/package.json +3 -3
  118. package/src/Agentica.ts +11 -11
  119. package/src/context/AgenticaCancelPrompt.ts +4 -25
  120. package/src/context/AgenticaContext.ts +0 -1
  121. package/src/context/AgenticaOperation.ts +0 -1
  122. package/src/context/AgenticaOperationCollection.ts +0 -1
  123. package/src/context/AgenticaOperationSelection.ts +4 -22
  124. package/src/context/AgenticaTokenUsage.ts +2 -2
  125. package/src/context/internal/AgenticaTokenUsageAggregator.ts +0 -1
  126. package/src/events/AgenticaCallEvent.ts +26 -29
  127. package/src/events/AgenticaCancelEvent.ts +4 -21
  128. package/src/events/AgenticaDescribeEvent.ts +8 -57
  129. package/src/events/AgenticaEvent.ts +14 -2
  130. package/src/events/AgenticaEventBase.ts +5 -6
  131. package/src/events/AgenticaExecuteEvent.ts +33 -41
  132. package/src/events/AgenticaInitializeEvent.ts +3 -11
  133. package/src/events/AgenticaRequestEvent.ts +5 -40
  134. package/src/events/AgenticaResponseEvent.ts +22 -39
  135. package/src/events/AgenticaSelectEvent.ts +6 -30
  136. package/src/events/AgenticaTextEvent.ts +11 -60
  137. package/src/events/AgenticaValidateEvent.ts +31 -0
  138. package/src/factory/events.ts +229 -0
  139. package/src/factory/index.ts +3 -0
  140. package/src/factory/operations.ts +17 -0
  141. package/src/factory/prompts.ts +104 -0
  142. package/src/index.ts +5 -6
  143. package/src/json/IAgenticaEventJson.ts +5 -3
  144. package/src/json/IAgenticaPromptJson.ts +1 -1
  145. package/src/{chatgpt → orchestrate}/ChatGptCallFunctionAgent.ts +62 -50
  146. package/src/{chatgpt → orchestrate}/ChatGptCancelFunctionAgent.ts +18 -16
  147. package/src/{chatgpt → orchestrate}/ChatGptCompletionMessageUtil.ts +7 -6
  148. package/src/{chatgpt → orchestrate}/ChatGptDescribeFunctionAgent.ts +7 -6
  149. package/src/{chatgpt → orchestrate}/ChatGptHistoryDecoder.ts +1 -2
  150. package/src/{chatgpt → orchestrate}/ChatGptInitializeFunctionAgent.ts +8 -7
  151. package/src/{chatgpt → orchestrate}/ChatGptSelectFunctionAgent.ts +18 -16
  152. package/src/{chatgpt → orchestrate}/ChatGptUsageAggregator.ts +3 -3
  153. package/src/orchestrate/index.ts +8 -0
  154. package/src/prompts/AgenticaCancelPrompt.ts +4 -25
  155. package/src/prompts/AgenticaDescribePrompt.ts +4 -25
  156. package/src/prompts/AgenticaExecutePrompt.ts +52 -44
  157. package/src/prompts/AgenticaPrompt.ts +10 -1
  158. package/src/prompts/AgenticaPromptBase.ts +5 -9
  159. package/src/prompts/AgenticaSelectPrompt.ts +4 -25
  160. package/src/prompts/AgenticaTextPrompt.ts +4 -26
  161. package/src/transformers/AgenticaEventTransformer.ts +30 -32
  162. package/src/transformers/AgenticaPromptTransformer.ts +22 -22
  163. package/lib/chatgpt/ChatGptAgent.js.map +0 -1
  164. package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +0 -1
  165. package/lib/chatgpt/ChatGptCancelFunctionAgent.d.ts +0 -11
  166. package/lib/chatgpt/ChatGptCancelFunctionAgent.js.map +0 -1
  167. package/lib/chatgpt/ChatGptCompletionMessageUtil.d.ts +0 -13
  168. package/lib/chatgpt/ChatGptCompletionMessageUtil.js.map +0 -1
  169. package/lib/chatgpt/ChatGptDescribeFunctionAgent.js.map +0 -1
  170. package/lib/chatgpt/ChatGptHistoryDecoder.js.map +0 -1
  171. package/lib/chatgpt/ChatGptInitializeFunctionAgent.js.map +0 -1
  172. package/lib/chatgpt/ChatGptSelectFunctionAgent.js.map +0 -1
  173. package/lib/chatgpt/ChatGptUsageAggregator.d.ts +0 -9
  174. package/lib/chatgpt/ChatGptUsageAggregator.js.map +0 -1
  175. package/lib/context/AgenticaClassOperation.d.ts +0 -8
  176. package/lib/context/AgenticaClassOperation.js +0 -11
  177. package/lib/context/AgenticaClassOperation.js.map +0 -1
  178. package/lib/context/AgenticaHttpOperation.d.ts +0 -8
  179. package/lib/context/AgenticaHttpOperation.js +0 -11
  180. package/lib/context/AgenticaHttpOperation.js.map +0 -1
  181. package/lib/context/AgenticaOperationBase.d.ts +0 -29
  182. package/lib/context/AgenticaOperationBase.js +0 -21
  183. package/lib/context/AgenticaOperationBase.js.map +0 -1
  184. package/src/context/AgenticaClassOperation.ts +0 -23
  185. package/src/context/AgenticaHttpOperation.ts +0 -27
  186. package/src/context/AgenticaOperationBase.ts +0 -57
  187. package/lib/{chatgpt → orchestrate}/ChatGptAgent.d.ts +0 -0
  188. package/lib/{chatgpt → orchestrate}/ChatGptAgent.js +0 -0
  189. package/src/{chatgpt → orchestrate}/ChatGptAgent.ts +1 -1
@@ -1,22 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgenticaRequestEvent = void 0;
4
- const AgenticaEventBase_1 = require("./AgenticaEventBase");
5
- class AgenticaRequestEvent extends AgenticaEventBase_1.AgenticaEventBase {
6
- constructor(props) {
7
- super("request");
8
- this.source = props.source;
9
- this.body = props.body;
10
- this.options = props.options;
11
- }
12
- toJSON() {
13
- return {
14
- type: "request",
15
- source: this.source,
16
- body: this.body,
17
- options: this.options,
18
- };
19
- }
20
- }
21
- exports.AgenticaRequestEvent = AgenticaRequestEvent;
22
3
  //# sourceMappingURL=AgenticaRequestEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgenticaRequestEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaRequestEvent.ts"],"names":[],"mappings":";;;AAIA,2DAAwD;AAExD,MAAa,oBAAqB,SAAQ,qCAA4B;IAKpE,YAAmB,KAAkC;QACnD,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF;AApBD,oDAoBC"}
1
+ {"version":3,"file":"AgenticaRequestEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaRequestEvent.ts"],"names":[],"mappings":""}
@@ -1,35 +1,25 @@
1
1
  import type OpenAI from "openai";
2
+ import type { AgenticaEventBase } from "./AgenticaEventBase";
2
3
  import type { AgenticaEventSource } from "./AgenticaEventSource";
3
- import { AgenticaEventBase } from "./AgenticaEventBase";
4
- export declare class AgenticaResponseEvent extends AgenticaEventBase<"response"> {
5
- readonly source: AgenticaEventSource;
6
- readonly body: OpenAI.ChatCompletionCreateParamsStreaming;
7
- readonly stream: ReadableStream<OpenAI.ChatCompletionChunk>;
8
- readonly options?: OpenAI.RequestOptions | undefined;
9
- readonly join: () => Promise<OpenAI.ChatCompletion>;
10
- constructor(props: AgenticaResponseEvent.IProps);
11
- }
12
- export declare namespace AgenticaResponseEvent {
13
- interface IProps {
14
- /**
15
- * The source agent of the response.
16
- */
17
- source: AgenticaEventSource;
18
- /**
19
- * Request body.
20
- */
21
- body: OpenAI.ChatCompletionCreateParamsStreaming;
22
- /**
23
- * Options for the request.
24
- */
25
- options?: OpenAI.RequestOptions | undefined;
26
- /**
27
- * The text content stream.
28
- */
29
- stream: ReadableStream<OpenAI.ChatCompletionChunk>;
30
- /**
31
- * Get the description text.
32
- */
33
- join: () => Promise<OpenAI.ChatCompletion>;
34
- }
4
+ export interface AgenticaResponseEvent extends AgenticaEventBase<"response"> {
5
+ /**
6
+ * The source agent of the response.
7
+ */
8
+ source: AgenticaEventSource;
9
+ /**
10
+ * Request body.
11
+ */
12
+ body: OpenAI.ChatCompletionCreateParamsStreaming;
13
+ /**
14
+ * The text content stream.
15
+ */
16
+ stream: ReadableStream<OpenAI.ChatCompletionChunk>;
17
+ /**
18
+ * Options for the request.
19
+ */
20
+ options?: OpenAI.RequestOptions | undefined;
21
+ /**
22
+ * Wait the completion.
23
+ */
24
+ join: () => Promise<OpenAI.ChatCompletion>;
35
25
  }
@@ -1,16 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgenticaResponseEvent = void 0;
4
- const AgenticaEventBase_1 = require("./AgenticaEventBase");
5
- class AgenticaResponseEvent extends AgenticaEventBase_1.AgenticaEventBase {
6
- constructor(props) {
7
- super("response");
8
- this.source = props.source;
9
- this.body = props.body;
10
- this.stream = props.stream;
11
- this.options = props.options;
12
- this.join = props.join;
13
- }
14
- }
15
- exports.AgenticaResponseEvent = AgenticaResponseEvent;
16
3
  //# sourceMappingURL=AgenticaResponseEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgenticaResponseEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaResponseEvent.ts"],"names":[],"mappings":";;;AAGA,2DAAwD;AAExD,MAAa,qBAAsB,SAAQ,qCAA6B;IAOtE,YAAmB,KAAmC;QACpD,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAfD,sDAeC"}
1
+ {"version":3,"file":"AgenticaResponseEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaResponseEvent.ts"],"names":[],"mappings":""}
@@ -1,16 +1,10 @@
1
1
  import type { ILlmSchema } from "@samchon/openapi";
2
2
  import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
3
3
  import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
4
- import { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
5
- import { AgenticaEventBase } from "./AgenticaEventBase";
6
- export declare class AgenticaSelectEvent<Model extends ILlmSchema.Model> extends AgenticaEventBase<"select"> {
7
- readonly selection: AgenticaOperationSelection<Model>;
8
- constructor(props: AgenticaSelectEvent.IProps<Model>);
9
- toJSON(): IAgenticaEventJson.ISelect;
10
- toPrompt(): AgenticaSelectPrompt<Model>;
11
- }
12
- export declare namespace AgenticaSelectEvent {
13
- interface IProps<Model extends ILlmSchema.Model> {
14
- selection: AgenticaOperationSelection<Model>;
15
- }
4
+ import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
5
+ import type { AgenticaEventBase } from "./AgenticaEventBase";
6
+ export interface AgenticaSelectEvent<Model extends ILlmSchema.Model> extends AgenticaEventBase<"select"> {
7
+ selection: AgenticaOperationSelection<Model>;
8
+ toJSON: () => IAgenticaEventJson.ISelect;
9
+ toPrompt: () => AgenticaSelectPrompt<Model>;
16
10
  }
@@ -1,26 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgenticaSelectEvent = void 0;
4
- const uuid_1 = require("uuid");
5
- const AgenticaSelectPrompt_1 = require("../prompts/AgenticaSelectPrompt");
6
- const AgenticaEventBase_1 = require("./AgenticaEventBase");
7
- class AgenticaSelectEvent extends AgenticaEventBase_1.AgenticaEventBase {
8
- constructor(props) {
9
- super("select");
10
- this.selection = props.selection;
11
- }
12
- toJSON() {
13
- return {
14
- type: "select",
15
- selection: this.selection.toJSON(),
16
- };
17
- }
18
- toPrompt() {
19
- return new AgenticaSelectPrompt_1.AgenticaSelectPrompt({
20
- id: (0, uuid_1.v4)(),
21
- selections: [this.selection],
22
- });
23
- }
24
- }
25
- exports.AgenticaSelectEvent = AgenticaSelectEvent;
26
3
  //# sourceMappingURL=AgenticaSelectEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgenticaSelectEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaSelectEvent.ts"],"names":[],"mappings":";;;AAIA,+BAA0B;AAC1B,0EAAuE;AACvE,2DAAwD;AAExD,MAAa,mBAEX,SAAQ,qCAA2B;IAGnC,YAAmB,KAAwC;QACzD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;SACnC,CAAC;IACJ,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,2CAAoB,CAAC;YAC9B,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC;SAC7B,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,kDAuBC"}
1
+ {"version":3,"file":"AgenticaSelectEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaSelectEvent.ts"],"names":[],"mappings":""}
@@ -1,29 +1,10 @@
1
1
  import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
2
- import { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
3
- import { AgenticaEventBase } from "./AgenticaEventBase";
4
- export declare class AgenticaTextEvent extends AgenticaEventBase<"text"> {
5
- readonly role: "assistant" | "user";
6
- readonly stream: ReadableStream<string>;
7
- get text(): string;
8
- /**
9
- * Check if the join method can return a response immediately.
10
- * Returns true if the response is ready to be returned by the join method.
11
- */
12
- get done(): boolean;
13
- constructor(props: AgenticaTextEvent.IProps);
14
- join(): Promise<string>;
15
- toJSON(): IAgenticaEventJson.IText;
16
- toPrompt(): AgenticaTextPrompt;
17
- private readonly done_;
18
- private readonly get_;
19
- private readonly join_;
20
- }
21
- export declare namespace AgenticaTextEvent {
22
- interface IProps {
23
- role: "assistant" | "user";
24
- stream: ReadableStream<string>;
25
- done: () => boolean;
26
- get: () => string;
27
- join: () => Promise<string>;
28
- }
2
+ import type { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
3
+ import type { AgenticaEventBase } from "./AgenticaEventBase";
4
+ export interface AgenticaTextEvent<Role extends "assistant" | "user" = "assistant" | "user"> extends AgenticaEventBase<"text"> {
5
+ role: Role;
6
+ stream: ReadableStream<string>;
7
+ join: () => Promise<string>;
8
+ toJSON: () => IAgenticaEventJson.IText;
9
+ toPrompt: () => AgenticaTextPrompt;
29
10
  }
@@ -1,55 +1,3 @@
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
- exports.AgenticaTextEvent = void 0;
13
- const AgenticaTextPrompt_1 = require("../prompts/AgenticaTextPrompt");
14
- const AgenticaEventBase_1 = require("./AgenticaEventBase");
15
- class AgenticaTextEvent extends AgenticaEventBase_1.AgenticaEventBase {
16
- get text() {
17
- return this.get_();
18
- }
19
- /**
20
- * Check if the join method can return a response immediately.
21
- * Returns true if the response is ready to be returned by the join method.
22
- */
23
- get done() {
24
- return this.done_();
25
- }
26
- constructor(props) {
27
- super("text");
28
- this.role = props.role;
29
- this.stream = props.stream;
30
- this.done_ = props.done;
31
- this.get_ = props.get;
32
- this.join_ = props.join;
33
- }
34
- join() {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- return this.join_();
37
- });
38
- }
39
- toJSON() {
40
- return {
41
- type: "text",
42
- role: this.role,
43
- text: this.text,
44
- done: this.done,
45
- };
46
- }
47
- toPrompt() {
48
- return new AgenticaTextPrompt_1.AgenticaTextPrompt({
49
- role: this.role,
50
- text: this.text,
51
- });
52
- }
53
- }
54
- exports.AgenticaTextEvent = AgenticaTextEvent;
55
3
  //# sourceMappingURL=AgenticaTextEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgenticaTextEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaTextEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sEAAmE;AACnE,2DAAwD;AAExD,MAAa,iBAAkB,SAAQ,qCAAyB;IAG9D,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,YAAmB,KAA+B;QAChD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAE3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;IAC1B,CAAC;IAEY,IAAI;;YACf,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;KAAA;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,uCAAkB,CAAC;YAC5B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;CAKF;AAhDD,8CAgDC"}
1
+ {"version":3,"file":"AgenticaTextEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaTextEvent.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import type { ILlmSchema } from "@samchon/openapi";
2
+ import type { IValidation } from "typia";
3
+ import type { AgenticaEventBase } from "./AgenticaEventBase";
4
+ import type { AgenticaOperation } from "../context/AgenticaOperation";
5
+ import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
6
+ /**
7
+ * Event of a validation feedback.
8
+ *
9
+ * @author Samchon
10
+ */
11
+ export interface AgenticaValidateEvent<Model extends ILlmSchema.Model> extends AgenticaEventBase<"validate"> {
12
+ /**
13
+ * ID of the tool calling.
14
+ */
15
+ id: string;
16
+ /**
17
+ * Target operation to call.
18
+ */
19
+ operation: AgenticaOperation<Model>;
20
+ /**
21
+ * Validation result as a failure.
22
+ */
23
+ result: IValidation.IFailure;
24
+ toJSON: () => IAgenticaEventJson.IValidate;
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AgenticaValidateEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgenticaValidateEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaValidateEvent.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ import type { ILlmSchema, IValidation } from "@samchon/openapi";
2
+ import type OpenAI from "openai";
3
+ import type { AgenticaOperation } from "../context/AgenticaOperation";
4
+ import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
5
+ import type { AgenticaCallEvent } from "../events/AgenticaCallEvent";
6
+ import type { AgenticaCancelEvent } from "../events/AgenticaCancelEvent";
7
+ import type { AgenticaDescribeEvent } from "../events/AgenticaDescribeEvent";
8
+ import type { AgenticaEventSource } from "../events/AgenticaEventSource";
9
+ import type { AgenticaInitializeEvent } from "../events/AgenticaInitializeEvent";
10
+ import type { AgenticaRequestEvent } from "../events/AgenticaRequestEvent";
11
+ import type { AgenticaResponseEvent } from "../events/AgenticaResponseEvent";
12
+ import type { AgenticaTextEvent } from "../events/AgenticaTextEvent";
13
+ import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
14
+ import type { AgenticaExecuteEvent } from "../events/AgenticaExecuteEvent";
15
+ import type { AgenticaSelectEvent } from "../events/AgenticaSelectEvent";
16
+ import type { AgenticaValidateEvent } from "../events/AgenticaValidateEvent";
17
+ export declare function createInitializeEvent(): AgenticaInitializeEvent;
18
+ export declare function createSelectEvent<Model extends ILlmSchema.Model>(props: {
19
+ selection: AgenticaOperationSelection<Model>;
20
+ }): AgenticaSelectEvent<Model>;
21
+ export declare function createCancelEvent<Model extends ILlmSchema.Model>(props: {
22
+ selection: AgenticaOperationSelection<Model>;
23
+ }): AgenticaCancelEvent<Model>;
24
+ export declare function createCallEvent<Model extends ILlmSchema.Model>(props: {
25
+ id: string;
26
+ operation: AgenticaOperation<Model>;
27
+ arguments: Record<string, any>;
28
+ }): AgenticaCallEvent<Model>;
29
+ export declare function createValidateEvent<Model extends ILlmSchema.Model>(props: {
30
+ id: string;
31
+ operation: AgenticaOperation<Model>;
32
+ result: IValidation.IFailure;
33
+ }): AgenticaValidateEvent<Model>;
34
+ export declare function createExecuteEvent<Model extends ILlmSchema.Model>(props: {
35
+ id: string;
36
+ operation: AgenticaOperation<Model>;
37
+ arguments: Record<string, unknown>;
38
+ value: unknown;
39
+ }): AgenticaExecuteEvent<Model>;
40
+ export declare function createTextEvent<Role extends "user" | "assistant">(props: {
41
+ role: Role;
42
+ stream: ReadableStream<string>;
43
+ done: () => boolean;
44
+ get: () => string;
45
+ join: () => Promise<string>;
46
+ }): AgenticaTextEvent<Role>;
47
+ export declare function createDescribeEvent<Model extends ILlmSchema.Model>(props: {
48
+ executes: AgenticaExecutePrompt<Model>[];
49
+ stream: ReadableStream<string>;
50
+ done: () => boolean;
51
+ get: () => string;
52
+ join: () => Promise<string>;
53
+ }): AgenticaDescribeEvent<Model>;
54
+ export declare function createRequestEvent(props: {
55
+ source: AgenticaEventSource;
56
+ body: OpenAI.ChatCompletionCreateParamsStreaming;
57
+ options?: OpenAI.RequestOptions | undefined;
58
+ }): AgenticaRequestEvent;
59
+ export declare function createResponseEvent(props: {
60
+ source: AgenticaEventSource;
61
+ body: OpenAI.ChatCompletionCreateParamsStreaming;
62
+ options?: OpenAI.RequestOptions | undefined;
63
+ stream: ReadableStream<OpenAI.ChatCompletionChunk>;
64
+ join: () => Promise<OpenAI.ChatCompletion>;
65
+ }): AgenticaResponseEvent;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createInitializeEvent = createInitializeEvent;
4
+ exports.createSelectEvent = createSelectEvent;
5
+ exports.createCancelEvent = createCancelEvent;
6
+ exports.createCallEvent = createCallEvent;
7
+ exports.createValidateEvent = createValidateEvent;
8
+ exports.createExecuteEvent = createExecuteEvent;
9
+ exports.createTextEvent = createTextEvent;
10
+ exports.createDescribeEvent = createDescribeEvent;
11
+ exports.createRequestEvent = createRequestEvent;
12
+ exports.createResponseEvent = createResponseEvent;
13
+ const uuid_1 = require("uuid");
14
+ const prompts_1 = require("./prompts");
15
+ /* -----------------------------------------------------------
16
+ FUNCTION SELECTS
17
+ ----------------------------------------------------------- */
18
+ function createInitializeEvent() {
19
+ const event = {
20
+ type: "initialize",
21
+ };
22
+ return {
23
+ type: event.type,
24
+ toJSON: () => event,
25
+ };
26
+ }
27
+ function createSelectEvent(props) {
28
+ return {
29
+ type: "select",
30
+ selection: props.selection,
31
+ toJSON: () => ({
32
+ type: "select",
33
+ selection: props.selection.toJSON(),
34
+ }),
35
+ toPrompt: () => (0, prompts_1.createSelectPrompt)({
36
+ id: (0, uuid_1.v4)(),
37
+ selections: [props.selection],
38
+ }),
39
+ };
40
+ }
41
+ function createCancelEvent(props) {
42
+ return {
43
+ type: "cancel",
44
+ selection: props.selection,
45
+ toJSON: () => ({
46
+ type: "cancel",
47
+ selection: props.selection.toJSON(),
48
+ }),
49
+ };
50
+ }
51
+ /* -----------------------------------------------------------
52
+ FUNCTION CALLS
53
+ ----------------------------------------------------------- */
54
+ function createCallEvent(props) {
55
+ return {
56
+ type: "call",
57
+ id: props.id,
58
+ operation: props.operation,
59
+ arguments: props.arguments,
60
+ toJSON: () => ({
61
+ type: "call",
62
+ id: props.id,
63
+ operation: props.operation.toJSON(),
64
+ arguments: props.arguments,
65
+ }),
66
+ };
67
+ }
68
+ function createValidateEvent(props) {
69
+ return {
70
+ type: "validate",
71
+ id: props.id,
72
+ operation: props.operation,
73
+ result: props.result,
74
+ toJSON: () => ({
75
+ type: "validate",
76
+ id: props.id,
77
+ operation: props.operation.toJSON(),
78
+ result: props.result,
79
+ }),
80
+ };
81
+ }
82
+ function createExecuteEvent(props) {
83
+ return {
84
+ type: "execute",
85
+ protocol: props.operation.protocol,
86
+ id: props.id,
87
+ operation: props.operation,
88
+ arguments: props.arguments,
89
+ value: props.value,
90
+ toJSON: () => ({
91
+ type: "execute",
92
+ protocol: props.operation.protocol,
93
+ id: props.id,
94
+ operation: props.operation.toJSON(),
95
+ arguments: props.arguments,
96
+ value: props.value,
97
+ }),
98
+ toPrompt: () => (0, prompts_1.createExecutePrompt)(props),
99
+ };
100
+ }
101
+ /* -----------------------------------------------------------
102
+ TEXT STEAMING
103
+ ----------------------------------------------------------- */
104
+ function createTextEvent(props) {
105
+ return {
106
+ type: "text",
107
+ role: props.role,
108
+ stream: props.stream,
109
+ join: props.join,
110
+ toJSON: () => ({
111
+ type: "text",
112
+ role: props.role,
113
+ done: props.done(),
114
+ text: props.get(),
115
+ }),
116
+ toPrompt: () => ({
117
+ type: "text",
118
+ role: props.role,
119
+ text: props.get(),
120
+ toJSON: () => ({
121
+ type: "text",
122
+ role: props.role,
123
+ text: props.get(),
124
+ }),
125
+ }),
126
+ };
127
+ }
128
+ function createDescribeEvent(props) {
129
+ return {
130
+ type: "describe",
131
+ executes: props.executes,
132
+ stream: props.stream,
133
+ join: props.join,
134
+ toJSON: () => ({
135
+ type: "describe",
136
+ executes: props.executes.map(execute => execute.toJSON()),
137
+ done: props.done(),
138
+ text: props.get(),
139
+ }),
140
+ toPrompt: () => ({
141
+ type: "describe",
142
+ executes: props.executes,
143
+ text: props.get(),
144
+ toJSON: () => ({
145
+ type: "describe",
146
+ executes: props.executes.map(execute => execute.toJSON()),
147
+ text: props.get(),
148
+ }),
149
+ }),
150
+ };
151
+ }
152
+ /* -----------------------------------------------------------
153
+ API REQUESTS
154
+ ----------------------------------------------------------- */
155
+ function createRequestEvent(props) {
156
+ return {
157
+ type: "request",
158
+ source: props.source,
159
+ body: props.body,
160
+ options: props.options,
161
+ };
162
+ }
163
+ function createResponseEvent(props) {
164
+ return {
165
+ type: "response",
166
+ source: props.source,
167
+ body: props.body,
168
+ options: props.options,
169
+ stream: props.stream,
170
+ join: props.join,
171
+ };
172
+ }
173
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/factory/events.ts"],"names":[],"mappings":";;AAyBA,sDAQC;AAED,8CAeC;AAED,8CAWC;AAKD,0CAiBC;AAED,kDAiBC;AAED,gDAwBC;AAKD,0CA6BC;AAED,kDA6BC;AAKD,gDAWC;AAED,kDAeC;AApOD,+BAA0B;AAoB1B,uCAAoE;AAEpE;;gEAEgE;AAChE,SAAgB,qBAAqB;IACnC,MAAM,KAAK,GAAmC;QAC5C,IAAI,EAAE,YAAY;KACnB,CAAC;IACF,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK;KACpB,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAiC,KAEjE;IACC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YACb,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE;SACpC,CAAC;QACF,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,4BAAkB,EAAC;YACjC,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;SAC9B,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAiC,KAEjE;IACC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,CAA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
2
+ export * from "./operations";
3
+ export * from "./prompts";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./events"), exports);
18
+ __exportStar(require("./operations"), exports);
19
+ __exportStar(require("./prompts"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,4CAA0B"}
@@ -0,0 +1,7 @@
1
+ import type { ILlmSchema } from "@samchon/openapi";
2
+ import type { AgenticaOperation } from "../context/AgenticaOperation";
3
+ import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
4
+ export declare function createOperationSelection<Model extends ILlmSchema.Model>(props: {
5
+ operation: AgenticaOperation<Model>;
6
+ reason: string;
7
+ }): AgenticaOperationSelection<Model>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createOperationSelection = createOperationSelection;
4
+ function createOperationSelection(props) {
5
+ return {
6
+ operation: props.operation,
7
+ reason: props.reason,
8
+ toJSON: () => ({
9
+ operation: props.operation.toJSON(),
10
+ reason: props.reason,
11
+ }),
12
+ };
13
+ }
14
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/factory/operations.ts"],"names":[],"mappings":";;AAIA,4DAYC;AAZD,SAAgB,wBAAwB,CAAiC,KAGxE;IACC,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YACb,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { ILlmSchema } from "@samchon/openapi";
2
+ import type { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
3
+ import type { AgenticaDescribePrompt } from "../prompts/AgenticaDescribePrompt";
4
+ import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
5
+ import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
6
+ import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
7
+ import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
8
+ import type { AgenticaOperation } from "../context/AgenticaOperation";
9
+ export declare function createTextPrompt<Role extends "assistant" | "user" = "assistant" | "user">(props: {
10
+ role: Role;
11
+ text: string;
12
+ }): AgenticaTextPrompt<Role>;
13
+ export declare function createDescribePrompt<Model extends ILlmSchema.Model>(props: {
14
+ executes: AgenticaExecutePrompt<Model>[];
15
+ text: string;
16
+ }): AgenticaDescribePrompt<Model>;
17
+ export declare function createSelectPrompt<Model extends ILlmSchema.Model>(props: {
18
+ id: string;
19
+ selections: AgenticaOperationSelection<Model>[];
20
+ }): AgenticaSelectPrompt<Model>;
21
+ export declare function createCancelPrompt<Model extends ILlmSchema.Model>(props: {
22
+ id: string;
23
+ selections: AgenticaOperationSelection<Model>[];
24
+ }): AgenticaCancelPrompt<Model>;
25
+ export declare function createExecutePrompt<Model extends ILlmSchema.Model>(props: {
26
+ id: string;
27
+ operation: AgenticaOperation<Model>;
28
+ arguments: Record<string, any>;
29
+ value: unknown;
30
+ }): AgenticaExecutePrompt<Model>;