@adminforth/text-complete 2.0.8 → 2.0.10

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/README.md CHANGED
@@ -1,7 +1,31 @@
1
1
  # AdminForth TextComplete Plugin
2
2
 
3
- <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/text-complete"> <img src="https://img.shields.io/npm/dt/@adminforth/text-complete" alt="npm downloads" /></a> <a href="https://www.npmjs.com/package/@adminforth/text-complete"><img src="https://img.shields.io/npm/v/@adminforth/text-complete" alt="npm version" /></a> <a href="https://www.npmjs.com/package/@adminforth/text-complete">
3
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/text-complete"><img src="https://img.shields.io/npm/dm/@adminforth/text-complete" alt="npm downloads" /></a> <a href="https://www.npmjs.com/package/@adminforth/text-complete"><img src="https://img.shields.io/npm/v/@adminforth/text-complete" alt="npm version" /></a>
4
+
5
+ [![Ask AI](https://tluma.ai/badge)](https://tluma.ai/ask-ai/devforth/adminforth)
4
6
 
5
7
  Allow to add an auto-complete text and string feature to adminforth fields using OpenAI Chat GPT models.
6
8
 
7
- ## For usage, see [AdminForth TextComplete Documentation](https://adminforth.dev/docs/tutorial/Plugins/text-complete/)
9
+ ## Features
10
+
11
+ - Add AI-powered text completion to AdminForth fields.
12
+ - Speed up drafting for text and string values.
13
+ - Use ChatGPT-based assistance close to your data forms.
14
+ - Keep generation workflows inside the admin panel.
15
+
16
+ ## Documentation
17
+
18
+ Full setup and configuration guide:
19
+
20
+ [AdminForth TextComplete Documentation](https://adminforth.dev/docs/tutorial/Plugins/text-complete/)
21
+
22
+ ## About AdminForth
23
+
24
+ AdminForth is an open-source, agent-first admin framework for building robust admin panels and back-office applications faster.
25
+
26
+ ## Related links
27
+
28
+ - [AdminForth website](https://adminforth.dev)
29
+ - [npm package](https://www.npmjs.com/package/@adminforth/text-complete)
30
+ - [More AdminForth plugins](https://adminforth.dev/docs/tutorial/ListOfPlugins/)
31
+ - [Built by DevForth](https://devforth.io)
package/build.log CHANGED
@@ -10,5 +10,5 @@ custom/package.json
10
10
  custom/pnpm-lock.yaml
11
11
  custom/tsconfig.json
12
12
 
13
- sent 31,371 bytes received 115 bytes 62,972.00 bytes/sec
14
- total size is 30,945 speedup is 0.98
13
+ sent 31,395 bytes received 115 bytes 63,020.00 bytes/sec
14
+ total size is 30,975 speedup is 0.98
@@ -7,7 +7,7 @@
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "keywords": [],
10
- "author": "",
10
+ "author": "DevForth (https://devforth.io)",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@iconify-prerendered/vue-mdi": "^0.28.1737398331",
@@ -7,7 +7,7 @@
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "keywords": [],
10
- "author": "",
10
+ "author": "DevForth (https://devforth.io)",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@iconify-prerendered/vue-mdi": "^0.28.1737398331",
package/dist/index.js CHANGED
@@ -67,7 +67,7 @@ export default class TextCompletePlugin extends AdminForthPlugin {
67
67
  method: 'POST',
68
68
  path: `/plugin/${this.pluginInstanceId}/doComplete`,
69
69
  handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, headers }) {
70
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
70
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
71
71
  if (this.rateLimiter) {
72
72
  // rate limit
73
73
  // const { error } = RateLimiter.checkRateLimit(
@@ -120,7 +120,10 @@ export default class TextCompletePlugin extends AdminForthPlugin {
120
120
  }
121
121
  }
122
122
  process.env.HEAVY_DEBUG && console.log('🪲 OpenAI Prompt 🧠', content);
123
- const { content: respContent } = yield this.options.adapter.complete(content, (_l = this.options.expert) === null || _l === void 0 ? void 0 : _l.maxTokens);
123
+ const { content: respContent } = yield this.options.adapter.complete({
124
+ content,
125
+ maxTokens: (_m = (_l = this.options.expert) === null || _l === void 0 ? void 0 : _l.maxTokens) !== null && _m !== void 0 ? _m : 50,
126
+ });
124
127
  let suggestion = respContent;
125
128
  if (suggestion.startsWith(currentVal)) {
126
129
  suggestion = suggestion.slice(currentVal.length);
package/index.ts CHANGED
@@ -145,7 +145,10 @@ export default class TextCompletePlugin extends AdminForthPlugin {
145
145
  }
146
146
 
147
147
  process.env.HEAVY_DEBUG && console.log('🪲 OpenAI Prompt 🧠', content);
148
- const { content: respContent } = await this.options.adapter.complete(content, this.options.expert?.maxTokens);
148
+ const { content: respContent } = await this.options.adapter.complete({
149
+ content,
150
+ maxTokens: this.options.expert?.maxTokens ?? 50,
151
+ });
149
152
  let suggestion = respContent
150
153
 
151
154
  if (suggestion.startsWith(currentVal)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/text-complete",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Text completion plugin for adminforth",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,11 +20,11 @@
20
20
  "adminforth",
21
21
  "text complete"
22
22
  ],
23
- "author": "devforth",
23
+ "author": "DevForth (https://devforth.io)",
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.10.7",
27
- "adminforth": "^2.35.0",
27
+ "adminforth": "^2.42.0",
28
28
  "semantic-release": "^24.2.1",
29
29
  "semantic-release-slack-bot": "^4.0.2",
30
30
  "typescript": "^5.7.3"
@@ -55,6 +55,6 @@
55
55
  ]
56
56
  },
57
57
  "peerDependencies": {
58
- "adminforth": "^2.35.0"
58
+ "adminforth": "^2.42.0"
59
59
  }
60
60
  }