@agentica/core 0.13.4 → 0.14.0
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/Agentica.js +8 -10
- package/lib/Agentica.js.map +1 -1
- package/lib/context/AgenticaCancelPrompt.d.ts +4 -12
- package/lib/context/AgenticaCancelPrompt.js +0 -17
- package/lib/context/AgenticaCancelPrompt.js.map +1 -1
- package/lib/context/AgenticaOperationSelection.d.ts +4 -11
- package/lib/context/AgenticaOperationSelection.js +0 -14
- package/lib/context/AgenticaOperationSelection.js.map +1 -1
- package/lib/context/AgenticaTokenUsage.js.map +1 -1
- package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -1
- package/lib/events/AgenticaCallEvent.d.ts +23 -13
- package/lib/events/AgenticaCallEvent.js +0 -19
- package/lib/events/AgenticaCallEvent.js.map +1 -1
- package/lib/events/AgenticaCancelEvent.d.ts +4 -10
- package/lib/events/AgenticaCancelEvent.js +0 -15
- package/lib/events/AgenticaCancelEvent.js.map +1 -1
- package/lib/events/AgenticaDescribeEvent.d.ts +8 -27
- package/lib/events/AgenticaDescribeEvent.js +0 -52
- package/lib/events/AgenticaDescribeEvent.js.map +1 -1
- package/lib/events/AgenticaEvent.d.ts +13 -1
- package/lib/events/AgenticaEventBase.d.ts +5 -3
- package/lib/events/AgenticaEventBase.js +0 -7
- package/lib/events/AgenticaEventBase.js.map +1 -1
- package/lib/events/AgenticaExecuteEvent.d.ts +15 -15
- package/lib/events/AgenticaExecuteEvent.js +0 -30
- package/lib/events/AgenticaExecuteEvent.js.map +1 -1
- package/lib/events/AgenticaInitializeEvent.d.ts +3 -4
- package/lib/events/AgenticaInitializeEvent.js +0 -13
- package/lib/events/AgenticaInitializeEvent.js.map +1 -1
- package/lib/events/AgenticaRequestEvent.d.ts +5 -24
- package/lib/events/AgenticaRequestEvent.js +0 -19
- package/lib/events/AgenticaRequestEvent.js.map +1 -1
- package/lib/events/AgenticaResponseEvent.d.ts +22 -32
- package/lib/events/AgenticaResponseEvent.js +0 -13
- package/lib/events/AgenticaResponseEvent.js.map +1 -1
- package/lib/events/AgenticaSelectEvent.d.ts +6 -12
- package/lib/events/AgenticaSelectEvent.js +0 -23
- package/lib/events/AgenticaSelectEvent.js.map +1 -1
- package/lib/events/AgenticaTextEvent.d.ts +8 -27
- package/lib/events/AgenticaTextEvent.js +0 -52
- package/lib/events/AgenticaTextEvent.js.map +1 -1
- package/lib/events/AgenticaValidateEvent.d.ts +25 -0
- package/lib/events/AgenticaValidateEvent.js +3 -0
- package/lib/events/AgenticaValidateEvent.js.map +1 -0
- package/lib/factory/events.d.ts +65 -0
- package/lib/factory/events.js +173 -0
- package/lib/factory/events.js.map +1 -0
- package/lib/factory/index.d.ts +3 -0
- package/lib/factory/index.js +20 -0
- package/lib/factory/index.js.map +1 -0
- package/lib/factory/operations.d.ts +7 -0
- package/lib/factory/operations.js +14 -0
- package/lib/factory/operations.js.map +1 -0
- package/lib/factory/prompts.d.ts +30 -0
- package/lib/factory/prompts.js +76 -0
- package/lib/factory/prompts.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +25 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +328 -347
- package/lib/index.mjs.map +1 -1
- package/lib/json/IAgenticaEventJson.d.ts +4 -2
- package/lib/json/IAgenticaPromptJson.d.ts +1 -1
- package/lib/orchestrate/ChatGptAgent.js.map +1 -0
- package/lib/{chatgpt → orchestrate}/ChatGptCallFunctionAgent.d.ts +2 -1
- package/lib/{chatgpt → orchestrate}/ChatGptCallFunctionAgent.js +33 -28
- package/lib/orchestrate/ChatGptCallFunctionAgent.js.map +1 -0
- package/lib/orchestrate/ChatGptCancelFunctionAgent.d.ts +12 -0
- package/lib/{chatgpt → orchestrate}/ChatGptCancelFunctionAgent.js +7 -9
- package/lib/orchestrate/ChatGptCancelFunctionAgent.js.map +1 -0
- package/lib/orchestrate/ChatGptCompletionMessageUtil.d.ts +14 -0
- package/lib/{chatgpt → orchestrate}/ChatGptCompletionMessageUtil.js +0 -5
- package/lib/orchestrate/ChatGptCompletionMessageUtil.js.map +1 -0
- package/lib/{chatgpt → orchestrate}/ChatGptDescribeFunctionAgent.d.ts +3 -2
- package/lib/{chatgpt → orchestrate}/ChatGptDescribeFunctionAgent.js +4 -5
- package/lib/orchestrate/ChatGptDescribeFunctionAgent.js.map +1 -0
- package/lib/{chatgpt → orchestrate}/ChatGptHistoryDecoder.d.ts +2 -1
- package/lib/{chatgpt → orchestrate}/ChatGptHistoryDecoder.js +0 -1
- package/lib/orchestrate/ChatGptHistoryDecoder.js.map +1 -0
- package/lib/{chatgpt → orchestrate}/ChatGptInitializeFunctionAgent.d.ts +2 -1
- package/lib/{chatgpt → orchestrate}/ChatGptInitializeFunctionAgent.js +4 -5
- package/lib/orchestrate/ChatGptInitializeFunctionAgent.js.map +1 -0
- package/lib/{chatgpt → orchestrate}/ChatGptSelectFunctionAgent.d.ts +1 -1
- package/lib/{chatgpt → orchestrate}/ChatGptSelectFunctionAgent.js +10 -13
- package/lib/orchestrate/ChatGptSelectFunctionAgent.js.map +1 -0
- package/lib/orchestrate/ChatGptUsageAggregator.d.ts +10 -0
- package/lib/{chatgpt → orchestrate}/ChatGptUsageAggregator.js +0 -3
- package/lib/orchestrate/ChatGptUsageAggregator.js.map +1 -0
- package/lib/orchestrate/index.d.ts +8 -0
- package/lib/orchestrate/index.js +25 -0
- package/lib/orchestrate/index.js.map +1 -0
- package/lib/prompts/AgenticaCancelPrompt.d.ts +4 -12
- package/lib/prompts/AgenticaCancelPrompt.js +0 -17
- package/lib/prompts/AgenticaCancelPrompt.js.map +1 -1
- package/lib/prompts/AgenticaDescribePrompt.d.ts +4 -12
- package/lib/prompts/AgenticaDescribePrompt.js +0 -17
- package/lib/prompts/AgenticaDescribePrompt.js.map +1 -1
- package/lib/prompts/AgenticaExecutePrompt.d.ts +42 -13
- package/lib/prompts/AgenticaExecutePrompt.js +0 -21
- package/lib/prompts/AgenticaExecutePrompt.js.map +1 -1
- package/lib/prompts/AgenticaPrompt.d.ts +10 -0
- package/lib/prompts/AgenticaPromptBase.d.ts +5 -6
- package/lib/prompts/AgenticaPromptBase.js +0 -19
- package/lib/prompts/AgenticaPromptBase.js.map +1 -1
- package/lib/prompts/AgenticaSelectPrompt.d.ts +4 -12
- package/lib/prompts/AgenticaSelectPrompt.js +0 -17
- package/lib/prompts/AgenticaSelectPrompt.js.map +1 -1
- package/lib/prompts/AgenticaTextPrompt.d.ts +4 -12
- package/lib/prompts/AgenticaTextPrompt.js +0 -17
- package/lib/prompts/AgenticaTextPrompt.js.map +1 -1
- package/lib/transformers/AgenticaEventTransformer.d.ts +16 -16
- package/lib/transformers/AgenticaEventTransformer.js +12 -30
- package/lib/transformers/AgenticaEventTransformer.js.map +1 -1
- package/lib/transformers/AgenticaPromptTransformer.d.ts +12 -11
- package/lib/transformers/AgenticaPromptTransformer.js +9 -19
- package/lib/transformers/AgenticaPromptTransformer.js.map +1 -1
- package/package.json +3 -3
- package/src/Agentica.ts +11 -11
- package/src/context/AgenticaCancelPrompt.ts +4 -25
- package/src/context/AgenticaContext.ts +0 -1
- package/src/context/AgenticaOperation.ts +0 -1
- package/src/context/AgenticaOperationCollection.ts +0 -1
- package/src/context/AgenticaOperationSelection.ts +4 -22
- package/src/context/AgenticaTokenUsage.ts +2 -2
- package/src/context/internal/AgenticaTokenUsageAggregator.ts +0 -1
- package/src/events/AgenticaCallEvent.ts +26 -29
- package/src/events/AgenticaCancelEvent.ts +4 -21
- package/src/events/AgenticaDescribeEvent.ts +8 -57
- package/src/events/AgenticaEvent.ts +14 -2
- package/src/events/AgenticaEventBase.ts +5 -6
- package/src/events/AgenticaExecuteEvent.ts +33 -41
- package/src/events/AgenticaInitializeEvent.ts +3 -11
- package/src/events/AgenticaRequestEvent.ts +5 -40
- package/src/events/AgenticaResponseEvent.ts +22 -39
- package/src/events/AgenticaSelectEvent.ts +6 -30
- package/src/events/AgenticaTextEvent.ts +11 -60
- package/src/events/AgenticaValidateEvent.ts +31 -0
- package/src/factory/events.ts +229 -0
- package/src/factory/index.ts +3 -0
- package/src/factory/operations.ts +17 -0
- package/src/factory/prompts.ts +104 -0
- package/src/index.ts +5 -6
- package/src/json/IAgenticaEventJson.ts +5 -3
- package/src/json/IAgenticaPromptJson.ts +1 -1
- package/src/{chatgpt → orchestrate}/ChatGptCallFunctionAgent.ts +62 -50
- package/src/{chatgpt → orchestrate}/ChatGptCancelFunctionAgent.ts +18 -16
- package/src/{chatgpt → orchestrate}/ChatGptCompletionMessageUtil.ts +7 -6
- package/src/{chatgpt → orchestrate}/ChatGptDescribeFunctionAgent.ts +7 -6
- package/src/{chatgpt → orchestrate}/ChatGptHistoryDecoder.ts +1 -2
- package/src/{chatgpt → orchestrate}/ChatGptInitializeFunctionAgent.ts +8 -7
- package/src/{chatgpt → orchestrate}/ChatGptSelectFunctionAgent.ts +18 -16
- package/src/{chatgpt → orchestrate}/ChatGptUsageAggregator.ts +3 -3
- package/src/orchestrate/index.ts +8 -0
- package/src/prompts/AgenticaCancelPrompt.ts +4 -25
- package/src/prompts/AgenticaDescribePrompt.ts +4 -25
- package/src/prompts/AgenticaExecutePrompt.ts +52 -44
- package/src/prompts/AgenticaPrompt.ts +10 -1
- package/src/prompts/AgenticaPromptBase.ts +5 -9
- package/src/prompts/AgenticaSelectPrompt.ts +4 -25
- package/src/prompts/AgenticaTextPrompt.ts +4 -26
- package/src/transformers/AgenticaEventTransformer.ts +30 -32
- package/src/transformers/AgenticaPromptTransformer.ts +22 -22
- package/lib/chatgpt/ChatGptAgent.js.map +0 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +0 -1
- package/lib/chatgpt/ChatGptCancelFunctionAgent.d.ts +0 -11
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js.map +0 -1
- package/lib/chatgpt/ChatGptCompletionMessageUtil.d.ts +0 -13
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js.map +0 -1
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js.map +0 -1
- package/lib/chatgpt/ChatGptHistoryDecoder.js.map +0 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js.map +0 -1
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js.map +0 -1
- package/lib/chatgpt/ChatGptUsageAggregator.d.ts +0 -9
- package/lib/chatgpt/ChatGptUsageAggregator.js.map +0 -1
- package/lib/context/AgenticaClassOperation.d.ts +0 -8
- package/lib/context/AgenticaClassOperation.js +0 -11
- package/lib/context/AgenticaClassOperation.js.map +0 -1
- package/lib/context/AgenticaHttpOperation.d.ts +0 -8
- package/lib/context/AgenticaHttpOperation.js +0 -11
- package/lib/context/AgenticaHttpOperation.js.map +0 -1
- package/lib/context/AgenticaOperationBase.d.ts +0 -29
- package/lib/context/AgenticaOperationBase.js +0 -21
- package/lib/context/AgenticaOperationBase.js.map +0 -1
- package/src/context/AgenticaClassOperation.ts +0 -23
- package/src/context/AgenticaHttpOperation.ts +0 -27
- package/src/context/AgenticaOperationBase.ts +0 -57
- package/lib/{chatgpt → orchestrate}/ChatGptAgent.d.ts +0 -0
- package/lib/{chatgpt → orchestrate}/ChatGptAgent.js +0 -0
- package/src/{chatgpt → orchestrate}/ChatGptAgent.ts +1 -1
|
@@ -1,20 +1,49 @@
|
|
|
1
1
|
import type { IHttpResponse, ILlmSchema } from "@samchon/openapi";
|
|
2
2
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
3
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
|
-
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
toJSON(): IAgenticaPromptJson.IExecute;
|
|
12
|
-
}
|
|
4
|
+
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
|
+
/**
|
|
6
|
+
* Execute prompt.
|
|
7
|
+
*
|
|
8
|
+
* @author Samchon
|
|
9
|
+
*/
|
|
10
|
+
export type AgenticaExecutePrompt<Model extends ILlmSchema.Model> = AgenticaExecutePrompt.Class<Model> | AgenticaExecutePrompt.Http<Model>;
|
|
13
11
|
export declare namespace AgenticaExecutePrompt {
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Class protocol case.
|
|
14
|
+
*/
|
|
15
|
+
export interface Class<Model extends ILlmSchema.Model> extends Base<"class", AgenticaOperation.Class<Model>, unknown> {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* HTTP protocol case.
|
|
19
|
+
*/
|
|
20
|
+
export interface Http<Model extends ILlmSchema.Model> extends Base<"http", AgenticaOperation.Http<Model>, IHttpResponse> {
|
|
21
|
+
}
|
|
22
|
+
interface Base<Protocol extends "http" | "class", Operation extends AgenticaOperation<any>, Value> extends AgenticaPromptBase<"execute", IAgenticaPromptJson.IExecute> {
|
|
23
|
+
/**
|
|
24
|
+
* ID of the LLM tool call result.
|
|
25
|
+
*/
|
|
15
26
|
id: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Protocol of the operation.
|
|
29
|
+
*/
|
|
30
|
+
protocol: Protocol;
|
|
31
|
+
/**
|
|
32
|
+
* Target operation that has been called.
|
|
33
|
+
*/
|
|
34
|
+
operation: Operation;
|
|
35
|
+
/**
|
|
36
|
+
* Arguments of the function calling.
|
|
37
|
+
*/
|
|
38
|
+
arguments: Record<string, unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* Return value.
|
|
41
|
+
*
|
|
42
|
+
* If the protocol is "class", the return value of the class function.
|
|
43
|
+
*
|
|
44
|
+
* Otherwise "http", the return value is an HTTP response.
|
|
45
|
+
*/
|
|
46
|
+
value: Value;
|
|
19
47
|
}
|
|
48
|
+
export {};
|
|
20
49
|
}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgenticaExecutePrompt = void 0;
|
|
4
|
-
const AgenticaPromptBase_1 = require("./AgenticaPromptBase");
|
|
5
|
-
class AgenticaExecutePrompt extends AgenticaPromptBase_1.AgenticaPromptBase {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super("execute");
|
|
8
|
-
this.id = props.id;
|
|
9
|
-
this.operation = props.operation;
|
|
10
|
-
this.arguments = props.arguments;
|
|
11
|
-
this.value = props.value;
|
|
12
|
-
}
|
|
13
|
-
toJSON() {
|
|
14
|
-
return {
|
|
15
|
-
type: this.type,
|
|
16
|
-
id: this.id,
|
|
17
|
-
operation: this.operation.toJSON(),
|
|
18
|
-
arguments: this.arguments,
|
|
19
|
-
value: this.value,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.AgenticaExecutePrompt = AgenticaExecutePrompt;
|
|
24
3
|
//# sourceMappingURL=AgenticaExecutePrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaExecutePrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaExecutePrompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgenticaExecutePrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaExecutePrompt.ts"],"names":[],"mappings":""}
|
|
@@ -5,3 +5,13 @@ import type { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
|
5
5
|
import type { AgenticaSelectPrompt } from "./AgenticaSelectPrompt";
|
|
6
6
|
import type { AgenticaTextPrompt } from "./AgenticaTextPrompt";
|
|
7
7
|
export type AgenticaPrompt<Model extends ILlmSchema.Model> = AgenticaCancelPrompt<Model> | AgenticaDescribePrompt<Model> | AgenticaExecutePrompt<Model> | AgenticaSelectPrompt<Model> | AgenticaTextPrompt;
|
|
8
|
+
export declare namespace AgenticaPrompt {
|
|
9
|
+
type Type = AgenticaPrompt<any>["type"];
|
|
10
|
+
interface Mapper<Model extends ILlmSchema.Model> {
|
|
11
|
+
cancel: AgenticaCancelPrompt<Model>;
|
|
12
|
+
describe: AgenticaDescribePrompt<Model>;
|
|
13
|
+
execute: AgenticaExecutePrompt<Model>;
|
|
14
|
+
select: AgenticaSelectPrompt<Model>;
|
|
15
|
+
text: AgenticaTextPrompt;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Base
|
|
2
|
+
* Base type for all prompts in Agentica.
|
|
3
3
|
*
|
|
4
|
-
* `AgenticaPromptBase` is a base
|
|
4
|
+
* `AgenticaPromptBase` is a base type for every prompt types
|
|
5
5
|
* in Agentica. It is generated by {@link Agentica.conversate} function,
|
|
6
6
|
* and used for restoring the previous conversation history when
|
|
7
7
|
* constructing the {@link Agentica} instance.
|
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
* @template Json Primitive type of the prompt
|
|
11
11
|
* @author Samchon
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export interface AgenticaPromptBase<Type extends string, Json extends {
|
|
14
14
|
type: Type;
|
|
15
15
|
}> {
|
|
16
16
|
/**
|
|
17
17
|
* Discriminator type.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
abstract toJSON(): Json;
|
|
19
|
+
type: Type;
|
|
20
|
+
toJSON: () => Json;
|
|
22
21
|
}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgenticaPromptBase = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Base class for all prompts in Agentica.
|
|
6
|
-
*
|
|
7
|
-
* `AgenticaPromptBase` is a base class for every prompt classes
|
|
8
|
-
* in Agentica. It is generated by {@link Agentica.conversate} function,
|
|
9
|
-
* and used for restoring the previous conversation history when
|
|
10
|
-
* constructing the {@link Agentica} instance.
|
|
11
|
-
*
|
|
12
|
-
* @template Type Discriminator type
|
|
13
|
-
* @template Json Primitive type of the prompt
|
|
14
|
-
* @author Samchon
|
|
15
|
-
*/
|
|
16
|
-
class AgenticaPromptBase {
|
|
17
|
-
constructor(type) {
|
|
18
|
-
this.type = type;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.AgenticaPromptBase = AgenticaPromptBase;
|
|
22
3
|
//# sourceMappingURL=AgenticaPromptBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaPromptBase.js","sourceRoot":"","sources":["../../src/prompts/AgenticaPromptBase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgenticaPromptBase.js","sourceRoot":"","sources":["../../src/prompts/AgenticaPromptBase.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
2
|
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
3
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
|
-
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
constructor(props: AgenticaSelectPrompt.IProps<Model>);
|
|
9
|
-
toJSON(): IAgenticaPromptJson.ISelect;
|
|
10
|
-
}
|
|
11
|
-
export declare namespace AgenticaSelectPrompt {
|
|
12
|
-
interface IProps<Model extends ILlmSchema.Model> {
|
|
13
|
-
id: string;
|
|
14
|
-
selections: AgenticaOperationSelection<Model>[];
|
|
15
|
-
}
|
|
4
|
+
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
|
+
export interface AgenticaSelectPrompt<Model extends ILlmSchema.Model> extends AgenticaPromptBase<"select", IAgenticaPromptJson.ISelect> {
|
|
6
|
+
id: string;
|
|
7
|
+
selections: AgenticaOperationSelection<Model>[];
|
|
16
8
|
}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgenticaSelectPrompt = void 0;
|
|
4
|
-
const AgenticaPromptBase_1 = require("./AgenticaPromptBase");
|
|
5
|
-
class AgenticaSelectPrompt extends AgenticaPromptBase_1.AgenticaPromptBase {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super("select");
|
|
8
|
-
this.id = props.id;
|
|
9
|
-
this.selections = props.selections;
|
|
10
|
-
}
|
|
11
|
-
toJSON() {
|
|
12
|
-
return {
|
|
13
|
-
type: this.type,
|
|
14
|
-
id: this.id,
|
|
15
|
-
selections: this.selections.map(s => s.toJSON()),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.AgenticaSelectPrompt = AgenticaSelectPrompt;
|
|
20
3
|
//# sourceMappingURL=AgenticaSelectPrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaSelectPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaSelectPrompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgenticaSelectPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaSelectPrompt.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
2
|
-
import { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(props: AgenticaTextPrompt.IProps<Role>);
|
|
7
|
-
toJSON(): IAgenticaPromptJson.IText<Role>;
|
|
8
|
-
}
|
|
9
|
-
export declare namespace AgenticaTextPrompt {
|
|
10
|
-
interface IProps<Role extends "assistant" | "user" = "assistant" | "user"> {
|
|
11
|
-
role: Role;
|
|
12
|
-
text: string;
|
|
13
|
-
}
|
|
2
|
+
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
3
|
+
export interface AgenticaTextPrompt<Role extends "assistant" | "user" = "assistant" | "user"> extends AgenticaPromptBase<"text", IAgenticaPromptJson.IText> {
|
|
4
|
+
role: Role;
|
|
5
|
+
text: string;
|
|
14
6
|
}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgenticaTextPrompt = void 0;
|
|
4
|
-
const AgenticaPromptBase_1 = require("./AgenticaPromptBase");
|
|
5
|
-
class AgenticaTextPrompt extends AgenticaPromptBase_1.AgenticaPromptBase {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super("text");
|
|
8
|
-
this.role = props.role;
|
|
9
|
-
this.text = props.text;
|
|
10
|
-
}
|
|
11
|
-
toJSON() {
|
|
12
|
-
return {
|
|
13
|
-
type: this.type,
|
|
14
|
-
role: this.role,
|
|
15
|
-
text: this.text,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.AgenticaTextPrompt = AgenticaTextPrompt;
|
|
20
3
|
//# sourceMappingURL=AgenticaTextPrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaTextPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaTextPrompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgenticaTextPrompt.js","sourceRoot":"","sources":["../../src/prompts/AgenticaTextPrompt.ts"],"names":[],"mappings":""}
|
|
@@ -2,14 +2,14 @@ import type { ILlmSchema } from "@samchon/openapi";
|
|
|
2
2
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
3
|
import type { AgenticaEvent } from "../events/AgenticaEvent";
|
|
4
4
|
import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
|
|
5
|
-
import { AgenticaCallEvent } from "../events/AgenticaCallEvent";
|
|
6
|
-
import { AgenticaCancelEvent } from "../events/AgenticaCancelEvent";
|
|
7
|
-
import { AgenticaDescribeEvent } from "../events/AgenticaDescribeEvent";
|
|
8
|
-
import { AgenticaExecuteEvent } from "../events/AgenticaExecuteEvent";
|
|
9
|
-
import { AgenticaInitializeEvent } from "../events/AgenticaInitializeEvent";
|
|
10
|
-
import { AgenticaRequestEvent } from "../events/AgenticaRequestEvent";
|
|
11
|
-
import { AgenticaSelectEvent } from "../events/AgenticaSelectEvent";
|
|
12
|
-
import { AgenticaTextEvent } from "../events/AgenticaTextEvent";
|
|
5
|
+
import type { AgenticaCallEvent } from "../events/AgenticaCallEvent";
|
|
6
|
+
import type { AgenticaCancelEvent } from "../events/AgenticaCancelEvent";
|
|
7
|
+
import type { AgenticaDescribeEvent } from "../events/AgenticaDescribeEvent";
|
|
8
|
+
import type { AgenticaExecuteEvent } from "../events/AgenticaExecuteEvent";
|
|
9
|
+
import type { AgenticaInitializeEvent } from "../events/AgenticaInitializeEvent";
|
|
10
|
+
import type { AgenticaRequestEvent } from "../events/AgenticaRequestEvent";
|
|
11
|
+
import type { AgenticaSelectEvent } from "../events/AgenticaSelectEvent";
|
|
12
|
+
import type { AgenticaTextEvent } from "../events/AgenticaTextEvent";
|
|
13
13
|
declare function findOperation<Model extends ILlmSchema.Model>(props: {
|
|
14
14
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
15
15
|
input: {
|
|
@@ -17,11 +17,11 @@ declare function findOperation<Model extends ILlmSchema.Model>(props: {
|
|
|
17
17
|
function: string;
|
|
18
18
|
};
|
|
19
19
|
}): AgenticaOperation<Model>;
|
|
20
|
-
|
|
20
|
+
declare function transform<Model extends ILlmSchema.Model>(props: {
|
|
21
21
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
22
22
|
event: IAgenticaEventJson;
|
|
23
23
|
}): AgenticaEvent<Model>;
|
|
24
|
-
|
|
24
|
+
declare function transformCall<Model extends ILlmSchema.Model>(props: {
|
|
25
25
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
26
26
|
event: IAgenticaEventJson.ICall;
|
|
27
27
|
}): AgenticaCallEvent<Model>;
|
|
@@ -29,23 +29,23 @@ export declare function transformCancel<Model extends ILlmSchema.Model>(props: {
|
|
|
29
29
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
30
30
|
event: IAgenticaEventJson.ICancel;
|
|
31
31
|
}): AgenticaCancelEvent<Model>;
|
|
32
|
-
|
|
32
|
+
declare function transformDescribe<Model extends ILlmSchema.Model>(props: {
|
|
33
33
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
34
34
|
event: IAgenticaEventJson.IDescribe;
|
|
35
35
|
}): AgenticaDescribeEvent<Model>;
|
|
36
|
-
|
|
36
|
+
declare function transformExecute<Model extends ILlmSchema.Model>(props: {
|
|
37
37
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
38
38
|
event: IAgenticaEventJson.IExecute;
|
|
39
39
|
}): AgenticaExecuteEvent<Model>;
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
declare function transformInitialize(): AgenticaInitializeEvent;
|
|
41
|
+
declare function transformRequest(props: {
|
|
42
42
|
event: IAgenticaEventJson.IRequest;
|
|
43
43
|
}): AgenticaRequestEvent;
|
|
44
|
-
|
|
44
|
+
declare function transformSelect<Model extends ILlmSchema.Model>(props: {
|
|
45
45
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
46
46
|
event: IAgenticaEventJson.ISelect;
|
|
47
47
|
}): AgenticaSelectEvent<Model>;
|
|
48
|
-
|
|
48
|
+
declare function transformText(props: {
|
|
49
49
|
event: IAgenticaEventJson.IText;
|
|
50
50
|
}): AgenticaTextEvent;
|
|
51
51
|
export declare const AgenticaEventTransformer: {
|
|
@@ -10,25 +10,10 @@ 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
13
|
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;
|
|
22
|
-
const AgenticaOperationSelection_1 = require("../context/AgenticaOperationSelection");
|
|
23
|
-
const AgenticaCallEvent_1 = require("../events/AgenticaCallEvent");
|
|
24
|
-
const AgenticaCancelEvent_1 = require("../events/AgenticaCancelEvent");
|
|
25
|
-
const AgenticaDescribeEvent_1 = require("../events/AgenticaDescribeEvent");
|
|
26
|
-
const AgenticaExecuteEvent_1 = require("../events/AgenticaExecuteEvent");
|
|
27
|
-
const AgenticaInitializeEvent_1 = require("../events/AgenticaInitializeEvent");
|
|
28
|
-
const AgenticaRequestEvent_1 = require("../events/AgenticaRequestEvent");
|
|
29
|
-
const AgenticaSelectEvent_1 = require("../events/AgenticaSelectEvent");
|
|
30
|
-
const AgenticaTextEvent_1 = require("../events/AgenticaTextEvent");
|
|
31
14
|
const StreamUtil_1 = require("../internal/StreamUtil");
|
|
15
|
+
const events_1 = require("../factory/events");
|
|
16
|
+
const operations_1 = require("../factory/operations");
|
|
32
17
|
function findOperation(props) {
|
|
33
18
|
var _a;
|
|
34
19
|
const found = (_a = props.operations
|
|
@@ -87,7 +72,7 @@ function transform(props) {
|
|
|
87
72
|
}
|
|
88
73
|
}
|
|
89
74
|
function transformCall(props) {
|
|
90
|
-
return
|
|
75
|
+
return (0, events_1.createCallEvent)({
|
|
91
76
|
id: props.event.id,
|
|
92
77
|
operation: findOperation({
|
|
93
78
|
operations: props.operations,
|
|
@@ -97,8 +82,8 @@ function transformCall(props) {
|
|
|
97
82
|
});
|
|
98
83
|
}
|
|
99
84
|
function transformCancel(props) {
|
|
100
|
-
return
|
|
101
|
-
selection:
|
|
85
|
+
return (0, events_1.createCancelEvent)({
|
|
86
|
+
selection: (0, operations_1.createOperationSelection)({
|
|
102
87
|
operation: findOperation({
|
|
103
88
|
operations: props.operations,
|
|
104
89
|
input: props.event.selection.operation,
|
|
@@ -108,7 +93,7 @@ function transformCancel(props) {
|
|
|
108
93
|
});
|
|
109
94
|
}
|
|
110
95
|
function transformDescribe(props) {
|
|
111
|
-
return
|
|
96
|
+
return (0, events_1.createDescribeEvent)({
|
|
112
97
|
executes: props.event.executes.map(next => transformExecute({
|
|
113
98
|
operations: props.operations,
|
|
114
99
|
event: next,
|
|
@@ -120,28 +105,25 @@ function transformDescribe(props) {
|
|
|
120
105
|
});
|
|
121
106
|
}
|
|
122
107
|
function transformExecute(props) {
|
|
123
|
-
return
|
|
108
|
+
return (0, events_1.createExecuteEvent)({
|
|
124
109
|
id: props.event.id,
|
|
125
110
|
operation: findOperation({
|
|
126
111
|
operations: props.operations,
|
|
127
112
|
input: props.event.operation,
|
|
128
113
|
}),
|
|
129
|
-
/**
|
|
130
|
-
* @TODO remove `as`
|
|
131
|
-
*/
|
|
132
114
|
arguments: props.event.arguments,
|
|
133
115
|
value: props.event.value,
|
|
134
116
|
});
|
|
135
117
|
}
|
|
136
118
|
function transformInitialize() {
|
|
137
|
-
return
|
|
119
|
+
return (0, events_1.createInitializeEvent)();
|
|
138
120
|
}
|
|
139
121
|
function transformRequest(props) {
|
|
140
|
-
return
|
|
122
|
+
return (0, events_1.createRequestEvent)(props.event);
|
|
141
123
|
}
|
|
142
124
|
function transformSelect(props) {
|
|
143
|
-
return
|
|
144
|
-
selection:
|
|
125
|
+
return (0, events_1.createSelectEvent)({
|
|
126
|
+
selection: (0, operations_1.createOperationSelection)({
|
|
145
127
|
operation: findOperation({
|
|
146
128
|
operations: props.operations,
|
|
147
129
|
input: props.event.selection.operation,
|
|
@@ -151,7 +133,7 @@ function transformSelect(props) {
|
|
|
151
133
|
});
|
|
152
134
|
}
|
|
153
135
|
function transformText(props) {
|
|
154
|
-
return
|
|
136
|
+
return (0, events_1.createTextEvent)({
|
|
155
137
|
role: props.event.role,
|
|
156
138
|
stream: StreamUtil_1.StreamUtil.to(props.event.text),
|
|
157
139
|
done: () => true,
|
|
@@ -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":";;;;;;;;;;;;AAmGA,0CAaC;AAnGD,uDAAoD;AACpD,8CAA+L;AAC/L,sDAAiE;AAEjE,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,KAAK,CAAC,QAAQ,GAAG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAiC,KAGlD;IACC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAChC,OAAO,aAAa,CAAC;YACnB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC;IACL,CAAC;SACI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,eAAe,CAAC;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC;IACL,CAAC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ACnB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,aAAa;CACd,CAAC"}
|
|
@@ -2,31 +2,31 @@ import type { ILlmSchema } from "@samchon/openapi";
|
|
|
2
2
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
3
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
4
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
|
|
6
|
+
import type { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
|
|
7
|
+
import type { AgenticaCancelPrompt } from "../prompts/AgenticaCancelPrompt";
|
|
8
|
+
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
9
|
+
import type { AgenticaDescribePrompt } from "../prompts/AgenticaDescribePrompt";
|
|
10
|
+
declare function transform<Model extends ILlmSchema.Model>(props: {
|
|
11
11
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
12
12
|
prompt: IAgenticaPromptJson;
|
|
13
13
|
}): AgenticaPrompt<Model>;
|
|
14
|
-
|
|
14
|
+
declare function transformText(props: {
|
|
15
15
|
prompt: IAgenticaPromptJson.IText;
|
|
16
16
|
}): AgenticaTextPrompt;
|
|
17
|
-
|
|
17
|
+
declare function transformSelect<Model extends ILlmSchema.Model>(props: {
|
|
18
18
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
19
19
|
prompt: IAgenticaPromptJson.ISelect;
|
|
20
20
|
}): AgenticaSelectPrompt<Model>;
|
|
21
|
-
|
|
21
|
+
declare function transformCancel<Model extends ILlmSchema.Model>(props: {
|
|
22
22
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
23
23
|
prompt: IAgenticaPromptJson.ICancel;
|
|
24
24
|
}): AgenticaCancelPrompt<Model>;
|
|
25
|
-
|
|
25
|
+
declare function transformExecute<Model extends ILlmSchema.Model>(props: {
|
|
26
26
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
27
27
|
prompt: IAgenticaPromptJson.IExecute;
|
|
28
28
|
}): AgenticaExecutePrompt<Model>;
|
|
29
|
-
|
|
29
|
+
declare function transformDescribe<Model extends ILlmSchema.Model>(props: {
|
|
30
30
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
31
31
|
prompt: IAgenticaPromptJson.IDescribe;
|
|
32
32
|
}): AgenticaDescribePrompt<Model>;
|
|
@@ -38,3 +38,4 @@ export declare const AgenticaPromptTransformer: {
|
|
|
38
38
|
transformExecute: typeof transformExecute;
|
|
39
39
|
transformDescribe: typeof transformDescribe;
|
|
40
40
|
};
|
|
41
|
+
export {};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgenticaPromptTransformer = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.transformSelect = transformSelect;
|
|
7
|
-
exports.transformCancel = transformCancel;
|
|
8
|
-
exports.transformExecute = transformExecute;
|
|
9
|
-
exports.transformDescribe = transformDescribe;
|
|
10
|
-
const AgenticaOperationSelection_1 = require("../context/AgenticaOperationSelection");
|
|
11
|
-
const AgenticaCancelPrompt_1 = require("../prompts/AgenticaCancelPrompt");
|
|
12
|
-
const AgenticaDescribePrompt_1 = require("../prompts/AgenticaDescribePrompt");
|
|
13
|
-
const AgenticaExecutePrompt_1 = require("../prompts/AgenticaExecutePrompt");
|
|
14
|
-
const AgenticaSelectPrompt_1 = require("../prompts/AgenticaSelectPrompt");
|
|
15
|
-
const AgenticaTextPrompt_1 = require("../prompts/AgenticaTextPrompt");
|
|
4
|
+
const prompts_1 = require("../factory/prompts");
|
|
5
|
+
const operations_1 = require("../factory/operations");
|
|
16
6
|
function transform(props) {
|
|
17
7
|
// TEXT
|
|
18
8
|
if (props.prompt.type === "text") {
|
|
@@ -49,12 +39,12 @@ function transform(props) {
|
|
|
49
39
|
throw new Error("Invalid prompt type.");
|
|
50
40
|
}
|
|
51
41
|
function transformText(props) {
|
|
52
|
-
return
|
|
42
|
+
return (0, prompts_1.createTextPrompt)(props.prompt);
|
|
53
43
|
}
|
|
54
44
|
function transformSelect(props) {
|
|
55
|
-
return
|
|
45
|
+
return (0, prompts_1.createSelectPrompt)({
|
|
56
46
|
id: props.prompt.id,
|
|
57
|
-
selections: props.prompt.selections.map(select =>
|
|
47
|
+
selections: props.prompt.selections.map(select => (0, operations_1.createOperationSelection)({
|
|
58
48
|
operation: findOperation({
|
|
59
49
|
operations: props.operations,
|
|
60
50
|
input: select.operation,
|
|
@@ -64,9 +54,9 @@ function transformSelect(props) {
|
|
|
64
54
|
});
|
|
65
55
|
}
|
|
66
56
|
function transformCancel(props) {
|
|
67
|
-
return
|
|
57
|
+
return (0, prompts_1.createCancelPrompt)({
|
|
68
58
|
id: props.prompt.id,
|
|
69
|
-
selections: props.prompt.selections.map(select =>
|
|
59
|
+
selections: props.prompt.selections.map(select => (0, operations_1.createOperationSelection)({
|
|
70
60
|
operation: findOperation({
|
|
71
61
|
operations: props.operations,
|
|
72
62
|
input: select.operation,
|
|
@@ -76,7 +66,7 @@ function transformCancel(props) {
|
|
|
76
66
|
});
|
|
77
67
|
}
|
|
78
68
|
function transformExecute(props) {
|
|
79
|
-
return
|
|
69
|
+
return (0, prompts_1.createExecutePrompt)({
|
|
80
70
|
id: props.prompt.id,
|
|
81
71
|
operation: findOperation({
|
|
82
72
|
operations: props.operations,
|
|
@@ -91,7 +81,7 @@ function transformExecute(props) {
|
|
|
91
81
|
});
|
|
92
82
|
}
|
|
93
83
|
function transformDescribe(props) {
|
|
94
|
-
return
|
|
84
|
+
return (0, prompts_1.createDescribePrompt)({
|
|
95
85
|
text: props.prompt.text,
|
|
96
86
|
executes: props.prompt.executes.map(next => transformExecute({
|
|
97
87
|
operations: props.operations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgenticaPromptTransformer.js","sourceRoot":"","sources":["../../src/transformers/AgenticaPromptTransformer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AgenticaPromptTransformer.js","sourceRoot":"","sources":["../../src/transformers/AgenticaPromptTransformer.ts"],"names":[],"mappings":";;;AAUA,gDAAyI;AACzI,sDAAiE;AAEjE,SAAS,SAAS,CAAiC,KAGlD;IACC,OAAO;IACP,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,aAAa,CAAC;YACnB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IACD,kBAAkB;SACb,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,eAAe,CAAC;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;SACI,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,eAAe,CAAC;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IACD,UAAU;SACL,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,gBAAgB,CAAC;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;SACI,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC1C,OAAO,iBAAiB,CAAC;YACvB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,MAAM,EAA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C5B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;SAC9B,CAAC;QACF,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;QACjC;;;WAGG;QACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAgC;KACrD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAiC,KAG1D;IACC,OAAO,IAAA,8BAAoB,EAAC;QAC1B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;QACvB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACzC,gBAAgB,CAAC;YACf,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,MAAM,EAAE,IAAI;SACb,CAAC,CACH;KACF,CAAC,CAAC;AACL,CAAC;AAED,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,KAAK,CAAC,QAAQ,GAAG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAEY,QAAA,yBAAyB,GAAG;IACvC,SAAS;IACT,aAAa;IACb,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,iBAAiB;CAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentica/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Agentic AI Library specialized in LLM Function Calling",
|
|
5
5
|
"author": "Wrtn Technologies",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"typia": ">=8.1.0 <9.0.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@samchon/openapi": "^3.2.
|
|
45
|
-
"typia": "^8.1.
|
|
44
|
+
"@samchon/openapi": "^3.2.3",
|
|
45
|
+
"typia": "^8.1.1",
|
|
46
46
|
"uuid": "^11.0.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|