@venturialstd/workflow 0.1.161 → 0.1.163

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 (46) hide show
  1. package/dist/modules/chatgpt/actions/chat-completion.action.d.ts +0 -16
  2. package/dist/modules/chatgpt/actions/chat-completion.action.d.ts.map +1 -1
  3. package/dist/modules/chatgpt/actions/chat-completion.action.js +17 -71
  4. package/dist/modules/chatgpt/actions/chat-completion.action.js.map +1 -1
  5. package/dist/modules/chatgpt/actions/chat-purpose.action.d.ts +3 -0
  6. package/dist/modules/chatgpt/actions/chat-purpose.action.d.ts.map +1 -0
  7. package/dist/modules/chatgpt/actions/chat-purpose.action.js +229 -0
  8. package/dist/modules/chatgpt/actions/chat-purpose.action.js.map +1 -0
  9. package/dist/modules/chatgpt/actions/index.d.ts +1 -0
  10. package/dist/modules/chatgpt/actions/index.d.ts.map +1 -1
  11. package/dist/modules/chatgpt/actions/index.js +1 -0
  12. package/dist/modules/chatgpt/actions/index.js.map +1 -1
  13. package/dist/modules/chatgpt/chatgpt-nest.module.d.ts.map +1 -1
  14. package/dist/modules/chatgpt/chatgpt-nest.module.js +2 -0
  15. package/dist/modules/chatgpt/chatgpt-nest.module.js.map +1 -1
  16. package/dist/modules/chatgpt/chatgpt.module.d.ts.map +1 -1
  17. package/dist/modules/chatgpt/chatgpt.module.js +1 -0
  18. package/dist/modules/chatgpt/chatgpt.module.js.map +1 -1
  19. package/dist/modules/chatgpt/services/chat-completion.service.d.ts.map +1 -1
  20. package/dist/modules/chatgpt/services/chat-completion.service.js +15 -43
  21. package/dist/modules/chatgpt/services/chat-completion.service.js.map +1 -1
  22. package/dist/modules/chatgpt/services/chat-purpose.service.d.ts +24 -0
  23. package/dist/modules/chatgpt/services/chat-purpose.service.d.ts.map +1 -0
  24. package/dist/modules/chatgpt/services/chat-purpose.service.js +396 -0
  25. package/dist/modules/chatgpt/services/chat-purpose.service.js.map +1 -0
  26. package/dist/modules/chatgpt/services/index.d.ts +1 -0
  27. package/dist/modules/chatgpt/services/index.d.ts.map +1 -1
  28. package/dist/modules/chatgpt/services/index.js +1 -0
  29. package/dist/modules/chatgpt/services/index.js.map +1 -1
  30. package/dist/modules/chatgpt/types/purpose-memory.types.d.ts +38 -0
  31. package/dist/modules/chatgpt/types/purpose-memory.types.d.ts.map +1 -0
  32. package/dist/modules/chatgpt/types/purpose-memory.types.js +28 -0
  33. package/dist/modules/chatgpt/types/purpose-memory.types.js.map +1 -0
  34. package/dist/modules/chatgpt/utils/purpose-cache-key.util.d.ts +5 -0
  35. package/dist/modules/chatgpt/utils/purpose-cache-key.util.d.ts.map +1 -0
  36. package/dist/modules/chatgpt/utils/purpose-cache-key.util.js +15 -0
  37. package/dist/modules/chatgpt/utils/purpose-cache-key.util.js.map +1 -0
  38. package/dist/modules/chatgpt/utils/purpose-schema.validator.d.ts +2 -0
  39. package/dist/modules/chatgpt/utils/purpose-schema.validator.d.ts.map +1 -0
  40. package/dist/modules/chatgpt/utils/purpose-schema.validator.js +34 -0
  41. package/dist/modules/chatgpt/utils/purpose-schema.validator.js.map +1 -0
  42. package/dist/modules/chatgpt/utils/token-estimate.util.d.ts +7 -0
  43. package/dist/modules/chatgpt/utils/token-estimate.util.d.ts.map +1 -0
  44. package/dist/modules/chatgpt/utils/token-estimate.util.js +20 -0
  45. package/dist/modules/chatgpt/utils/token-estimate.util.js.map +1 -0
  46. package/package.json +3 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-estimate.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/utils/token-estimate.util.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAQrH"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.estimateTokens = estimateTokens;
4
+ exports.estimateMessagesTokens = estimateMessagesTokens;
5
+ const CHARS_PER_TOKEN_ESTIMATE = 4;
6
+ function estimateTokens(text) {
7
+ if (!text || typeof text !== 'string')
8
+ return 0;
9
+ return Math.ceil(text.length / CHARS_PER_TOKEN_ESTIMATE);
10
+ }
11
+ function estimateMessagesTokens(messages) {
12
+ let total = 0;
13
+ for (const m of messages) {
14
+ const text = (m.content ?? m.message ?? '');
15
+ total += estimateTokens(text);
16
+ total += 4;
17
+ }
18
+ return total;
19
+ }
20
+ //# sourceMappingURL=token-estimate.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-estimate.util.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/utils/token-estimate.util.ts"],"names":[],"mappings":";;AAMA,wCAGC;AAED,wDAQC;AAfD,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,SAAgB,cAAc,CAAC,IAAY;IACzC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,wBAAwB,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,sBAAsB,CAAC,QAAsE;IAC3G,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,EAAE,CAAW,CAAC;QACtD,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venturialstd/workflow",
3
- "version": "0.1.161",
3
+ "version": "0.1.163",
4
4
  "description": "Workflow Module for Venturial",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -82,7 +82,7 @@
82
82
  "@nestjs/websockets": "^11.0.0",
83
83
  "socket.io": "^4.8.0",
84
84
  "@venturialstd/capa": "^0.0.6",
85
- "@venturialstd/chatgpt": "^0.0.6",
85
+ "@venturialstd/chatgpt": "^0.0.7",
86
86
  "@venturialstd/circle": "^0.0.7",
87
87
  "@venturialstd/core": "^1.0.16",
88
88
  "@venturialstd/email": "^0.0.2",
@@ -109,6 +109,7 @@
109
109
  "uuid": "^11.0.5"
110
110
  },
111
111
  "dependencies": {
112
+ "ajv": "^8.17.1",
112
113
  "bullmq": "^5.67.2",
113
114
  "cron-parser": "^4.9.0",
114
115
  "ioredis": "^5.9.2",