@agentica/core 0.8.3 → 0.9.0-dev.20250302
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/LICENSE +21 -21
- package/README.md +419 -404
- package/lib/Agentica.d.ts +10 -9
- package/lib/Agentica.js.map +1 -1
- package/lib/chatgpt/ChatGptAgent.d.ts +2 -1
- package/lib/chatgpt/ChatGptAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.d.ts +2 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.js +3 -1
- package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptCancelFunctionAgent.d.ts +3 -2
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js +55 -2
- package/lib/chatgpt/ChatGptCancelFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.d.ts +2 -1
- package/lib/chatgpt/ChatGptDescribeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptHistoryDecoder.d.ts +2 -1
- package/lib/chatgpt/ChatGptHistoryDecoder.js.map +1 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.d.ts +2 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js +63 -1
- package/lib/chatgpt/ChatGptInitializeFunctionAgent.js.map +1 -1
- package/lib/chatgpt/ChatGptSelectFunctionAgent.d.ts +2 -1
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js +55 -2
- package/lib/chatgpt/ChatGptSelectFunctionAgent.js.map +1 -1
- package/lib/functional/createHttpLlmApplication.js +826 -798
- package/lib/functional/createHttpLlmApplication.js.map +1 -1
- package/lib/index.mjs +987 -804
- package/lib/index.mjs.map +1 -1
- package/lib/internal/AgenticaDefaultPrompt.d.ts +2 -1
- package/lib/internal/AgenticaDefaultPrompt.js.map +1 -1
- package/lib/internal/AgenticaOperationComposer.d.ts +5 -4
- package/lib/internal/AgenticaOperationComposer.js +1 -1
- package/lib/internal/AgenticaOperationComposer.js.map +1 -1
- package/lib/internal/AgenticaPromptFactory.d.ts +3 -2
- package/lib/internal/AgenticaPromptFactory.js.map +1 -1
- package/lib/internal/AgenticaPromptTransformer.d.ts +5 -4
- package/lib/internal/AgenticaPromptTransformer.js.map +1 -1
- package/lib/structures/IAgenticaConfig.d.ts +4 -3
- package/lib/structures/IAgenticaContext.d.ts +7 -6
- package/lib/structures/IAgenticaController.d.ts +8 -8
- package/lib/structures/IAgenticaEvent.d.ts +19 -18
- package/lib/structures/IAgenticaExecutor.d.ts +7 -6
- package/lib/structures/IAgenticaOperation.d.ts +4 -4
- package/lib/structures/IAgenticaOperationCollection.d.ts +6 -5
- package/lib/structures/IAgenticaOperationSelection.d.ts +4 -4
- package/lib/structures/IAgenticaPrompt.d.ts +11 -11
- package/lib/structures/IAgenticaProps.d.ts +9 -4
- package/lib/structures/IAgenticaProvider.d.ts +22 -27
- package/lib/structures/IAgenticaSystemPrompt.d.ts +8 -7
- package/package.json +6 -9
- package/prompts/cancel.md +4 -4
- package/prompts/common.md +2 -2
- package/prompts/describe.md +6 -6
- package/prompts/execute.md +6 -6
- package/prompts/initialize.md +2 -2
- package/prompts/select.md +6 -6
- package/src/Agentica.ts +323 -318
- package/src/chatgpt/ChatGptAgent.ts +75 -71
- package/src/chatgpt/ChatGptCallFunctionAgent.ts +448 -445
- package/src/chatgpt/ChatGptCancelFunctionAgent.ts +287 -283
- package/src/chatgpt/ChatGptDescribeFunctionAgent.ts +52 -51
- package/src/chatgpt/ChatGptHistoryDecoder.ts +88 -87
- package/src/chatgpt/ChatGptInitializeFunctionAgent.ts +88 -88
- package/src/chatgpt/ChatGptSelectFunctionAgent.ts +319 -318
- package/src/functional/createHttpLlmApplication.ts +63 -63
- package/src/index.ts +19 -19
- package/src/internal/AgenticaConstant.ts +4 -4
- package/src/internal/AgenticaDefaultPrompt.ts +43 -39
- package/src/internal/AgenticaOperationComposer.ts +87 -82
- package/src/internal/AgenticaPromptFactory.ts +32 -30
- package/src/internal/AgenticaPromptTransformer.ts +86 -83
- package/src/internal/AgenticaTokenUsageAggregator.ts +115 -115
- package/src/internal/MathUtil.ts +3 -3
- package/src/internal/Singleton.ts +22 -22
- package/src/internal/__map_take.ts +15 -15
- package/src/structures/IAgenticaConfig.ts +123 -121
- package/src/structures/IAgenticaContext.ts +129 -128
- package/src/structures/IAgenticaController.ts +132 -130
- package/src/structures/IAgenticaEvent.ts +229 -224
- package/src/structures/IAgenticaExecutor.ts +156 -152
- package/src/structures/IAgenticaOperation.ts +64 -64
- package/src/structures/IAgenticaOperationCollection.ts +52 -50
- package/src/structures/IAgenticaOperationSelection.ts +69 -69
- package/src/structures/IAgenticaPrompt.ts +178 -173
- package/src/structures/IAgenticaProps.ts +70 -64
- package/src/structures/IAgenticaProvider.ts +39 -45
- package/src/structures/IAgenticaSystemPrompt.ts +124 -122
- package/src/structures/IAgenticaTokenUsage.ts +107 -107
- package/src/structures/internal/__IChatCancelFunctionsApplication.ts +23 -23
- package/src/structures/internal/__IChatFunctionReference.ts +21 -21
- package/src/structures/internal/__IChatInitialApplication.ts +15 -15
- package/src/structures/internal/__IChatSelectFunctionsApplication.ts +24 -24
- package/src/typings/AgenticaSource.ts +6 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { IHttpLlmFunction } from "@samchon/openapi";
|
|
2
|
-
|
|
3
|
-
export interface __IChatInitialApplication {
|
|
4
|
-
/**
|
|
5
|
-
* Get list of API functions.
|
|
6
|
-
*
|
|
7
|
-
* If user seems like to request some function calling except this one,
|
|
8
|
-
* call this `getApiFunctions()` to get the list of candidate API functions
|
|
9
|
-
* provided from this application.
|
|
10
|
-
*
|
|
11
|
-
* Also, user just wants to list up every remote API functions that can be
|
|
12
|
-
* called from the backend server, utilize this function too.
|
|
13
|
-
*/
|
|
14
|
-
getApiFunctions({}): Promise<Array<IHttpLlmFunction<"chatgpt">>>;
|
|
15
|
-
}
|
|
1
|
+
import { IHttpLlmFunction } from "@samchon/openapi";
|
|
2
|
+
|
|
3
|
+
export interface __IChatInitialApplication {
|
|
4
|
+
/**
|
|
5
|
+
* Get list of API functions.
|
|
6
|
+
*
|
|
7
|
+
* If user seems like to request some function calling except this one,
|
|
8
|
+
* call this `getApiFunctions()` to get the list of candidate API functions
|
|
9
|
+
* provided from this application.
|
|
10
|
+
*
|
|
11
|
+
* Also, user just wants to list up every remote API functions that can be
|
|
12
|
+
* called from the backend server, utilize this function too.
|
|
13
|
+
*/
|
|
14
|
+
getApiFunctions({}): Promise<Array<IHttpLlmFunction<"chatgpt">>>;
|
|
15
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { __IChatFunctionReference } from "./__IChatFunctionReference";
|
|
2
|
-
|
|
3
|
-
export interface __IChatSelectFunctionsApplication {
|
|
4
|
-
/**
|
|
5
|
-
* Select proper API functions to call.
|
|
6
|
-
*
|
|
7
|
-
* If you A.I. agent has found some proper API functions to call
|
|
8
|
-
* from the conversation with user, please select the API functions
|
|
9
|
-
* just by calling this function.
|
|
10
|
-
*
|
|
11
|
-
* When user wants to call a same function multiply, you A.I. agent must
|
|
12
|
-
* list up it multiply in the `functions` property. Otherwise the user has
|
|
13
|
-
* requested to call many different functions, you A.I. agent have to assign
|
|
14
|
-
* them all into the `functions` property.
|
|
15
|
-
*
|
|
16
|
-
* Also, if you A.I. agent can't specify a specific function to call due to lack
|
|
17
|
-
* of specificity or homogeneity of candidate functions, just assign all of them
|
|
18
|
-
* by in the` functions` property` too. Instead, when you A.I. agent can specify
|
|
19
|
-
* a specific function to call, the others would be eliminated.
|
|
20
|
-
*
|
|
21
|
-
* @param props Properties of the function
|
|
22
|
-
*/
|
|
23
|
-
selectFunctions(props: __IChatFunctionReference.IProps): Promise<void>;
|
|
24
|
-
}
|
|
1
|
+
import { __IChatFunctionReference } from "./__IChatFunctionReference";
|
|
2
|
+
|
|
3
|
+
export interface __IChatSelectFunctionsApplication {
|
|
4
|
+
/**
|
|
5
|
+
* Select proper API functions to call.
|
|
6
|
+
*
|
|
7
|
+
* If you A.I. agent has found some proper API functions to call
|
|
8
|
+
* from the conversation with user, please select the API functions
|
|
9
|
+
* just by calling this function.
|
|
10
|
+
*
|
|
11
|
+
* When user wants to call a same function multiply, you A.I. agent must
|
|
12
|
+
* list up it multiply in the `functions` property. Otherwise the user has
|
|
13
|
+
* requested to call many different functions, you A.I. agent have to assign
|
|
14
|
+
* them all into the `functions` property.
|
|
15
|
+
*
|
|
16
|
+
* Also, if you A.I. agent can't specify a specific function to call due to lack
|
|
17
|
+
* of specificity or homogeneity of candidate functions, just assign all of them
|
|
18
|
+
* by in the` functions` property` too. Instead, when you A.I. agent can specify
|
|
19
|
+
* a specific function to call, the others would be eliminated.
|
|
20
|
+
*
|
|
21
|
+
* @param props Properties of the function
|
|
22
|
+
*/
|
|
23
|
+
selectFunctions(props: __IChatFunctionReference.IProps): Promise<void>;
|
|
24
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type AgenticaSource =
|
|
2
|
-
| "initialize"
|
|
3
|
-
| "select"
|
|
4
|
-
| "cancel"
|
|
5
|
-
| "call"
|
|
6
|
-
| "describe";
|
|
1
|
+
export type AgenticaSource =
|
|
2
|
+
| "initialize"
|
|
3
|
+
| "select"
|
|
4
|
+
| "cancel"
|
|
5
|
+
| "call"
|
|
6
|
+
| "describe";
|