@agentica/core 0.15.5 → 0.15.6
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 +0 -1
- package/lib/Agentica.js +6 -6
- package/lib/Agentica.js.map +1 -1
- package/lib/constants/AgenticaDefaultPrompt.js +1 -1
- package/lib/constants/AgenticaDefaultPrompt.js.map +1 -1
- package/lib/context/internal/AgenticaOperationComposer.d.ts +1 -1
- package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -1
- package/lib/events/AgenticaValidateEvent.d.ts +1 -1
- package/lib/factory/events.d.ts +3 -3
- package/lib/factory/events.js.map +1 -1
- package/lib/factory/operations.js.map +1 -1
- package/lib/factory/prompts.d.ts +6 -6
- package/lib/factory/prompts.js.map +1 -1
- package/lib/functional/assertHttpLlmApplication.js +16 -16
- package/lib/functional/assertHttpLlmApplication.js.map +1 -1
- package/lib/functional/validateHttpLlmApplication.js +13 -13
- package/lib/functional/validateHttpLlmApplication.js.map +1 -1
- package/lib/index.mjs +1714 -1714
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/call.js +2 -2
- package/lib/orchestrate/call.js.map +1 -1
- package/lib/orchestrate/cancel.d.ts +1 -1
- package/lib/orchestrate/cancel.js +2 -2
- package/lib/orchestrate/cancel.js.map +1 -1
- package/lib/orchestrate/describe.d.ts +1 -1
- package/lib/orchestrate/describe.js +3 -3
- package/lib/orchestrate/describe.js.map +1 -1
- package/lib/orchestrate/execute.js +3 -3
- package/lib/orchestrate/execute.js.map +1 -1
- package/lib/orchestrate/initialize.js +21 -21
- package/lib/orchestrate/initialize.js.map +1 -1
- package/lib/orchestrate/internal/cancelFunction.js.map +1 -1
- package/lib/orchestrate/internal/selectFunction.js +1 -1
- package/lib/orchestrate/internal/selectFunction.js.map +1 -1
- package/lib/orchestrate/select.js +4 -4
- package/lib/orchestrate/select.js.map +1 -1
- package/lib/transformers/AgenticaEventTransformer.d.ts +2 -2
- package/lib/transformers/AgenticaEventTransformer.js +1 -1
- package/lib/transformers/AgenticaEventTransformer.js.map +1 -1
- package/lib/transformers/AgenticaPromptTransformer.d.ts +3 -3
- package/lib/transformers/AgenticaPromptTransformer.js +1 -1
- package/lib/transformers/AgenticaPromptTransformer.js.map +1 -1
- package/lib/utils/ChatGptCompletionMessageUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/Agentica.ts +9 -8
- package/src/constants/AgenticaDefaultPrompt.ts +3 -1
- package/src/context/AgenticaCancelPrompt.ts +2 -0
- package/src/context/AgenticaContext.ts +2 -0
- package/src/context/AgenticaOperation.ts +1 -0
- package/src/context/AgenticaOperationCollection.ts +1 -0
- package/src/context/AgenticaOperationSelection.ts +2 -0
- package/src/context/internal/AgenticaOperationComposer.ts +3 -2
- package/src/context/internal/AgenticaTokenUsageAggregator.ts +1 -0
- package/src/events/AgenticaCallEvent.ts +2 -0
- package/src/events/AgenticaCancelEvent.ts +2 -0
- package/src/events/AgenticaDescribeEvent.ts +1 -0
- package/src/events/AgenticaEvent.ts +1 -0
- package/src/events/AgenticaExecuteEvent.ts +2 -0
- package/src/events/AgenticaInitializeEvent.ts +1 -0
- package/src/events/AgenticaSelectEvent.ts +2 -0
- package/src/events/AgenticaTextEvent.ts +1 -0
- package/src/events/AgenticaValidateEvent.ts +3 -1
- package/src/factory/events.ts +6 -5
- package/src/factory/operations.ts +1 -0
- package/src/factory/prompts.ts +7 -6
- package/src/functional/assertHttpLlmApplication.ts +1 -0
- package/src/functional/validateHttpLlmApplication.ts +1 -0
- package/src/json/IAgenticaEventJson.ts +2 -0
- package/src/orchestrate/call.ts +12 -10
- package/src/orchestrate/cancel.ts +9 -7
- package/src/orchestrate/describe.ts +5 -4
- package/src/orchestrate/execute.ts +4 -3
- package/src/orchestrate/initialize.ts +6 -5
- package/src/orchestrate/internal/cancelFunction.ts +2 -1
- package/src/orchestrate/internal/selectFunction.ts +2 -1
- package/src/orchestrate/select.ts +10 -8
- package/src/prompts/AgenticaCancelPrompt.ts +2 -0
- package/src/prompts/AgenticaDescribePrompt.ts +2 -0
- package/src/prompts/AgenticaExecutePrompt.ts +2 -0
- package/src/prompts/AgenticaPrompt.ts +2 -0
- package/src/prompts/AgenticaSelectPrompt.ts +2 -0
- package/src/prompts/AgenticaTextPrompt.ts +1 -0
- package/src/structures/IAgenticaConfig.ts +1 -0
- package/src/structures/IAgenticaProps.ts +1 -0
- package/src/structures/IAgenticaSystemPrompt.ts +1 -0
- package/src/transformers/AgenticaEventTransformer.ts +4 -3
- package/src/transformers/AgenticaPromptTransformer.ts +5 -4
- package/src/utils/ChatGptCompletionMessageUtil.ts +2 -2
package/src/factory/prompts.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type OpenAI from "openai";
|
|
2
1
|
import type { IHttpResponse, ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import type
|
|
2
|
+
import type OpenAI from "openai";
|
|
3
|
+
|
|
4
|
+
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
5
|
+
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
6
|
+
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
4
7
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
5
8
|
import type { AgenticaDescribePrompt } from "../prompts/AgenticaDescribePrompt";
|
|
6
9
|
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
7
|
-
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
8
|
-
import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
|
|
9
|
-
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
10
|
-
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
11
10
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
11
|
+
import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
|
|
12
|
+
import type { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
|
|
12
13
|
|
|
13
14
|
export function decodePrompt<Model extends ILlmSchema.Model>(history: AgenticaPrompt<Model>): OpenAI.ChatCompletionMessageParam[] {
|
|
14
15
|
// NO NEED TO DECODE DESCRIBE
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type OpenAI from "openai";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaEventSource } from "../events/AgenticaEventSource";
|
|
4
|
+
|
|
3
5
|
import type { IAgenticaOperationJson } from "./IAgenticaOperationJson";
|
|
4
6
|
import type { IAgenticaOperationSelectionJson } from "./IAgenticaOperationSelectionJson";
|
|
5
7
|
import type { IAgenticaPromptJson } from "./IAgenticaPromptJson";
|
package/src/orchestrate/call.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatGptTypeChecker,
|
|
3
|
-
HttpLlm,
|
|
4
|
-
} from "@samchon/openapi";
|
|
5
|
-
|
|
6
1
|
import type {
|
|
7
2
|
IChatGptSchema,
|
|
8
3
|
IHttpMigrateRoute,
|
|
@@ -11,22 +6,29 @@ import type {
|
|
|
11
6
|
} from "@samchon/openapi";
|
|
12
7
|
import type OpenAI from "openai";
|
|
13
8
|
import type { IValidation } from "typia";
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
ChatGptTypeChecker,
|
|
12
|
+
HttpLlm,
|
|
13
|
+
} from "@samchon/openapi";
|
|
14
|
+
|
|
15
|
+
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
14
16
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
15
17
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
18
|
+
import type { AgenticaCallEvent } from "../events/AgenticaCallEvent";
|
|
19
|
+
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
16
20
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
17
|
-
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
18
21
|
import type { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
|
|
19
|
-
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
20
|
-
import type { AgenticaCallEvent } from "../events/AgenticaCallEvent";
|
|
21
22
|
|
|
22
23
|
import { AgenticaConstant } from "../constants/AgenticaConstant";
|
|
23
24
|
import { AgenticaDefaultPrompt } from "../constants/AgenticaDefaultPrompt";
|
|
24
25
|
import { AgenticaSystemPrompt } from "../constants/AgenticaSystemPrompt";
|
|
25
|
-
import { StreamUtil } from "../utils/StreamUtil";
|
|
26
|
-
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
27
26
|
import { createCallEvent, createCancelEvent, createExecuteEvent, createTextEvent, createValidateEvent } from "../factory/events";
|
|
28
27
|
import { createOperationSelection } from "../factory/operations";
|
|
29
28
|
import { createCancelPrompt, createExecutePrompt, createTextPrompt, decodePrompt } from "../factory/prompts";
|
|
29
|
+
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
30
|
+
import { StreamUtil } from "../utils/StreamUtil";
|
|
31
|
+
|
|
30
32
|
import { cancelFunction } from "./internal/cancelFunction";
|
|
31
33
|
|
|
32
34
|
export async function call<Model extends ILlmSchema.Model>(ctx: AgenticaContext<Model>): Promise<AgenticaPrompt<Model>[]> {
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import typia from "typia";
|
|
2
|
-
import { v4 } from "uuid";
|
|
3
|
-
|
|
4
1
|
import type { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
5
2
|
import type OpenAI from "openai";
|
|
6
3
|
import type { IValidation } from "typia";
|
|
4
|
+
|
|
5
|
+
import typia from "typia";
|
|
6
|
+
import { v4 } from "uuid";
|
|
7
|
+
|
|
8
|
+
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
7
9
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
8
10
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
11
|
+
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
9
12
|
import type { __IChatCancelFunctionsApplication } from "../context/internal/__IChatCancelFunctionsApplication";
|
|
10
13
|
import type { __IChatFunctionReference } from "../context/internal/__IChatFunctionReference";
|
|
11
14
|
import type { AgenticaEvent } from "../events/AgenticaEvent";
|
|
12
|
-
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
13
|
-
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
14
15
|
|
|
15
16
|
import { AgenticaConstant } from "../constants/AgenticaConstant";
|
|
16
17
|
import { AgenticaDefaultPrompt } from "../constants/AgenticaDefaultPrompt";
|
|
17
18
|
import { AgenticaSystemPrompt } from "../constants/AgenticaSystemPrompt";
|
|
18
|
-
import { StreamUtil } from "../utils/StreamUtil";
|
|
19
|
-
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
20
19
|
import { createCancelPrompt, decodePrompt } from "../factory/prompts";
|
|
20
|
+
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
21
|
+
import { StreamUtil } from "../utils/StreamUtil";
|
|
22
|
+
|
|
21
23
|
import { cancelFunction } from "./internal/cancelFunction";
|
|
22
24
|
|
|
23
25
|
const CONTAINER: ILlmApplication<"chatgpt"> = typia.llm.application<
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
2
|
import type OpenAI from "openai";
|
|
3
|
+
|
|
3
4
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
4
|
-
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
5
5
|
import type { AgenticaDescribePrompt } from "../prompts/AgenticaDescribePrompt";
|
|
6
|
+
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
6
7
|
|
|
7
8
|
import { AgenticaDefaultPrompt } from "../constants/AgenticaDefaultPrompt";
|
|
8
9
|
import { AgenticaSystemPrompt } from "../constants/AgenticaSystemPrompt";
|
|
9
|
-
import { MPSC } from "../utils/MPSC";
|
|
10
|
-
import { StreamUtil } from "../utils/StreamUtil";
|
|
11
|
-
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
12
10
|
import { createDescribeEvent } from "../factory/events";
|
|
13
11
|
import { createDescribePrompt, decodePrompt } from "../factory/prompts";
|
|
12
|
+
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
13
|
+
import { MPSC } from "../utils/MPSC";
|
|
14
|
+
import { StreamUtil } from "../utils/StreamUtil";
|
|
14
15
|
|
|
15
16
|
export async function describe<Model extends ILlmSchema.Model>(ctx: AgenticaContext<Model>, histories: AgenticaExecutePrompt<Model>[]): Promise<AgenticaDescribePrompt<Model>[]> {
|
|
16
17
|
if (histories.length === 0) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
3
4
|
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
4
5
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
5
6
|
import type { IAgenticaExecutor } from "../structures/IAgenticaExecutor";
|
|
6
7
|
|
|
7
|
-
import { describe } from "./describe";
|
|
8
|
-
import { cancel } from "./cancel";
|
|
9
8
|
import { call } from "./call";
|
|
10
|
-
import {
|
|
9
|
+
import { cancel } from "./cancel";
|
|
10
|
+
import { describe } from "./describe";
|
|
11
11
|
import { initialize } from "./initialize";
|
|
12
|
+
import { cancelFunction } from "./internal/cancelFunction";
|
|
12
13
|
import { select } from "./select";
|
|
13
14
|
|
|
14
15
|
export function execute<Model extends ILlmSchema.Model>(executor: Partial<IAgenticaExecutor<Model>> | null) {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import typia from "typia";
|
|
2
|
-
|
|
3
1
|
import type { ILlmFunction, ILlmSchema } from "@samchon/openapi";
|
|
4
2
|
import type OpenAI from "openai";
|
|
3
|
+
|
|
4
|
+
import typia from "typia";
|
|
5
|
+
|
|
5
6
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
6
7
|
import type { __IChatInitialApplication } from "../context/internal/__IChatInitialApplication";
|
|
7
8
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
8
9
|
|
|
9
10
|
import { AgenticaDefaultPrompt } from "../constants/AgenticaDefaultPrompt";
|
|
10
11
|
import { AgenticaSystemPrompt } from "../constants/AgenticaSystemPrompt";
|
|
11
|
-
import { MPSC } from "../utils/MPSC";
|
|
12
|
-
import { StreamUtil } from "../utils/StreamUtil";
|
|
13
|
-
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
14
12
|
import { createTextEvent } from "../factory/events";
|
|
15
13
|
import { createTextPrompt, decodePrompt } from "../factory/prompts";
|
|
14
|
+
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
15
|
+
import { MPSC } from "../utils/MPSC";
|
|
16
|
+
import { StreamUtil } from "../utils/StreamUtil";
|
|
16
17
|
|
|
17
18
|
const FUNCTION: ILlmFunction<"chatgpt"> = typia.llm.application<
|
|
18
19
|
__IChatInitialApplication,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { AgenticaContext } from "../../context/AgenticaContext";
|
|
4
|
+
import type { AgenticaOperationSelection } from "../../context/AgenticaOperationSelection";
|
|
4
5
|
import type { __IChatFunctionReference } from "../../context/internal/__IChatFunctionReference";
|
|
5
6
|
|
|
6
7
|
import { createCancelEvent } from "../../factory/events";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaContext } from "../../context/AgenticaContext";
|
|
3
4
|
import type { AgenticaOperation } from "../../context/AgenticaOperation";
|
|
4
5
|
import type { AgenticaOperationSelection } from "../../context/AgenticaOperationSelection";
|
|
5
6
|
import type { __IChatFunctionReference } from "../../context/internal/__IChatFunctionReference";
|
|
6
7
|
|
|
7
|
-
import { createOperationSelection } from "../../factory/operations";
|
|
8
8
|
import { createSelectEvent } from "../../factory/events";
|
|
9
|
+
import { createOperationSelection } from "../../factory/operations";
|
|
9
10
|
|
|
10
11
|
export async function selectFunction<Model extends ILlmSchema.Model>(ctx: AgenticaContext<Model>, reference: __IChatFunctionReference): Promise<AgenticaOperation<Model> | null> {
|
|
11
12
|
const operation: AgenticaOperation<Model> | undefined
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import typia from "typia";
|
|
2
|
-
import { v4 } from "uuid";
|
|
3
|
-
|
|
4
1
|
import type { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
5
2
|
import type OpenAI from "openai";
|
|
6
3
|
import type { IValidation } from "typia";
|
|
4
|
+
|
|
5
|
+
import typia from "typia";
|
|
6
|
+
import { v4 } from "uuid";
|
|
7
|
+
|
|
7
8
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
8
9
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
10
|
+
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
9
11
|
import type { __IChatFunctionReference } from "../context/internal/__IChatFunctionReference";
|
|
10
12
|
import type { __IChatSelectFunctionsApplication } from "../context/internal/__IChatSelectFunctionsApplication";
|
|
11
13
|
import type { AgenticaEvent } from "../events/AgenticaEvent";
|
|
12
14
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
13
15
|
import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
|
|
14
|
-
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
15
16
|
import type { AgenticaTextPrompt } from "../prompts/AgenticaTextPrompt";
|
|
16
17
|
|
|
17
18
|
import { AgenticaConstant } from "../constants/AgenticaConstant";
|
|
18
19
|
import { AgenticaDefaultPrompt } from "../constants/AgenticaDefaultPrompt";
|
|
19
20
|
import { AgenticaSystemPrompt } from "../constants/AgenticaSystemPrompt";
|
|
20
|
-
import { StreamUtil } from "../utils/StreamUtil";
|
|
21
|
-
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
22
|
-
import { createSelectPrompt, createTextPrompt, decodePrompt } from "../factory/prompts";
|
|
23
|
-
import { createOperationSelection } from "../factory/operations";
|
|
24
21
|
import { createTextEvent } from "../factory/events";
|
|
22
|
+
import { createOperationSelection } from "../factory/operations";
|
|
23
|
+
import { createSelectPrompt, createTextPrompt, decodePrompt } from "../factory/prompts";
|
|
24
|
+
import { ChatGptCompletionMessageUtil } from "../utils/ChatGptCompletionMessageUtil";
|
|
25
|
+
import { StreamUtil } from "../utils/StreamUtil";
|
|
26
|
+
|
|
25
27
|
import { selectFunction } from "./internal/selectFunction";
|
|
26
28
|
|
|
27
29
|
const CONTAINER: ILlmApplication<"chatgpt"> = typia.llm.application<
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
4
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
5
|
+
|
|
4
6
|
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
7
|
|
|
6
8
|
export interface AgenticaCancelPrompt<
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
|
+
|
|
3
5
|
import type { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
4
6
|
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
7
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IHttpResponse, ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
4
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
5
|
+
|
|
4
6
|
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaCancelPrompt } from "../context/AgenticaCancelPrompt";
|
|
4
|
+
|
|
3
5
|
import type { AgenticaDescribePrompt } from "./AgenticaDescribePrompt";
|
|
4
6
|
import type { AgenticaExecutePrompt } from "./AgenticaExecutePrompt";
|
|
5
7
|
import type { AgenticaSelectPrompt } from "./AgenticaSelectPrompt";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaOperationSelection } from "../context/AgenticaOperationSelection";
|
|
3
4
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
5
|
+
|
|
4
6
|
import type { AgenticaPromptBase } from "./AgenticaPromptBase";
|
|
5
7
|
|
|
6
8
|
export interface AgenticaSelectPrompt<
|
|
@@ -2,6 +2,7 @@ import type { ILlmSchema } from "@samchon/openapi";
|
|
|
2
2
|
|
|
3
3
|
import type { AgenticaContext } from "../context/AgenticaContext";
|
|
4
4
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
5
|
+
|
|
5
6
|
import type { IAgenticaExecutor } from "./IAgenticaExecutor";
|
|
6
7
|
import type { IAgenticaSystemPrompt } from "./IAgenticaSystemPrompt";
|
|
7
8
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
2
|
|
|
3
3
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
4
|
+
|
|
4
5
|
import type { IAgenticaConfig } from "./IAgenticaConfig";
|
|
5
6
|
import type { IAgenticaController } from "./IAgenticaController";
|
|
6
7
|
import type { IAgenticaVendor } from "./IAgenticaVendor";
|
|
@@ -2,6 +2,7 @@ import type { ILlmSchema } from "@samchon/openapi";
|
|
|
2
2
|
|
|
3
3
|
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
4
4
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
5
|
+
|
|
5
6
|
import type { IAgenticaConfig } from "./IAgenticaConfig";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
|
-
import type { AgenticaEvent } from "../events/AgenticaEvent";
|
|
4
|
-
import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
|
|
5
4
|
import type { AgenticaCallEvent } from "../events/AgenticaCallEvent";
|
|
6
5
|
import type { AgenticaCancelEvent } from "../events/AgenticaCancelEvent";
|
|
7
6
|
import type { AgenticaDescribeEvent } from "../events/AgenticaDescribeEvent";
|
|
7
|
+
import type { AgenticaEvent } from "../events/AgenticaEvent";
|
|
8
8
|
import type { AgenticaExecuteEvent } from "../events/AgenticaExecuteEvent";
|
|
9
9
|
import type { AgenticaInitializeEvent } from "../events/AgenticaInitializeEvent";
|
|
10
10
|
import type { AgenticaRequestEvent } from "../events/AgenticaRequestEvent";
|
|
11
11
|
import type { AgenticaSelectEvent } from "../events/AgenticaSelectEvent";
|
|
12
12
|
import type { AgenticaTextEvent } from "../events/AgenticaTextEvent";
|
|
13
|
+
import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
|
|
13
14
|
|
|
14
|
-
import { StreamUtil } from "../utils/StreamUtil";
|
|
15
15
|
import { createCallEvent, createCancelEvent, createDescribeEvent, createExecuteEvent, createInitializeEvent, createRequestEvent, createSelectEvent, createTextEvent } from "../factory/events";
|
|
16
16
|
import { createOperationSelection } from "../factory/operations";
|
|
17
|
+
import { StreamUtil } from "../utils/StreamUtil";
|
|
17
18
|
|
|
18
19
|
function findOperation<Model extends ILlmSchema.Model>(props: {
|
|
19
20
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
|
|
2
3
|
import type { AgenticaOperation } from "../context/AgenticaOperation";
|
|
3
4
|
import type { IAgenticaPromptJson } from "../json/IAgenticaPromptJson";
|
|
5
|
+
import type { AgenticaCancelPrompt } from "../prompts/AgenticaCancelPrompt";
|
|
6
|
+
import type { AgenticaDescribePrompt } from "../prompts/AgenticaDescribePrompt";
|
|
7
|
+
import type { AgenticaExecutePrompt } from "../prompts/AgenticaExecutePrompt";
|
|
4
8
|
import type { AgenticaPrompt } from "../prompts/AgenticaPrompt";
|
|
5
9
|
import type { AgenticaSelectPrompt } from "../prompts/AgenticaSelectPrompt";
|
|
6
10
|
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
11
|
|
|
11
|
-
import { createCancelPrompt, createDescribePrompt, createExecutePrompt, createSelectPrompt, createTextPrompt } from "../factory/prompts";
|
|
12
12
|
import { createOperationSelection } from "../factory/operations";
|
|
13
|
+
import { createCancelPrompt, createDescribePrompt, createExecutePrompt, createSelectPrompt, createTextPrompt } from "../factory/prompts";
|
|
13
14
|
|
|
14
15
|
function transform<Model extends ILlmSchema.Model>(props: {
|
|
15
16
|
operations: Map<string, Map<string, AgenticaOperation<Model>>>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { json } from "typia";
|
|
2
|
-
|
|
3
1
|
import type {
|
|
4
2
|
ChatCompletion,
|
|
5
3
|
ChatCompletionChunk,
|
|
@@ -8,6 +6,8 @@ import type {
|
|
|
8
6
|
CompletionUsage,
|
|
9
7
|
} from "openai/resources";
|
|
10
8
|
|
|
9
|
+
import { json } from "typia";
|
|
10
|
+
|
|
11
11
|
import { ByteArrayUtil } from "./ByteArrayUtil";
|
|
12
12
|
import { ChatGptTokenUsageAggregator } from "./ChatGptTokenUsageAggregator";
|
|
13
13
|
|