@agentica/core 0.9.0 → 0.10.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.
Files changed (68) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +419 -419
  3. package/lib/Agentica.d.ts +4 -4
  4. package/lib/Agentica.js +7 -7
  5. package/lib/Agentica.js.map +1 -1
  6. package/lib/chatgpt/ChatGptCallFunctionAgent.js +14 -6
  7. package/lib/chatgpt/ChatGptCallFunctionAgent.js.map +1 -1
  8. package/lib/index.d.ts +1 -1
  9. package/lib/index.js +1 -1
  10. package/lib/index.js.map +1 -1
  11. package/lib/index.mjs +10 -5
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/structures/IAgenticaContext.d.ts +1 -1
  14. package/lib/structures/IAgenticaController.d.ts +4 -5
  15. package/lib/structures/IAgenticaEvent.d.ts +3 -3
  16. package/lib/structures/IAgenticaOperation.d.ts +2 -3
  17. package/lib/structures/IAgenticaOperationSelection.d.ts +2 -3
  18. package/lib/structures/IAgenticaPrompt.d.ts +2 -3
  19. package/lib/structures/IAgenticaProps.d.ts +4 -4
  20. package/lib/structures/IAgenticaTokenUsage.d.ts +3 -3
  21. package/lib/structures/{IAgenticaProvider.d.ts → IAgenticaVendor.d.ts} +6 -6
  22. package/lib/structures/{IAgenticaProvider.js → IAgenticaVendor.js} +1 -1
  23. package/lib/structures/IAgenticaVendor.js.map +1 -0
  24. package/package.json +1 -1
  25. package/prompts/cancel.md +4 -4
  26. package/prompts/common.md +2 -2
  27. package/prompts/describe.md +6 -6
  28. package/prompts/execute.md +6 -6
  29. package/prompts/initialize.md +2 -2
  30. package/prompts/select.md +6 -6
  31. package/src/Agentica.ts +323 -323
  32. package/src/chatgpt/ChatGptAgent.ts +75 -75
  33. package/src/chatgpt/ChatGptCallFunctionAgent.ts +464 -448
  34. package/src/chatgpt/ChatGptCancelFunctionAgent.ts +287 -287
  35. package/src/chatgpt/ChatGptDescribeFunctionAgent.ts +52 -52
  36. package/src/chatgpt/ChatGptHistoryDecoder.ts +88 -88
  37. package/src/chatgpt/ChatGptInitializeFunctionAgent.ts +88 -88
  38. package/src/chatgpt/ChatGptSelectFunctionAgent.ts +319 -319
  39. package/src/functional/createHttpLlmApplication.ts +63 -63
  40. package/src/index.ts +19 -19
  41. package/src/internal/AgenticaConstant.ts +4 -4
  42. package/src/internal/AgenticaDefaultPrompt.ts +43 -43
  43. package/src/internal/AgenticaOperationComposer.ts +87 -87
  44. package/src/internal/AgenticaPromptFactory.ts +32 -32
  45. package/src/internal/AgenticaPromptTransformer.ts +86 -86
  46. package/src/internal/AgenticaTokenUsageAggregator.ts +115 -115
  47. package/src/internal/MathUtil.ts +3 -3
  48. package/src/internal/Singleton.ts +22 -22
  49. package/src/internal/__map_take.ts +15 -15
  50. package/src/structures/IAgenticaConfig.ts +123 -123
  51. package/src/structures/IAgenticaContext.ts +129 -129
  52. package/src/structures/IAgenticaController.ts +133 -132
  53. package/src/structures/IAgenticaEvent.ts +229 -229
  54. package/src/structures/IAgenticaExecutor.ts +156 -156
  55. package/src/structures/IAgenticaOperation.ts +63 -64
  56. package/src/structures/IAgenticaOperationCollection.ts +52 -52
  57. package/src/structures/IAgenticaOperationSelection.ts +68 -69
  58. package/src/structures/IAgenticaPrompt.ts +182 -178
  59. package/src/structures/IAgenticaProps.ts +70 -70
  60. package/src/structures/IAgenticaSystemPrompt.ts +124 -124
  61. package/src/structures/IAgenticaTokenUsage.ts +107 -107
  62. package/src/structures/{IAgenticaProvider.ts → IAgenticaVendor.ts} +39 -39
  63. package/src/structures/internal/__IChatCancelFunctionsApplication.ts +23 -23
  64. package/src/structures/internal/__IChatFunctionReference.ts +21 -21
  65. package/src/structures/internal/__IChatInitialApplication.ts +15 -15
  66. package/src/structures/internal/__IChatSelectFunctionsApplication.ts +24 -24
  67. package/src/typings/AgenticaSource.ts +6 -6
  68. package/lib/structures/IAgenticaProvider.js.map +0 -1
@@ -3,7 +3,7 @@ import { Primitive } from "typia";
3
3
  import { IAgenticaConfig } from "./IAgenticaConfig";
4
4
  import { IAgenticaController } from "./IAgenticaController";
5
5
  import { IAgenticaPrompt } from "./IAgenticaPrompt";
6
- import { IAgenticaProvider } from "./IAgenticaProvider";
6
+ import { IAgenticaVendor } from "./IAgenticaVendor";
7
7
  /**
8
8
  * Properties of the Nestia Agent.
9
9
  *
@@ -12,7 +12,7 @@ import { IAgenticaProvider } from "./IAgenticaProvider";
12
12
  * there're everything to prepare to create a Super A.I. chatbot
13
13
  * performing the LLM (Large Language Model) function calling.
14
14
  *
15
- * At first, you have to specify the LLM service {@link provider} like
15
+ * At first, you have to specify the LLM service {@link vendor} like
16
16
  * OpenAI with its API key and client API. And then, you have to define
17
17
  * the {@link controllers} serving the functions to call. The controllers
18
18
  * are separated by two protocols; HTTP API and TypeScript class. At last,
@@ -31,9 +31,9 @@ export interface IAgenticaProps<Model extends ILlmSchema.Model> {
31
31
  */
32
32
  model: Model;
33
33
  /**
34
- * LLM service provider.
34
+ * LLM service vendor.
35
35
  */
36
- provider: IAgenticaProvider;
36
+ vendor: IAgenticaVendor;
37
37
  /**
38
38
  * Controllers serving functions to call.
39
39
  */
@@ -10,9 +10,9 @@
10
10
  * information, and does not contain any price or cost information. It is
11
11
  * because the price or cost can be changed by below reasons.
12
12
  *
13
- * - Type of {@link IAgenticaProps.provider LLM provider}
14
- * - {@link IAgenticaProvider.model} in the LLM provider.
15
- * - Just by a policy change of the LLM provider company.
13
+ * - Type of {@link IAgenticaProps.vendor LLM vendor}
14
+ * - {@link IAgenticaVendor.model} in the LLM vendor.
15
+ * - Just by a policy change of the LLM vendor company.
16
16
  *
17
17
  * @author Samchon
18
18
  */
@@ -1,24 +1,24 @@
1
1
  import OpenAI from "openai";
2
2
  /**
3
- * LLM Provider for Nestia Chat.
3
+ * LLM service vendor for Nestia Chat.
4
4
  *
5
- * `IAgenticaProvider` is a type represents an LLM
6
- * (Large Language Model) provider of the {@link Agentica}.
5
+ * `IAgenticaVendor` is a type represents an LLM
6
+ * (Large Language Model) vendor of the {@link Agentica}.
7
7
  *
8
8
  * Currently, {@link Agentica} supports OpenAI SDK. However, it does
9
9
  * not mean that you can use only OpenAI's GPT model in the
10
10
  * {@link Agentica}. The OpenAI SDK is just a connection tool to the
11
- * LLM provider's API, and you can use other LLM providers by configuring
11
+ * LLM vendor's API, and you can use other LLM vendors by configuring
12
12
  * its `baseURL` and API key.
13
13
  *
14
- * Therefore, if you want to use another LLM provider like Claude or
14
+ * Therefore, if you want to use another LLM vendor like Claude or
15
15
  * Gemini, please configure the `baseURL` to the {@link api}, and
16
16
  * set {@link IAgenticaController}'s schema model as "cluade" or
17
17
  * "gemini".
18
18
  *
19
19
  * @author Samchon
20
20
  */
21
- export interface IAgenticaProvider {
21
+ export interface IAgenticaVendor {
22
22
  /**
23
23
  * OpenAI API instance.
24
24
  */
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IAgenticaProvider.js.map
3
+ //# sourceMappingURL=IAgenticaVendor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAgenticaVendor.js","sourceRoot":"","sources":["../../src/structures/IAgenticaVendor.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentica/core",
3
- "version": "0.9.0",
3
+ "version": "0.10.0-dev.20250302",
4
4
  "main": "lib/index.js",
5
5
  "description": "Agentic AI Library specialized in LLM Function Calling",
6
6
  "scripts": {
package/prompts/cancel.md CHANGED
@@ -1,5 +1,5 @@
1
- You are a helpful assistant for cancelling functions which are prepared to call.
2
-
3
- Use the supplied tools to select some functions to cancel of `getApiFunctions()` returned.
4
-
1
+ You are a helpful assistant for cancelling functions which are prepared to call.
2
+
3
+ Use the supplied tools to select some functions to cancel of `getApiFunctions()` returned.
4
+
5
5
  If you can't find any proper function to select, don't talk, don't do anything.
package/prompts/common.md CHANGED
@@ -1,3 +1,3 @@
1
- At first, the user's language locale code is "${locale}". When you are conversating with the user or describing the function calling result, consider it and always translate to the target locale language. Never conversate with different locale language text with the user.
2
-
1
+ At first, the user's language locale code is "${locale}". When you are conversating with the user or describing the function calling result, consider it and always translate to the target locale language. Never conversate with different locale language text with the user.
2
+
3
3
  At second, the user's timezone is "${timezone}", and ISO datetime is ${datetime}. When you are conversating with the user, consider current time and user belonged timezone.
@@ -1,7 +1,7 @@
1
- You are a helpful assistant describing return values of function calls.
2
-
3
- Above messages are the list of function call histories. When describing the return values, please do not too much shortly summarize them. Instead, provide detailed descriptions as much as.
4
-
5
- Also, its content format must be markdown. If required, utilize the mermaid syntax for drawing some diagrams. When image contents are, just put them through the markdown image syntax.
6
-
1
+ You are a helpful assistant describing return values of function calls.
2
+
3
+ Above messages are the list of function call histories. When describing the return values, please do not too much shortly summarize them. Instead, provide detailed descriptions as much as.
4
+
5
+ Also, its content format must be markdown. If required, utilize the mermaid syntax for drawing some diagrams. When image contents are, just put them through the markdown image syntax.
6
+
7
7
  At last, if user's language locale code is different with your description, please translate it to the user's language.
@@ -1,7 +1,7 @@
1
- You are a helpful assistant for tool calling.
2
-
3
- Use the supplied tools to assist the user.
4
-
5
- If previous messages are not enough to compose the arguments, you can ask the user to write more information. By the way, when asking the user to write more information, make the text concise and clear.
6
-
1
+ You are a helpful assistant for tool calling.
2
+
3
+ Use the supplied tools to assist the user.
4
+
5
+ If previous messages are not enough to compose the arguments, you can ask the user to write more information. By the way, when asking the user to write more information, make the text concise and clear.
6
+
7
7
  For reference, in the "tool" role message content, the `function` property means metadata of the API operation. In other words, it is the function schema describing its purpose, parameters and return value types. And then the `data` property is the return value from the target function calling.
@@ -1,3 +1,3 @@
1
- You are a helpful assistant.
2
-
1
+ You are a helpful assistant.
2
+
3
3
  Use the supplied tools to assist the user.
package/prompts/select.md CHANGED
@@ -1,7 +1,7 @@
1
- You are a helpful assistant for selecting functions to call.
2
-
3
- Use the supplied tools to select some functions of `getApiFunctions()` returned.
4
-
5
- When selecting functions to call, pay attention to the relationship between functions. In particular, check the prerequisites between each function.
6
-
1
+ You are a helpful assistant for selecting functions to call.
2
+
3
+ Use the supplied tools to select some functions of `getApiFunctions()` returned.
4
+
5
+ When selecting functions to call, pay attention to the relationship between functions. In particular, check the prerequisites between each function.
6
+
7
7
  If you can't find any proper function to select, just type your own message. By the way, when typing your own message, please consider the user's language locale code. If your message is different with the user's language, please translate it to the user's.