@agentica/core 0.12.21 → 0.13.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/README.md +50 -47
- package/lib/Agentica.d.ts +9 -9
- package/lib/Agentica.js +23 -16
- package/lib/Agentica.js.map +1 -1
- package/lib/chatgpt/ChatGptAgent.d.ts +7 -7
- package/lib/chatgpt/ChatGptAgent.js +17 -12
- package/lib/chatgpt/ChatGptAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.d.ts +7 -6
- package/lib/chatgpt/ChatGptCallFunctionAgent.js +120 -81
- package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCancelFunctionAgent.d.ts +9 -7
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js +177 -145
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCompletionMessageUtil.d.ts +13 -8
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js +499 -489
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js.map +1 -1
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.d.ts +7 -6
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js +33 -32
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptHistoryDecoder.d.ts +7 -6
- package/lib/chatgpt/ChatGptHistoryDecoder.js +60 -56
- package/lib/chatgpt/ChatGptHistoryDecoder.js.map +1 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.d.ts +7 -6
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js +121 -116
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptSelectFunctionAgent.d.ts +20 -5
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js +183 -150
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptUsageAggregator.d.ts +9 -6
- package/lib/chatgpt/ChatGptUsageAggregator.js +46 -41
- package/lib/chatgpt/ChatGptUsageAggregator.js.map +1 -1
- package/lib/context/AgenticaCancelPrompt.d.ts +3 -3
- package/lib/context/AgenticaCancelPrompt.js +1 -1
- package/lib/context/AgenticaCancelPrompt.js.map +1 -1
- package/lib/context/AgenticaClassOperation.d.ts +1 -1
- package/lib/context/AgenticaClassOperation.js.map +1 -1
- package/lib/context/AgenticaContext.d.ts +9 -9
- package/lib/context/AgenticaHttpOperation.d.ts +1 -1
- package/lib/context/AgenticaHttpOperation.js.map +1 -1
- package/lib/context/AgenticaOperation.d.ts +4 -4
- package/lib/context/AgenticaOperationBase.d.ts +1 -1
- package/lib/context/AgenticaOperationCollection.d.ts +2 -2
- package/lib/context/AgenticaOperationSelection.d.ts +3 -3
- package/lib/context/AgenticaTokenUsage.d.ts +1 -1
- package/lib/context/AgenticaTokenUsage.js.map +1 -1
- package/lib/context/internal/AgenticaTokenUsageAggregator.d.ts +11 -10
- package/lib/context/internal/AgenticaTokenUsageAggregator.js +42 -43
- package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -1
- package/lib/context/internal/__IChatCancelFunctionsApplication.d.ts +2 -2
- package/lib/context/internal/__IChatInitialApplication.d.ts +2 -2
- package/lib/context/internal/__IChatSelectFunctionsApplication.d.ts +2 -2
- package/lib/events/AgenticaCallEvent.d.ts +3 -3
- package/lib/events/AgenticaCancelEvent.d.ts +3 -3
- package/lib/events/AgenticaDescribeEvent.d.ts +3 -3
- package/lib/events/AgenticaDescribeEvent.js +13 -2
- package/lib/events/AgenticaDescribeEvent.js.map +1 -1
- package/lib/events/AgenticaEvent.d.ts +12 -12
- package/lib/events/AgenticaExecuteEvent.d.ts +7 -7
- package/lib/events/AgenticaInitializeEvent.d.ts +1 -1
- package/lib/events/AgenticaRequestEvent.d.ts +3 -3
- package/lib/events/AgenticaRequestEvent.js.map +1 -1
- package/lib/events/AgenticaResponseEvent.d.ts +2 -2
- package/lib/events/AgenticaResponseEvent.js.map +1 -1
- package/lib/events/AgenticaSelectEvent.d.ts +3 -3
- package/lib/events/AgenticaSelectEvent.js.map +1 -1
- package/lib/events/AgenticaTextEvent.d.ts +1 -1
- package/lib/events/AgenticaTextEvent.js +12 -1
- package/lib/events/AgenticaTextEvent.js.map +1 -1
- package/lib/functional/assertHttpLlmApplication.d.ts +4 -3
- package/lib/functional/assertHttpLlmApplication.js +9339 -9338
- package/lib/functional/assertHttpLlmApplication.js.map +1 -1
- package/lib/functional/validateHttpLlmApplication.d.ts +5 -4
- package/lib/functional/validateHttpLlmApplication.js +19 -19
- package/lib/functional/validateHttpLlmApplication.js.map +1 -1
- package/lib/index.d.ts +19 -19
- package/lib/index.js +21 -21
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +19210 -18997
- package/lib/index.mjs.map +1 -1
- package/lib/internal/AgenticaDefaultPrompt.d.ts +6 -5
- package/lib/internal/AgenticaDefaultPrompt.js +39 -19
- package/lib/internal/AgenticaDefaultPrompt.js.map +1 -1
- package/lib/internal/AgenticaOperationComposer.d.ts +11 -10
- package/lib/internal/AgenticaOperationComposer.js +60 -59
- package/lib/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/internal/AgenticaSystemPrompt.d.ts +8 -8
- package/lib/internal/AgenticaSystemPrompt.js +9 -9
- package/lib/internal/AgenticaSystemPrompt.js.map +1 -1
- package/lib/internal/AsyncQueue.d.ts +15 -0
- package/lib/internal/AsyncQueue.js +82 -0
- package/lib/internal/AsyncQueue.js.map +1 -0
- package/lib/internal/ByteArrayUtil.d.ts +1 -1
- package/lib/internal/ByteArrayUtil.js +3 -2
- package/lib/internal/ByteArrayUtil.js.map +1 -1
- package/lib/internal/MPSC.d.ts +10 -0
- package/lib/internal/MPSC.js +49 -0
- package/lib/internal/MPSC.js.map +1 -0
- package/lib/internal/Singleton.js +6 -5
- package/lib/internal/Singleton.js.map +1 -1
- package/lib/internal/StreamUtil.d.ts +16 -6
- package/lib/internal/StreamUtil.js +43 -29
- package/lib/internal/StreamUtil.js.map +1 -1
- package/lib/internal/__map_take.js +5 -5
- package/lib/internal/__map_take.js.map +1 -1
- package/lib/json/IAgenticaEventJson.d.ts +7 -7
- package/lib/json/IAgenticaOperationSelectionJson.d.ts +1 -1
- package/lib/json/IAgenticaPromptJson.d.ts +2 -2
- package/lib/prompts/AgenticaCancelPrompt.d.ts +3 -3
- package/lib/prompts/AgenticaCancelPrompt.js +1 -1
- package/lib/prompts/AgenticaCancelPrompt.js.map +1 -1
- package/lib/prompts/AgenticaDescribePrompt.d.ts +3 -3
- package/lib/prompts/AgenticaDescribePrompt.js +1 -1
- package/lib/prompts/AgenticaDescribePrompt.js.map +1 -1
- package/lib/prompts/AgenticaExecutePrompt.d.ts +5 -5
- package/lib/prompts/AgenticaExecutePrompt.js.map +1 -1
- package/lib/prompts/AgenticaPrompt.d.ts +6 -6
- package/lib/prompts/AgenticaSelectPrompt.d.ts +3 -3
- package/lib/prompts/AgenticaSelectPrompt.js +1 -1
- package/lib/prompts/AgenticaSelectPrompt.js.map +1 -1
- package/lib/prompts/AgenticaTextPrompt.d.ts +1 -1
- package/lib/structures/IAgenticaConfig.d.ts +5 -5
- package/lib/structures/IAgenticaController.d.ts +1 -1
- package/lib/structures/IAgenticaExecutor.d.ts +4 -4
- package/lib/structures/IAgenticaProps.d.ts +5 -5
- package/lib/structures/IAgenticaSystemPrompt.d.ts +4 -4
- package/lib/structures/IAgenticaVendor.d.ts +1 -1
- package/lib/transformers/AgenticaEventTransformer.d.ts +55 -37
- package/lib/transformers/AgenticaEventTransformer.js +105 -58
- package/lib/transformers/AgenticaEventTransformer.js.map +1 -1
- package/lib/transformers/AgenticaPromptTransformer.d.ts +35 -29
- package/lib/transformers/AgenticaPromptTransformer.js +74 -45
- package/lib/transformers/AgenticaPromptTransformer.js.map +1 -1
- package/package.json +20 -23
- package/prompts/cancel.md +1 -1
- package/prompts/common.md +1 -1
- package/prompts/describe.md +1 -1
- package/prompts/execute.md +1 -1
- package/prompts/initialize.md +1 -1
- package/prompts/select.md +1 -1
- package/src/Agentica.ts +41 -31
- package/src/chatgpt/ChatGptAgent.ts +63 -57
- package/src/chatgpt/ChatGptCallFunctionAgent.ts +361 -337
- package/src/chatgpt/ChatGptCancelFunctionAgent.ts +188 -164
- package/src/chatgpt/ChatGptCompletionMessageUtil.ts +136 -137
- package/src/chatgpt/ChatGptDescribeFunctionAgent.ts +105 -101
- package/src/chatgpt/ChatGptHistoryDecoder.ts +69 -65
- package/src/chatgpt/ChatGptInitializeFunctionAgent.ts +128 -123
- package/src/chatgpt/ChatGptSelectFunctionAgent.ts +215 -189
- package/src/chatgpt/ChatGptUsageAggregator.ts +49 -54
- package/src/context/AgenticaCancelPrompt.ts +4 -4
- package/src/context/AgenticaClassOperation.ts +5 -5
- package/src/context/AgenticaContext.ts +15 -15
- package/src/context/AgenticaHttpOperation.ts +5 -5
- package/src/context/AgenticaOperation.ts +4 -4
- package/src/context/AgenticaOperationBase.ts +1 -1
- package/src/context/AgenticaOperationCollection.ts +2 -2
- package/src/context/AgenticaOperationSelection.ts +3 -3
- package/src/context/AgenticaTokenUsage.ts +4 -3
- package/src/context/internal/AgenticaTokenUsageAggregator.ts +59 -59
- package/src/context/internal/__IChatCancelFunctionsApplication.ts +2 -2
- package/src/context/internal/__IChatInitialApplication.ts +2 -2
- package/src/context/internal/__IChatSelectFunctionsApplication.ts +2 -2
- package/src/events/AgenticaCallEvent.ts +3 -3
- package/src/events/AgenticaCancelEvent.ts +3 -3
- package/src/events/AgenticaDescribeEvent.ts +5 -5
- package/src/events/AgenticaEvent.ts +12 -12
- package/src/events/AgenticaExecuteEvent.ts +7 -7
- package/src/events/AgenticaInitializeEvent.ts +1 -1
- package/src/events/AgenticaRequestEvent.ts +3 -3
- package/src/events/AgenticaResponseEvent.ts +2 -2
- package/src/events/AgenticaSelectEvent.ts +4 -4
- package/src/events/AgenticaTextEvent.ts +2 -2
- package/src/functional/assertHttpLlmApplication.ts +9 -6
- package/src/functional/validateHttpLlmApplication.ts +14 -8
- package/src/index.ts +24 -24
- package/src/internal/AgenticaDefaultPrompt.ts +42 -28
- package/src/internal/AgenticaOperationComposer.ts +63 -61
- package/src/internal/AgenticaSystemPrompt.ts +15 -14
- package/src/internal/AsyncQueue.ts +67 -0
- package/src/internal/ByteArrayUtil.ts +2 -2
- package/src/internal/MPSC.ts +40 -0
- package/src/internal/Singleton.ts +8 -6
- package/src/internal/StreamUtil.ts +62 -53
- package/src/internal/__map_take.ts +5 -7
- package/src/json/IAgenticaEventJson.ts +7 -8
- package/src/json/IAgenticaOperationSelectionJson.ts +1 -1
- package/src/json/IAgenticaPromptJson.ts +2 -2
- package/src/prompts/AgenticaCancelPrompt.ts +4 -4
- package/src/prompts/AgenticaDescribePrompt.ts +4 -4
- package/src/prompts/AgenticaExecutePrompt.ts +6 -5
- package/src/prompts/AgenticaPrompt.ts +6 -6
- package/src/prompts/AgenticaSelectPrompt.ts +4 -4
- package/src/prompts/AgenticaTextPrompt.ts +1 -1
- package/src/structures/IAgenticaConfig.ts +5 -5
- package/src/structures/IAgenticaController.ts +14 -14
- package/src/structures/IAgenticaExecutor.ts +4 -4
- package/src/structures/IAgenticaProps.ts +5 -5
- package/src/structures/IAgenticaSystemPrompt.ts +4 -4
- package/src/structures/IAgenticaVendor.ts +1 -1
- package/src/transformers/AgenticaEventTransformer.ts +169 -136
- package/src/transformers/AgenticaPromptTransformer.ts +125 -103
- package/lib/internal/MPSCUtil.d.ts +0 -35
- package/lib/internal/MPSCUtil.js +0 -105
- package/lib/internal/MPSCUtil.js.map +0 -1
- package/src/internal/MPSCUtil.ts +0 -111
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import OpenAI from "openai";
|
|
2
|
-
import { AgenticaEventSource } from "../events/AgenticaEventSource";
|
|
3
|
-
import { IAgenticaOperationJson } from "./IAgenticaOperationJson";
|
|
4
|
-
import { IAgenticaOperationSelectionJson } from "./IAgenticaOperationSelectionJson";
|
|
5
|
-
import { IAgenticaPromptJson } from "./IAgenticaPromptJson";
|
|
1
|
+
import type OpenAI from "openai";
|
|
2
|
+
import type { AgenticaEventSource } from "../events/AgenticaEventSource";
|
|
3
|
+
import type { IAgenticaOperationJson } from "./IAgenticaOperationJson";
|
|
4
|
+
import type { IAgenticaOperationSelectionJson } from "./IAgenticaOperationSelectionJson";
|
|
5
|
+
import type { IAgenticaPromptJson } from "./IAgenticaPromptJson";
|
|
6
6
|
/**
|
|
7
7
|
* Nestia A.I. chatbot event.
|
|
8
8
|
*
|
|
@@ -15,7 +15,7 @@ import { IAgenticaPromptJson } from "./IAgenticaPromptJson";
|
|
|
15
15
|
export type IAgenticaEventJson = IAgenticaEventJson.ICall | IAgenticaEventJson.ICancel | IAgenticaEventJson.IDescribe | IAgenticaEventJson.IExecute | IAgenticaEventJson.IInitialize | IAgenticaEventJson.IRequest | IAgenticaEventJson.ISelect | IAgenticaEventJson.IText;
|
|
16
16
|
export declare namespace IAgenticaEventJson {
|
|
17
17
|
export type Type = IAgenticaEventJson["type"];
|
|
18
|
-
export
|
|
18
|
+
export interface Mapper {
|
|
19
19
|
initialize: IInitialize;
|
|
20
20
|
select: ISelect;
|
|
21
21
|
cancel: ICancel;
|
|
@@ -24,7 +24,7 @@ export declare namespace IAgenticaEventJson {
|
|
|
24
24
|
describe: IDescribe;
|
|
25
25
|
text: IText;
|
|
26
26
|
request: IRequest;
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Event of initializing the chatbot.
|
|
30
30
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAgenticaOperationJson } from "./IAgenticaOperationJson";
|
|
2
|
-
import { IAgenticaOperationSelectionJson } from "./IAgenticaOperationSelectionJson";
|
|
1
|
+
import type { IAgenticaOperationJson } from "./IAgenticaOperationJson";
|
|
2
|
+
import type { IAgenticaOperationSelectionJson } from "./IAgenticaOperationSelectionJson";
|
|
3
3
|
/**
|
|
4
4
|
* Nestia A.I. chatbot prompt.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
|
-
import { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
|
+
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
4
|
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
5
|
export declare class AgenticaCancelPrompt<Model extends ILlmSchema.Model> extends AgenticaPromptBase<"cancel", IAgenticaPromptJson.ICancel> {
|
|
6
6
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaCancelPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaCancelPrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,oBAEX,SAAQ,uCAAyD;IAIjE,YAAmB,KAAyC;QAC1D,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"AgenticaCancelPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaCancelPrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,oBAEX,SAAQ,uCAAyD;IAIjE,YAAmB,KAAyC;QAC1D,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjD,CAAC;IACJ,CAAC;CACF;AAnBD,oDAmBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
3
|
-
import { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
3
|
+
import type { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
4
4
|
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
5
|
export declare class AgenticaDescribePrompt<Model extends ILlmSchema.Model> extends AgenticaPromptBase<"describe", IAgenticaPromptJson.IDescribe> {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaDescribePrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaDescribePrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,sBAEX,SAAQ,uCAA6D;IAarE,YAAmB,KAA2C;QAC5D,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"AgenticaDescribePrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaDescribePrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,sBAEX,SAAQ,uCAA6D;IAarE,YAAmB,KAA2C;QAC5D,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YAC5C,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;CACF;AA5BD,wDA4BC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IHttpResponse, ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
|
-
import { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
1
|
+
import type { IHttpResponse, ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
|
+
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
4
|
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
5
|
export declare class AgenticaExecutePrompt<Model extends ILlmSchema.Model, Protocol extends "http" | "class" = any> extends AgenticaPromptBase<"execute", IAgenticaPromptJson.IExecute> {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly operation: Protocol extends "http" ? AgenticaOperation.Http<Model> : Protocol extends "class" ? AgenticaOperation.Class<Model> : AgenticaOperation<Model>;
|
|
8
|
-
readonly arguments: Record<string,
|
|
9
|
-
readonly value: Protocol extends "http" ? IHttpResponse :
|
|
8
|
+
readonly arguments: Record<string, unknown>;
|
|
9
|
+
readonly value: Protocol extends "http" ? IHttpResponse : unknown;
|
|
10
10
|
constructor(props: AgenticaExecutePrompt.IProps<Model, Protocol>);
|
|
11
11
|
toJSON(): IAgenticaPromptJson.IExecute;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaExecutePrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaExecutePrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,qBAGX,SAAQ,uCAA2D;
|
|
1
|
+
{"version":3,"file":"AgenticaExecutePrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaExecutePrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,qBAGX,SAAQ,uCAA2D;IAWnE,YAAmB,KAAoD;QACrE,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC3B,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YAClC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;AA/BD,sDA+BC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
3
|
-
import { AgenticaDescribePrompt } from "./AgenticaDescribePrompt";
|
|
4
|
-
import { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
5
|
-
import { AgenticaSelectPrompt } from "./AgenticaSelectPrompt";
|
|
6
|
-
import { AgenticaTextPrompt } from "./AgenticaTextPrompt";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
3
|
+
import type { AgenticaDescribePrompt } from "./AgenticaDescribePrompt";
|
|
4
|
+
import type { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
5
|
+
import type { AgenticaSelectPrompt } from "./AgenticaSelectPrompt";
|
|
6
|
+
import type { AgenticaTextPrompt } from "./AgenticaTextPrompt";
|
|
7
7
|
export type AgenticaPrompt<Model extends ILlmSchema.Model> = AgenticaCancelPrompt<Model> | AgenticaDescribePrompt<Model> | AgenticaExecutePrompt<Model> | AgenticaSelectPrompt<Model> | AgenticaTextPrompt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
|
-
import { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
|
+
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
4
|
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
5
|
export declare class AgenticaSelectPrompt<Model extends ILlmSchema.Model> extends AgenticaPromptBase<"select", IAgenticaPromptJson.ISelect> {
|
|
6
6
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaSelectPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaSelectPrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,oBAEX,SAAQ,uCAAyD;IAIjE,YAAmB,KAAyC;QAC1D,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"AgenticaSelectPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaSelectPrompt.ts"],"names":[],"mappings":";;;AAIA,6DAA0D;AAE1D,MAAa,oBAEX,SAAQ,uCAAyD;IAIjE,YAAmB,KAAyC;QAC1D,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjD,CAAC;IACJ,CAAC;CACF;AAnBD,oDAmBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
1
|
+
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
2
2
|
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
3
3
|
export declare class AgenticaTextPrompt<Role extends "assistant" | "user" = "assistant" | "user"> extends AgenticaPromptBase<"text", IAgenticaPromptJson.IText> {
|
|
4
4
|
readonly role: Role;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaContext } from "../context/AgenticaContext";
|
|
3
|
-
import { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
4
|
-
import { IAgenticaExecutor } from "./IAgenticaExecutor";
|
|
5
|
-
import { IAgenticaSystemPrompt } from "./IAgenticaSystemPrompt";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
3
|
+
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
4
|
+
import type { IAgenticaExecutor } from "./IAgenticaExecutor";
|
|
5
|
+
import type { IAgenticaSystemPrompt } from "./IAgenticaSystemPrompt";
|
|
6
6
|
/**
|
|
7
7
|
* Configuration for Nestia Agent.
|
|
8
8
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHttpConnection, IHttpLlmApplication, IHttpLlmFunction, IHttpResponse, ILlmApplication, ILlmFunction, ILlmSchema } from "@samchon/openapi";
|
|
1
|
+
import type { IHttpConnection, IHttpLlmApplication, IHttpLlmFunction, IHttpResponse, ILlmApplication, ILlmFunction, ILlmSchema } from "@samchon/openapi";
|
|
2
2
|
/**
|
|
3
3
|
* Controller of the Nestia Agent.
|
|
4
4
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaContext } from "../context/AgenticaContext";
|
|
3
|
-
import { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
4
|
-
import { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
3
|
+
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
4
|
+
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
5
5
|
/**
|
|
6
6
|
* Executor of the Agentic AI.
|
|
7
7
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
3
|
-
import { IAgenticaConfig } from "./IAgenticaConfig";
|
|
4
|
-
import { IAgenticaController } from "./IAgenticaController";
|
|
5
|
-
import { IAgenticaVendor } from "./IAgenticaVendor";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
3
|
+
import type { IAgenticaConfig } from "./IAgenticaConfig";
|
|
4
|
+
import type { IAgenticaController } from "./IAgenticaController";
|
|
5
|
+
import type { IAgenticaVendor } from "./IAgenticaVendor";
|
|
6
6
|
/**
|
|
7
7
|
* Properties of the Nestia Agent.
|
|
8
8
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
3
|
-
import { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
4
|
-
import { IAgenticaConfig } from "./IAgenticaConfig";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
3
|
+
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
4
|
+
import type { IAgenticaConfig } from "./IAgenticaConfig";
|
|
5
5
|
/**
|
|
6
6
|
* System prompt collection of the A.I. chatbot.
|
|
7
7
|
*
|
|
@@ -1,45 +1,63 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AgenticaOperation } from "../context/AgenticaOperation";
|
|
1
|
+
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
|
+
import type { AgenticaEvent } from "../events/AgenticaEvent";
|
|
4
|
+
import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
|
|
3
5
|
import { AgenticaCallEvent } from "../events/AgenticaCallEvent";
|
|
4
6
|
import { AgenticaCancelEvent } from "../events/AgenticaCancelEvent";
|
|
5
7
|
import { AgenticaDescribeEvent } from "../events/AgenticaDescribeEvent";
|
|
6
|
-
import { AgenticaEvent } from "../events/AgenticaEvent";
|
|
7
8
|
import { AgenticaExecuteEvent } from "../events/AgenticaExecuteEvent";
|
|
8
9
|
import { AgenticaInitializeEvent } from "../events/AgenticaInitializeEvent";
|
|
9
10
|
import { AgenticaRequestEvent } from "../events/AgenticaRequestEvent";
|
|
10
11
|
import { AgenticaSelectEvent } from "../events/AgenticaSelectEvent";
|
|
11
12
|
import { AgenticaTextEvent } from "../events/AgenticaTextEvent";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
13
|
+
declare function findOperation<Model extends ILlmSchema.Model>(props: {
|
|
14
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
15
|
+
input: {
|
|
16
|
+
controller: string;
|
|
17
|
+
function: string;
|
|
18
|
+
};
|
|
19
|
+
}): AgenticaOperation<Model>;
|
|
20
|
+
export declare function transform<Model extends ILlmSchema.Model>(props: {
|
|
21
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
22
|
+
event: IAgenticaEventJson;
|
|
23
|
+
}): AgenticaEvent<Model>;
|
|
24
|
+
export declare function transformCall<Model extends ILlmSchema.Model>(props: {
|
|
25
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
26
|
+
event: IAgenticaEventJson.ICall;
|
|
27
|
+
}): AgenticaCallEvent<Model>;
|
|
28
|
+
export declare function transformCancel<Model extends ILlmSchema.Model>(props: {
|
|
29
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
30
|
+
event: IAgenticaEventJson.ICancel;
|
|
31
|
+
}): AgenticaCancelEvent<Model>;
|
|
32
|
+
export declare function transformDescribe<Model extends ILlmSchema.Model>(props: {
|
|
33
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
34
|
+
event: IAgenticaEventJson.IDescribe;
|
|
35
|
+
}): AgenticaDescribeEvent<Model>;
|
|
36
|
+
export declare function transformExecute<Model extends ILlmSchema.Model>(props: {
|
|
37
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
38
|
+
event: IAgenticaEventJson.IExecute;
|
|
39
|
+
}): AgenticaExecuteEvent<Model>;
|
|
40
|
+
export declare function transformInitialize(): AgenticaInitializeEvent;
|
|
41
|
+
export declare function transformRequest(props: {
|
|
42
|
+
event: IAgenticaEventJson.IRequest;
|
|
43
|
+
}): AgenticaRequestEvent;
|
|
44
|
+
export declare function transformSelect<Model extends ILlmSchema.Model>(props: {
|
|
45
|
+
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
46
|
+
event: IAgenticaEventJson.ISelect;
|
|
47
|
+
}): AgenticaSelectEvent<Model>;
|
|
48
|
+
export declare function transformText(props: {
|
|
49
|
+
event: IAgenticaEventJson.IText;
|
|
50
|
+
}): AgenticaTextEvent;
|
|
51
|
+
export declare const AgenticaEventTransformer: {
|
|
52
|
+
transform: typeof transform;
|
|
53
|
+
transformCall: typeof transformCall;
|
|
54
|
+
transformCancel: typeof transformCancel;
|
|
55
|
+
transformDescribe: typeof transformDescribe;
|
|
56
|
+
transformExecute: typeof transformExecute;
|
|
57
|
+
transformInitialize: typeof transformInitialize;
|
|
58
|
+
transformRequest: typeof transformRequest;
|
|
59
|
+
transformSelect: typeof transformSelect;
|
|
60
|
+
transformText: typeof transformText;
|
|
61
|
+
findOperation: typeof findOperation;
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -10,6 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AgenticaEventTransformer = void 0;
|
|
13
|
+
exports.transform = transform;
|
|
14
|
+
exports.transformCall = transformCall;
|
|
15
|
+
exports.transformCancel = transformCancel;
|
|
16
|
+
exports.transformDescribe = transformDescribe;
|
|
17
|
+
exports.transformExecute = transformExecute;
|
|
18
|
+
exports.transformInitialize = transformInitialize;
|
|
19
|
+
exports.transformRequest = transformRequest;
|
|
20
|
+
exports.transformSelect = transformSelect;
|
|
21
|
+
exports.transformText = transformText;
|
|
13
22
|
const AgenticaOperationSelection_1 = require("../context/AgenticaOperationSelection");
|
|
14
23
|
const AgenticaCallEvent_1 = require("../events/AgenticaCallEvent");
|
|
15
24
|
const AgenticaCancelEvent_1 = require("../events/AgenticaCancelEvent");
|
|
@@ -20,48 +29,65 @@ const AgenticaRequestEvent_1 = require("../events/AgenticaRequestEvent");
|
|
|
20
29
|
const AgenticaSelectEvent_1 = require("../events/AgenticaSelectEvent");
|
|
21
30
|
const AgenticaTextEvent_1 = require("../events/AgenticaTextEvent");
|
|
22
31
|
const StreamUtil_1 = require("../internal/StreamUtil");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
32
|
+
function findOperation(props) {
|
|
33
|
+
var _a;
|
|
34
|
+
const found = (_a = props.operations
|
|
35
|
+
.get(props.input.controller)) === null || _a === void 0 ? void 0 : _a.get(props.input.function);
|
|
36
|
+
if (found === undefined) {
|
|
37
|
+
throw new Error(`No operation found: (controller: ${props.input.controller}, function: ${props.input.function})`);
|
|
38
|
+
}
|
|
39
|
+
return found;
|
|
40
|
+
}
|
|
41
|
+
function transform(props) {
|
|
42
|
+
if (props.event.type === "call") {
|
|
43
|
+
return transformCall({
|
|
44
|
+
operations: props.operations,
|
|
45
|
+
event: props.event,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else if (props.event.type === "cancel") {
|
|
49
|
+
return transformCancel({
|
|
50
|
+
operations: props.operations,
|
|
51
|
+
event: props.event,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else if (props.event.type === "describe") {
|
|
55
|
+
return transformDescribe({
|
|
56
|
+
operations: props.operations,
|
|
57
|
+
event: props.event,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else if (props.event.type === "execute") {
|
|
61
|
+
return transformExecute({
|
|
62
|
+
operations: props.operations,
|
|
63
|
+
event: props.event,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else if (props.event.type === "initialize") {
|
|
67
|
+
return transformInitialize();
|
|
68
|
+
}
|
|
69
|
+
else if (props.event.type === "request") {
|
|
70
|
+
return transformRequest({
|
|
71
|
+
event: props.event,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else if (props.event.type === "select") {
|
|
75
|
+
return transformSelect({
|
|
76
|
+
operations: props.operations,
|
|
77
|
+
event: props.event,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else if (props.event.type === "text") {
|
|
81
|
+
return transformText({
|
|
82
|
+
event: props.event,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
throw new Error("Unknown event type");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function transformCall(props) {
|
|
90
|
+
return new AgenticaCallEvent_1.AgenticaCallEvent({
|
|
65
91
|
id: props.event.id,
|
|
66
92
|
operation: findOperation({
|
|
67
93
|
operations: props.operations,
|
|
@@ -69,7 +95,9 @@ var AgenticaEventTransformer;
|
|
|
69
95
|
}),
|
|
70
96
|
arguments: props.event.arguments,
|
|
71
97
|
});
|
|
72
|
-
|
|
98
|
+
}
|
|
99
|
+
function transformCancel(props) {
|
|
100
|
+
return new AgenticaCancelEvent_1.AgenticaCancelEvent({
|
|
73
101
|
selection: new AgenticaOperationSelection_1.AgenticaOperationSelection({
|
|
74
102
|
operation: findOperation({
|
|
75
103
|
operations: props.operations,
|
|
@@ -78,8 +106,10 @@ var AgenticaEventTransformer;
|
|
|
78
106
|
reason: props.event.selection.reason,
|
|
79
107
|
}),
|
|
80
108
|
});
|
|
81
|
-
|
|
82
|
-
|
|
109
|
+
}
|
|
110
|
+
function transformDescribe(props) {
|
|
111
|
+
return new AgenticaDescribeEvent_1.AgenticaDescribeEvent({
|
|
112
|
+
executes: props.event.executes.map(next => transformExecute({
|
|
83
113
|
operations: props.operations,
|
|
84
114
|
event: next,
|
|
85
115
|
})),
|
|
@@ -88,18 +118,29 @@ var AgenticaEventTransformer;
|
|
|
88
118
|
get: () => props.event.text,
|
|
89
119
|
join: () => __awaiter(this, void 0, void 0, function* () { return props.event.text; }),
|
|
90
120
|
});
|
|
91
|
-
|
|
121
|
+
}
|
|
122
|
+
function transformExecute(props) {
|
|
123
|
+
return new AgenticaExecuteEvent_1.AgenticaExecuteEvent({
|
|
92
124
|
id: props.event.id,
|
|
93
125
|
operation: findOperation({
|
|
94
126
|
operations: props.operations,
|
|
95
127
|
input: props.event.operation,
|
|
96
128
|
}),
|
|
129
|
+
/**
|
|
130
|
+
* @TODO remove `as`
|
|
131
|
+
*/
|
|
97
132
|
arguments: props.event.arguments,
|
|
98
133
|
value: props.event.value,
|
|
99
134
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
135
|
+
}
|
|
136
|
+
function transformInitialize() {
|
|
137
|
+
return new AgenticaInitializeEvent_1.AgenticaInitializeEvent();
|
|
138
|
+
}
|
|
139
|
+
function transformRequest(props) {
|
|
140
|
+
return new AgenticaRequestEvent_1.AgenticaRequestEvent(props.event);
|
|
141
|
+
}
|
|
142
|
+
function transformSelect(props) {
|
|
143
|
+
return new AgenticaSelectEvent_1.AgenticaSelectEvent({
|
|
103
144
|
selection: new AgenticaOperationSelection_1.AgenticaOperationSelection({
|
|
104
145
|
operation: findOperation({
|
|
105
146
|
operations: props.operations,
|
|
@@ -108,20 +149,26 @@ var AgenticaEventTransformer;
|
|
|
108
149
|
reason: props.event.selection.reason,
|
|
109
150
|
}),
|
|
110
151
|
});
|
|
111
|
-
|
|
152
|
+
}
|
|
153
|
+
function transformText(props) {
|
|
154
|
+
return new AgenticaTextEvent_1.AgenticaTextEvent({
|
|
112
155
|
role: props.event.role,
|
|
113
156
|
stream: StreamUtil_1.StreamUtil.to(props.event.text),
|
|
114
157
|
done: () => true,
|
|
115
158
|
get: () => props.event.text,
|
|
116
159
|
join: () => __awaiter(this, void 0, void 0, function* () { return props.event.text; }),
|
|
117
160
|
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
161
|
+
}
|
|
162
|
+
exports.AgenticaEventTransformer = {
|
|
163
|
+
transform,
|
|
164
|
+
transformCall,
|
|
165
|
+
transformCancel,
|
|
166
|
+
transformDescribe,
|
|
167
|
+
transformExecute,
|
|
168
|
+
transformInitialize,
|
|
169
|
+
transformRequest,
|
|
170
|
+
transformSelect,
|
|
171
|
+
transformText,
|
|
172
|
+
findOperation,
|
|
126
173
|
};
|
|
127
174
|
//# sourceMappingURL=AgenticaEventTransformer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaEventTransformer.js","sourceRoot":"","sources":["../../src/transformers/AgenticaEventTransformer.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AgenticaEventTransformer.js","sourceRoot":"","sources":["../../src/transformers/AgenticaEventTransformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAkCA,8BAgDC;AAED,sCAYC;AAED,0CAaC;AAED,8CAgBC;AAED,4CAgBC;AAED,kDAEC;AAED,4CAIC;AAED,0CAaC;AAED,sCAUC;AAnLD,sFAAmF;AACnF,mEAAgE;AAChE,uEAAoE;AACpE,2EAAwE;AACxE,yEAAsE;AACtE,+EAA4E;AAC5E,yEAAsE;AACtE,uEAAoE;AACpE,mEAAgE;AAChE,uDAAoD;AAEpD,SAAS,aAAa,CAAiC,KAMtD;;IACC,MAAM,KAAK,GAAyC,MAAA,KAAK,CAAC,UAAU;SACjE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,0CAC1B,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,oCAAoC,KAAK,CAAC,KAAK,CAAC,UAAU,eAAe,KAAK,CAAC,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