@agentica/core 0.8.1 → 0.8.3-dev.20250227

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.
Files changed (55) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +404 -404
  3. package/lib/Agentica.d.ts +2 -2
  4. package/lib/Agentica.js +9 -3
  5. package/lib/Agentica.js.map +1 -1
  6. package/lib/chatgpt/ChatGptHistoryDecoder.js.map +1 -1
  7. package/lib/index.mjs +17 -15
  8. package/lib/index.mjs.map +1 -1
  9. package/lib/internal/AgenticaTokenUsageAggregator.js +7 -9
  10. package/lib/internal/AgenticaTokenUsageAggregator.js.map +1 -1
  11. package/lib/structures/IAgenticaTokenUsage.d.ts +7 -11
  12. package/package.json +1 -1
  13. package/prompts/cancel.md +4 -4
  14. package/prompts/common.md +2 -2
  15. package/prompts/describe.md +6 -6
  16. package/prompts/execute.md +6 -6
  17. package/prompts/initialize.md +2 -2
  18. package/prompts/select.md +6 -6
  19. package/src/Agentica.ts +318 -312
  20. package/src/chatgpt/ChatGptAgent.ts +71 -71
  21. package/src/chatgpt/ChatGptCallFunctionAgent.ts +445 -445
  22. package/src/chatgpt/ChatGptCancelFunctionAgent.ts +283 -283
  23. package/src/chatgpt/ChatGptDescribeFunctionAgent.ts +51 -51
  24. package/src/chatgpt/ChatGptHistoryDecoder.ts +87 -86
  25. package/src/chatgpt/ChatGptInitializeFunctionAgent.ts +88 -88
  26. package/src/chatgpt/ChatGptSelectFunctionAgent.ts +318 -318
  27. package/src/functional/createHttpLlmApplication.ts +63 -63
  28. package/src/index.ts +19 -19
  29. package/src/internal/AgenticaConstant.ts +4 -4
  30. package/src/internal/AgenticaDefaultPrompt.ts +39 -39
  31. package/src/internal/AgenticaOperationComposer.ts +82 -82
  32. package/src/internal/AgenticaPromptFactory.ts +30 -30
  33. package/src/internal/AgenticaPromptTransformer.ts +83 -83
  34. package/src/internal/AgenticaTokenUsageAggregator.ts +115 -123
  35. package/src/internal/MathUtil.ts +3 -3
  36. package/src/internal/Singleton.ts +22 -22
  37. package/src/internal/__map_take.ts +15 -15
  38. package/src/structures/IAgenticaConfig.ts +121 -121
  39. package/src/structures/IAgenticaContext.ts +128 -128
  40. package/src/structures/IAgenticaController.ts +130 -130
  41. package/src/structures/IAgenticaEvent.ts +224 -224
  42. package/src/structures/IAgenticaExecutor.ts +152 -152
  43. package/src/structures/IAgenticaOperation.ts +64 -64
  44. package/src/structures/IAgenticaOperationCollection.ts +50 -50
  45. package/src/structures/IAgenticaOperationSelection.ts +69 -69
  46. package/src/structures/IAgenticaPrompt.ts +173 -173
  47. package/src/structures/IAgenticaProps.ts +64 -64
  48. package/src/structures/IAgenticaProvider.ts +45 -45
  49. package/src/structures/IAgenticaSystemPrompt.ts +122 -122
  50. package/src/structures/IAgenticaTokenUsage.ts +107 -112
  51. package/src/structures/internal/__IChatCancelFunctionsApplication.ts +23 -23
  52. package/src/structures/internal/__IChatFunctionReference.ts +21 -21
  53. package/src/structures/internal/__IChatInitialApplication.ts +15 -15
  54. package/src/structures/internal/__IChatSelectFunctionsApplication.ts +24 -24
  55. 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";