@agentica/core 0.10.4 → 0.11.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/lib/Agentica.d.ts +14 -14
- package/lib/Agentica.js +54 -31
- package/lib/Agentica.js.map +1 -1
- package/lib/chatgpt/ChatGptAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptAgent.js +1 -1
- package/lib/chatgpt/ChatGptAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptCallFunctionAgent.js +61 -63
- package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCancelFunctionAgent.d.ts +6 -6
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js +28 -30
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCompletionMessageUtil.d.ts +8 -0
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js +536 -0
- package/lib/chatgpt/ChatGptCompletionMessageUtil.js.map +1 -0
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.d.ts +4 -3
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js +56 -6
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptHistoryDecoder.d.ts +2 -2
- package/lib/chatgpt/ChatGptHistoryDecoder.js +8 -8
- package/lib/chatgpt/ChatGptHistoryDecoder.js.map +1 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js +11 -5
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptSelectFunctionAgent.d.ts +3 -3
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js +39 -42
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptUsageAggregator.d.ts +6 -0
- package/lib/chatgpt/ChatGptUsageAggregator.js +48 -0
- package/lib/chatgpt/ChatGptUsageAggregator.js.map +1 -0
- package/lib/context/AgenticaCancelPrompt.d.ts +16 -0
- package/lib/context/AgenticaCancelPrompt.js +20 -0
- package/lib/context/AgenticaCancelPrompt.js.map +1 -0
- package/lib/context/AgenticaClassOperation.d.ts +8 -0
- package/lib/context/AgenticaClassOperation.js +11 -0
- package/lib/context/AgenticaClassOperation.js.map +1 -0
- package/lib/{structures/IAgenticaContext.d.ts → context/AgenticaContext.d.ts} +15 -14
- package/lib/{structures/IAgenticaPrompt.js → context/AgenticaContext.js} +1 -1
- package/lib/context/AgenticaContext.js.map +1 -0
- package/lib/context/AgenticaHttpOperation.d.ts +8 -0
- package/lib/context/AgenticaHttpOperation.js +11 -0
- package/lib/context/AgenticaHttpOperation.js.map +1 -0
- package/lib/context/AgenticaOperation.d.ts +46 -0
- package/lib/{structures/IAgenticaContext.js → context/AgenticaOperation.js} +1 -1
- package/lib/context/AgenticaOperation.js.map +1 -0
- package/lib/context/AgenticaOperationBase.d.ts +29 -0
- package/lib/context/AgenticaOperationBase.js +21 -0
- package/lib/context/AgenticaOperationBase.js.map +1 -0
- package/lib/{structures/IAgenticaOperationCollection.d.ts → context/AgenticaOperationCollection.d.ts} +6 -6
- package/lib/{structures/IAgenticaOperationSelection.js → context/AgenticaOperationCollection.js} +1 -1
- package/lib/context/AgenticaOperationCollection.js.map +1 -0
- package/lib/context/AgenticaOperationSelection.d.ts +15 -0
- package/lib/context/AgenticaOperationSelection.js +17 -0
- package/lib/context/AgenticaOperationSelection.js.map +1 -0
- package/lib/context/AgenticaTokenUsage.d.ts +82 -0
- package/lib/context/AgenticaTokenUsage.js +97 -0
- package/lib/context/AgenticaTokenUsage.js.map +1 -0
- package/lib/context/internal/AgenticaTokenUsageAggregator.d.ts +10 -0
- package/lib/{internal → context/internal}/AgenticaTokenUsageAggregator.js +0 -46
- package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -0
- package/lib/context/internal/__IChatCancelFunctionsApplication.js.map +1 -0
- package/lib/context/internal/__IChatFunctionReference.js.map +1 -0
- package/lib/context/internal/__IChatInitialApplication.js.map +1 -0
- package/lib/context/internal/__IChatSelectFunctionsApplication.js.map +1 -0
- package/lib/events/AgenticaCallEvent.d.ts +18 -0
- package/lib/events/AgenticaCallEvent.js +22 -0
- package/lib/events/AgenticaCallEvent.js.map +1 -0
- package/lib/events/AgenticaCancelEvent.d.ts +14 -0
- package/lib/events/AgenticaCancelEvent.js +18 -0
- package/lib/events/AgenticaCancelEvent.js.map +1 -0
- package/lib/events/AgenticaDescribeEvent.d.ts +27 -0
- package/lib/events/AgenticaDescribeEvent.js +40 -0
- package/lib/events/AgenticaDescribeEvent.js.map +1 -0
- package/lib/events/AgenticaEvent.d.ts +25 -0
- package/lib/{structures/IAgenticaEvent.js → events/AgenticaEvent.js} +1 -1
- package/lib/events/AgenticaEvent.js.map +1 -0
- package/lib/events/AgenticaEventBase.d.ts +4 -0
- package/lib/events/AgenticaEventBase.js +10 -0
- package/lib/events/AgenticaEventBase.js.map +1 -0
- package/lib/events/AgenticaEventSource.d.ts +1 -0
- package/lib/events/AgenticaEventSource.js +3 -0
- package/lib/events/AgenticaEventSource.js.map +1 -0
- package/lib/events/AgenticaExecuteEvent.d.ts +22 -0
- package/lib/events/AgenticaExecuteEvent.js +33 -0
- package/lib/events/AgenticaExecuteEvent.js.map +1 -0
- package/lib/events/AgenticaInitializeEvent.d.ts +6 -0
- package/lib/events/AgenticaInitializeEvent.js +16 -0
- package/lib/events/AgenticaInitializeEvent.js.map +1 -0
- package/lib/events/AgenticaRequestEvent.d.ts +27 -0
- package/lib/events/AgenticaRequestEvent.js +22 -0
- package/lib/events/AgenticaRequestEvent.js.map +1 -0
- package/lib/events/AgenticaResponseEvent.d.ts +35 -0
- package/lib/events/AgenticaResponseEvent.js +16 -0
- package/lib/events/AgenticaResponseEvent.js.map +1 -0
- package/lib/events/AgenticaSelectEvent.d.ts +16 -0
- package/lib/events/AgenticaSelectEvent.js +26 -0
- package/lib/events/AgenticaSelectEvent.js.map +1 -0
- package/lib/events/AgenticaTextEvent.d.ts +25 -0
- package/lib/events/AgenticaTextEvent.js +40 -0
- package/lib/events/AgenticaTextEvent.js.map +1 -0
- package/lib/index.d.ts +26 -8
- package/lib/index.js +29 -9
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1391 -306
- package/lib/index.mjs.map +1 -1
- package/lib/internal/AgenticaOperationComposer.d.ts +2 -2
- package/lib/internal/AgenticaOperationComposer.js +12 -0
- package/lib/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/internal/ByteArrayUtil.d.ts +3 -0
- package/lib/internal/ByteArrayUtil.js +10 -0
- package/lib/internal/ByteArrayUtil.js.map +1 -0
- package/lib/internal/MPSCUtil.d.ts +21 -0
- package/lib/internal/MPSCUtil.js +84 -0
- package/lib/internal/MPSCUtil.js.map +1 -0
- package/lib/internal/StreamUtil.d.ts +6 -0
- package/lib/internal/StreamUtil.js +65 -0
- package/lib/internal/StreamUtil.js.map +1 -0
- package/lib/json/IAgenticaEventJson.d.ts +149 -0
- package/lib/{structures/IAgenticaOperation.js → json/IAgenticaEventJson.js} +1 -1
- package/lib/json/IAgenticaEventJson.js.map +1 -0
- package/lib/json/IAgenticaOperationJson.d.ts +33 -0
- package/lib/json/IAgenticaOperationJson.js +3 -0
- package/lib/json/IAgenticaOperationJson.js.map +1 -0
- package/lib/json/IAgenticaOperationSelectionJson.d.ts +18 -0
- package/lib/{structures/IAgenticaOperationCollection.js → json/IAgenticaOperationSelectionJson.js} +1 -1
- package/lib/json/IAgenticaOperationSelectionJson.js.map +1 -0
- package/lib/json/IAgenticaPromptJson.d.ts +111 -0
- package/lib/json/IAgenticaPromptJson.js +3 -0
- package/lib/json/IAgenticaPromptJson.js.map +1 -0
- package/lib/{structures/IAgenticaTokenUsage.d.ts → json/IAgenticaTokenUsageJson.d.ts} +10 -10
- package/lib/json/IAgenticaTokenUsageJson.js +3 -0
- package/lib/json/IAgenticaTokenUsageJson.js.map +1 -0
- package/lib/prompts/AgenticaCancelPrompt.d.ts +16 -0
- package/lib/prompts/AgenticaCancelPrompt.js +20 -0
- package/lib/prompts/AgenticaCancelPrompt.js.map +1 -0
- package/lib/prompts/AgenticaDescribePrompt.d.ts +24 -0
- package/lib/prompts/AgenticaDescribePrompt.js +20 -0
- package/lib/prompts/AgenticaDescribePrompt.js.map +1 -0
- package/lib/prompts/AgenticaExecutePrompt.d.ts +20 -0
- package/lib/prompts/AgenticaExecutePrompt.js +24 -0
- package/lib/prompts/AgenticaExecutePrompt.js.map +1 -0
- package/lib/prompts/AgenticaPrompt.d.ts +7 -0
- package/lib/{typings/AgenticaSource.js → prompts/AgenticaPrompt.js} +1 -1
- package/lib/prompts/AgenticaPrompt.js.map +1 -0
- package/lib/prompts/AgenticaPromptBase.d.ts +22 -0
- package/lib/prompts/AgenticaPromptBase.js +22 -0
- package/lib/prompts/AgenticaPromptBase.js.map +1 -0
- package/lib/prompts/AgenticaSelectPrompt.d.ts +16 -0
- package/lib/prompts/AgenticaSelectPrompt.js +20 -0
- package/lib/prompts/AgenticaSelectPrompt.js.map +1 -0
- package/lib/prompts/AgenticaTextPrompt.d.ts +14 -0
- package/lib/prompts/AgenticaTextPrompt.js +20 -0
- package/lib/prompts/AgenticaTextPrompt.js.map +1 -0
- package/lib/structures/IAgenticaConfig.d.ts +3 -3
- package/lib/structures/IAgenticaExecutor.d.ts +12 -11
- package/lib/structures/IAgenticaProps.d.ts +2 -3
- package/lib/structures/IAgenticaSystemPrompt.d.ts +12 -11
- package/lib/transformers/AgenticaEventTransformer.d.ts +45 -0
- package/lib/transformers/AgenticaEventTransformer.js +127 -0
- package/lib/transformers/AgenticaEventTransformer.js.map +1 -0
- package/lib/transformers/AgenticaPromptTransformer.d.ts +34 -0
- package/lib/transformers/AgenticaPromptTransformer.js +90 -0
- package/lib/transformers/AgenticaPromptTransformer.js.map +1 -0
- package/package.json +1 -1
- package/src/Agentica.ts +93 -63
- package/src/chatgpt/ChatGptAgent.ts +8 -7
- package/src/chatgpt/ChatGptCallFunctionAgent.ts +90 -88
- package/src/chatgpt/ChatGptCancelFunctionAgent.ts +51 -58
- package/src/chatgpt/ChatGptCompletionMessageUtil.ts +166 -0
- package/src/chatgpt/ChatGptDescribeFunctionAgent.ts +81 -12
- package/src/chatgpt/ChatGptHistoryDecoder.ts +14 -14
- package/src/chatgpt/ChatGptInitializeFunctionAgent.ts +21 -13
- package/src/chatgpt/ChatGptSelectFunctionAgent.ts +66 -74
- package/src/chatgpt/ChatGptUsageAggregator.ts +62 -0
- package/src/context/AgenticaCancelPrompt.ts +32 -0
- package/src/context/AgenticaClassOperation.ts +23 -0
- package/src/{structures/IAgenticaContext.ts → context/AgenticaContext.ts} +17 -16
- package/src/context/AgenticaHttpOperation.ts +27 -0
- package/src/{structures/IAgenticaOperation.ts → context/AgenticaOperation.ts} +25 -22
- package/src/context/AgenticaOperationBase.ts +57 -0
- package/src/{structures/IAgenticaOperationCollection.ts → context/AgenticaOperationCollection.ts} +6 -6
- package/src/context/AgenticaOperationSelection.ts +27 -0
- package/src/context/AgenticaTokenUsage.ts +170 -0
- package/src/context/internal/AgenticaTokenUsageAggregator.ts +66 -0
- package/src/events/AgenticaCallEvent.ts +36 -0
- package/src/events/AgenticaCancelEvent.ts +28 -0
- package/src/events/AgenticaDescribeEvent.ts +61 -0
- package/src/events/AgenticaEvent.ts +36 -0
- package/src/events/AgenticaEventBase.ts +7 -0
- package/src/{typings/AgenticaSource.ts → events/AgenticaEventSource.ts} +1 -1
- package/src/events/AgenticaExecuteEvent.ts +50 -0
- package/src/events/AgenticaInitializeEvent.ts +14 -0
- package/src/events/AgenticaRequestEvent.ts +45 -0
- package/src/events/AgenticaResponseEvent.ts +48 -0
- package/src/events/AgenticaSelectEvent.ts +37 -0
- package/src/events/AgenticaTextEvent.ts +57 -0
- package/src/index.ts +33 -9
- package/src/internal/AgenticaOperationComposer.ts +24 -15
- package/src/internal/ByteArrayUtil.ts +5 -0
- package/src/internal/MPSCUtil.ts +75 -0
- package/src/internal/StreamUtil.ts +64 -0
- package/src/json/IAgenticaEventJson.ts +178 -0
- package/src/json/IAgenticaOperationJson.ts +36 -0
- package/src/json/IAgenticaOperationSelectionJson.ts +19 -0
- package/src/json/IAgenticaPromptJson.ts +130 -0
- package/src/{structures/IAgenticaTokenUsage.ts → json/IAgenticaTokenUsageJson.ts} +10 -10
- package/src/prompts/AgenticaCancelPrompt.ts +32 -0
- package/src/prompts/AgenticaDescribePrompt.ts +41 -0
- package/src/prompts/AgenticaExecutePrompt.ts +52 -0
- package/src/prompts/AgenticaPrompt.ts +14 -0
- package/src/prompts/AgenticaPromptBase.ts +27 -0
- package/src/prompts/AgenticaSelectPrompt.ts +32 -0
- package/src/prompts/AgenticaTextPrompt.ts +31 -0
- package/src/structures/IAgenticaConfig.ts +3 -3
- package/src/structures/IAgenticaExecutor.ts +14 -13
- package/src/structures/IAgenticaProps.ts +2 -3
- package/src/structures/IAgenticaSystemPrompt.ts +12 -11
- package/src/transformers/AgenticaEventTransformer.ts +165 -0
- package/src/transformers/AgenticaPromptTransformer.ts +134 -0
- package/lib/internal/AgenticaPromptFactory.d.ts +0 -7
- package/lib/internal/AgenticaPromptFactory.js +0 -9
- package/lib/internal/AgenticaPromptFactory.js.map +0 -1
- package/lib/internal/AgenticaPromptTransformer.d.ts +0 -10
- package/lib/internal/AgenticaPromptTransformer.js +0 -58
- package/lib/internal/AgenticaPromptTransformer.js.map +0 -1
- package/lib/internal/AgenticaTokenUsageAggregator.d.ts +0 -11
- package/lib/internal/AgenticaTokenUsageAggregator.js.map +0 -1
- package/lib/structures/IAgenticaContext.js.map +0 -1
- package/lib/structures/IAgenticaEvent.d.ts +0 -192
- package/lib/structures/IAgenticaEvent.js.map +0 -1
- package/lib/structures/IAgenticaOperation.d.ts +0 -47
- package/lib/structures/IAgenticaOperation.js.map +0 -1
- package/lib/structures/IAgenticaOperationCollection.js.map +0 -1
- package/lib/structures/IAgenticaOperationSelection.d.ts +0 -50
- package/lib/structures/IAgenticaOperationSelection.js.map +0 -1
- package/lib/structures/IAgenticaPrompt.d.ts +0 -138
- package/lib/structures/IAgenticaPrompt.js.map +0 -1
- package/lib/structures/IAgenticaTokenUsage.js +0 -3
- package/lib/structures/IAgenticaTokenUsage.js.map +0 -1
- package/lib/structures/internal/__IChatCancelFunctionsApplication.js.map +0 -1
- package/lib/structures/internal/__IChatFunctionReference.js.map +0 -1
- package/lib/structures/internal/__IChatInitialApplication.js.map +0 -1
- package/lib/structures/internal/__IChatSelectFunctionsApplication.js.map +0 -1
- package/lib/typings/AgenticaSource.d.ts +0 -1
- package/lib/typings/AgenticaSource.js.map +0 -1
- package/src/internal/AgenticaPromptFactory.ts +0 -32
- package/src/internal/AgenticaPromptTransformer.ts +0 -86
- package/src/internal/AgenticaTokenUsageAggregator.ts +0 -121
- package/src/structures/IAgenticaEvent.ts +0 -229
- package/src/structures/IAgenticaOperationSelection.ts +0 -68
- package/src/structures/IAgenticaPrompt.ts +0 -182
- /package/lib/{structures → context}/internal/__IChatCancelFunctionsApplication.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatCancelFunctionsApplication.js +0 -0
- /package/lib/{structures → context}/internal/__IChatFunctionReference.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatFunctionReference.js +0 -0
- /package/lib/{structures → context}/internal/__IChatInitialApplication.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatInitialApplication.js +0 -0
- /package/lib/{structures → context}/internal/__IChatSelectFunctionsApplication.d.ts +0 -0
- /package/lib/{structures → context}/internal/__IChatSelectFunctionsApplication.js +0 -0
- /package/src/{structures → context}/internal/__IChatCancelFunctionsApplication.ts +0 -0
- /package/src/{structures → context}/internal/__IChatFunctionReference.ts +0 -0
- /package/src/{structures → context}/internal/__IChatInitialApplication.ts +0 -0
- /package/src/{structures → context}/internal/__IChatSelectFunctionsApplication.ts +0 -0
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { IHttpLlmFunction, ILlmFunction, ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
|
|
3
|
-
import { IAgenticaController } from "./IAgenticaController";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Nestia agent operation selection.
|
|
7
|
-
*
|
|
8
|
-
* `IAgenticaOperationSelection` is a type represents an operation
|
|
9
|
-
* which has been selected by the A.I. chatbot of {@link Agentica}
|
|
10
|
-
* class for the LLM (Large Language Model) function calling with
|
|
11
|
-
* detailed {@link reason} of the selection (or cancellation).
|
|
12
|
-
*
|
|
13
|
-
* Also, `IAgenticaOperationSelection` is an union type that can
|
|
14
|
-
* specify a subtype by checking the {@link protocol} property.
|
|
15
|
-
*
|
|
16
|
-
* @author Samchon
|
|
17
|
-
*/
|
|
18
|
-
export type IAgenticaOperationSelection<Model extends ILlmSchema.Model> =
|
|
19
|
-
| IAgenticaOperationSelection.IHttp<Model>
|
|
20
|
-
| IAgenticaOperationSelection.IClass<Model>;
|
|
21
|
-
export namespace IAgenticaOperationSelection {
|
|
22
|
-
export type IHttp<Model extends ILlmSchema.Model> = IBase<
|
|
23
|
-
"http",
|
|
24
|
-
IAgenticaController.IHttp<Model>,
|
|
25
|
-
IHttpLlmFunction<Model>
|
|
26
|
-
>;
|
|
27
|
-
|
|
28
|
-
export type IClass<Model extends ILlmSchema.Model> = IBase<
|
|
29
|
-
"class",
|
|
30
|
-
IAgenticaController.IClass<Model>,
|
|
31
|
-
ILlmFunction<Model>
|
|
32
|
-
>;
|
|
33
|
-
|
|
34
|
-
interface IBase<Protocol, Controller, Function> {
|
|
35
|
-
/**
|
|
36
|
-
* Discriminator protocol.
|
|
37
|
-
*/
|
|
38
|
-
protocol: Protocol;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Belonged controller of the target function.
|
|
42
|
-
*/
|
|
43
|
-
controller: Controller;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Target function.
|
|
47
|
-
*
|
|
48
|
-
* Function that has been selected to prepare LLM function calling,
|
|
49
|
-
* or canceled due to no more required.
|
|
50
|
-
*/
|
|
51
|
-
function: Function;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Identifier name of the target function.
|
|
55
|
-
*
|
|
56
|
-
* If {@link Agentica} has multiple {@link IAgenticaController}s,
|
|
57
|
-
* the `name` can be different from target function's name.
|
|
58
|
-
*/
|
|
59
|
-
name: string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* The reason of the function selection or cancellation.
|
|
63
|
-
*/
|
|
64
|
-
reason: string;
|
|
65
|
-
|
|
66
|
-
toJSON(): Omit<IBase<Protocol, string, string>, "toJSON">;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IHttpLlmFunction,
|
|
3
|
-
IHttpResponse,
|
|
4
|
-
ILlmFunction,
|
|
5
|
-
ILlmSchema,
|
|
6
|
-
} from "@samchon/openapi";
|
|
7
|
-
|
|
8
|
-
import { IAgenticaController } from "./IAgenticaController";
|
|
9
|
-
import { IAgenticaOperationSelection } from "./IAgenticaOperationSelection";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Nestia A.I. chatbot prompt.
|
|
13
|
-
*
|
|
14
|
-
* `IWrtnChatPrompt` is an union type of all possible prompts that can
|
|
15
|
-
* be generated by the A.I. chatbot of the {@link Agentica} class.
|
|
16
|
-
*
|
|
17
|
-
* In other words, `IWrtnChatPrompt` is a type of chat history that
|
|
18
|
-
* is occurred during the conversation between the user and the A.I. chatbot
|
|
19
|
-
* in the {@link Agentica} class.
|
|
20
|
-
*
|
|
21
|
-
* If you want to continue the previous A.I. chatbot session, you can
|
|
22
|
-
* accomplish it by assigning the {@link IAgenticaProps.histories}
|
|
23
|
-
* property when creating a new {@link Agentica} instance.
|
|
24
|
-
*
|
|
25
|
-
* @author Samchon
|
|
26
|
-
*/
|
|
27
|
-
export type IAgenticaPrompt<Model extends ILlmSchema.Model> =
|
|
28
|
-
| IAgenticaPrompt.IText
|
|
29
|
-
| IAgenticaPrompt.ISelect<Model>
|
|
30
|
-
| IAgenticaPrompt.ICancel<Model>
|
|
31
|
-
| IAgenticaPrompt.IExecute<Model>
|
|
32
|
-
| IAgenticaPrompt.IDescribe<Model>;
|
|
33
|
-
export namespace IAgenticaPrompt {
|
|
34
|
-
/**
|
|
35
|
-
* Select prompt.
|
|
36
|
-
*
|
|
37
|
-
* Selection prompt about candidate functions to call.
|
|
38
|
-
*/
|
|
39
|
-
export interface ISelect<Model extends ILlmSchema.Model>
|
|
40
|
-
extends IBase<"select"> {
|
|
41
|
-
/**
|
|
42
|
-
* ID of the LLM tool call result.
|
|
43
|
-
*/
|
|
44
|
-
id: string;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Operations that have been selected.
|
|
48
|
-
*/
|
|
49
|
-
operations: IAgenticaOperationSelection<Model>[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Cancel prompt.
|
|
54
|
-
*
|
|
55
|
-
* Cancellation prompt about the candidate functions to be discarded.
|
|
56
|
-
*/
|
|
57
|
-
export interface ICancel<Model extends ILlmSchema.Model>
|
|
58
|
-
extends IBase<"cancel"> {
|
|
59
|
-
/**
|
|
60
|
-
* ID of the LLM tool call result.
|
|
61
|
-
*/
|
|
62
|
-
id: string;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Operations that have been cancelled.
|
|
66
|
-
*/
|
|
67
|
-
operations: IAgenticaOperationSelection<Model>[];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Execute prompt.
|
|
72
|
-
*
|
|
73
|
-
* Execution prompt about the LLM function calling.
|
|
74
|
-
*/
|
|
75
|
-
export type IExecute<Model extends ILlmSchema.Model> =
|
|
76
|
-
| IExecute.IHttp<Model>
|
|
77
|
-
| IExecute.IClass<Model>;
|
|
78
|
-
export namespace IExecute {
|
|
79
|
-
export type IHttp<Model extends ILlmSchema.Model> = IBase<
|
|
80
|
-
"http",
|
|
81
|
-
IAgenticaController.IHttp<Model>,
|
|
82
|
-
IHttpLlmFunction<Model>,
|
|
83
|
-
IHttpResponse
|
|
84
|
-
>;
|
|
85
|
-
export type IClass<Model extends ILlmSchema.Model> = IBase<
|
|
86
|
-
"class",
|
|
87
|
-
IAgenticaController.IClass<Model>,
|
|
88
|
-
ILlmFunction<Model>,
|
|
89
|
-
any
|
|
90
|
-
>;
|
|
91
|
-
interface IBase<Protocol, Controller, Function, Value> {
|
|
92
|
-
/**
|
|
93
|
-
* Discriminator type.
|
|
94
|
-
*/
|
|
95
|
-
type: "execute";
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Protocol discriminator.
|
|
99
|
-
*/
|
|
100
|
-
protocol: Protocol;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Belonged controller of the target function.
|
|
104
|
-
*/
|
|
105
|
-
controller: Controller;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Target function to call.
|
|
109
|
-
*/
|
|
110
|
-
function: Function;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* ID of the LLM tool call result.
|
|
114
|
-
*/
|
|
115
|
-
id: string;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Identifier name of the function.
|
|
119
|
-
*
|
|
120
|
-
* If {@link Agentica} has multiple {@link IAgenticaController}s,
|
|
121
|
-
* the `name` can be different from target function's name.
|
|
122
|
-
*/
|
|
123
|
-
name: string;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Arguments of the LLM function calling.
|
|
127
|
-
*/
|
|
128
|
-
arguments: object;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Return value.
|
|
132
|
-
*/
|
|
133
|
-
value: Value;
|
|
134
|
-
|
|
135
|
-
toJSON(): Omit<IBase<Protocol, string, string, Value>, "toJSON">;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Description prompt.
|
|
141
|
-
*
|
|
142
|
-
* Description prompt about the return value of the LLM function calling.
|
|
143
|
-
*/
|
|
144
|
-
export interface IDescribe<Model extends ILlmSchema.Model>
|
|
145
|
-
extends IBase<"describe"> {
|
|
146
|
-
/**
|
|
147
|
-
* Executions of the LLM function calling.
|
|
148
|
-
*
|
|
149
|
-
* This prompt describes the return value of them.
|
|
150
|
-
*/
|
|
151
|
-
executions: IExecute<Model>[];
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Description text.
|
|
155
|
-
*/
|
|
156
|
-
text: string;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Text prompt.
|
|
161
|
-
*/
|
|
162
|
-
export interface IText<
|
|
163
|
-
Role extends "assistant" | "user" = "assistant" | "user",
|
|
164
|
-
> extends IBase<"text"> {
|
|
165
|
-
/**
|
|
166
|
-
* Role of the orator.
|
|
167
|
-
*/
|
|
168
|
-
role: Role;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The text content.
|
|
172
|
-
*/
|
|
173
|
-
text: string;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
interface IBase<Type extends string> {
|
|
177
|
-
/**
|
|
178
|
-
* Discriminator type.
|
|
179
|
-
*/
|
|
180
|
-
type: Type;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|