@adminforth/text-complete 2.0.7 → 2.0.9
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 +26 -2
- package/dist/index.js +5 -2
- package/index.ts +4 -1
- package/package.json +3 -2
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"
|
|
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
|
+
[](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
|
-
##
|
|
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/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(
|
|
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(
|
|
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.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Text completion plugin for adminforth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.10.7",
|
|
27
|
+
"adminforth": "^2.42.0",
|
|
27
28
|
"semantic-release": "^24.2.1",
|
|
28
29
|
"semantic-release-slack-bot": "^4.0.2",
|
|
29
30
|
"typescript": "^5.7.3"
|
|
@@ -54,6 +55,6 @@
|
|
|
54
55
|
]
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"adminforth": "^2.
|
|
58
|
+
"adminforth": "^2.42.0"
|
|
58
59
|
}
|
|
59
60
|
}
|