From 2da74fa121e0581bb1b01e3966a6f9d3ad8ee7d2 Mon Sep 17 00:00:00 2001 From: sharevb Date: Fri, 23 Aug 2024 21:09:17 +0200 Subject: [PATCH 1/4] feat(new tool): AI Prompt Splitter Fix #1195 --- components.d.ts | 31 +---------- package.json | 1 + pnpm-lock.yaml | 24 +++++--- .../ai-prompt-splitter/ai-prompt-splitter.vue | 55 +++++++++++++++++++ src/tools/ai-prompt-splitter/index.ts | 12 ++++ src/tools/index.ts | 11 +++- 6 files changed, 95 insertions(+), 39 deletions(-) create mode 100644 src/tools/ai-prompt-splitter/ai-prompt-splitter.vue create mode 100644 src/tools/ai-prompt-splitter/index.ts diff --git a/components.d.ts b/components.d.ts index d034fc78..457ea91e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,6 +11,7 @@ declare module '@vue/runtime-core' { export interface GlobalComponents { '404.page': typeof import('./src/pages/404.page.vue')['default'] About: typeof import('./src/pages/About.vue')['default'] + AiPromptSplitter: typeof import('./src/tools/ai-prompt-splitter/ai-prompt-splitter.vue')['default'] App: typeof import('./src/App.vue')['default'] 'Base.layout': typeof import('./src/layouts/base.layout.vue')['default'] Base64FileConverter: typeof import('./src/tools/base64-file-converter/base64-file-converter.vue')['default'] @@ -88,29 +89,17 @@ declare module '@vue/runtime-core' { HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default'] IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default'] 'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default'] - 'IconMdi:contentCopy': typeof import('~icons/mdi/content-copy')['default'] 'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default'] - IconMdiArrowDown: typeof import('~icons/mdi/arrow-down')['default'] - IconMdiArrowRight: typeof import('~icons/mdi/arrow-right')['default'] - IconMdiArrowRightBottom: typeof import('~icons/mdi/arrow-right-bottom')['default'] - IconMdiCamera: typeof import('~icons/mdi/camera')['default'] IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default'] IconMdiChevronRight: typeof import('~icons/mdi/chevron-right')['default'] IconMdiClose: typeof import('~icons/mdi/close')['default'] IconMdiContentCopy: typeof import('~icons/mdi/content-copy')['default'] - IconMdiDeleteOutline: typeof import('~icons/mdi/delete-outline')['default'] - IconMdiDownload: typeof import('~icons/mdi/download')['default'] IconMdiEye: typeof import('~icons/mdi/eye')['default'] IconMdiEyeOff: typeof import('~icons/mdi/eye-off')['default'] IconMdiHeart: typeof import('~icons/mdi/heart')['default'] - IconMdiPause: typeof import('~icons/mdi/pause')['default'] - IconMdiPlay: typeof import('~icons/mdi/play')['default'] - IconMdiRecord: typeof import('~icons/mdi/record')['default'] - IconMdiRefresh: typeof import('~icons/mdi/refresh')['default'] IconMdiSearch: typeof import('~icons/mdi/search')['default'] IconMdiTranslate: typeof import('~icons/mdi/translate')['default'] IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default'] - IconMdiVideo: typeof import('~icons/mdi/video')['default'] InputCopyable: typeof import('./src/components/InputCopyable.vue')['default'] IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default'] Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default'] @@ -137,42 +126,24 @@ declare module '@vue/runtime-core' { MenuLayout: typeof import('./src/components/MenuLayout.vue')['default'] MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default'] MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] - NAlert: typeof import('naive-ui')['NAlert'] NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] - NCheckbox: typeof import('naive-ui')['NCheckbox'] NCode: typeof import('naive-ui')['NCode'] NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] - NColorPicker: typeof import('naive-ui')['NColorPicker'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] - NDatePicker: typeof import('naive-ui')['NDatePicker'] - NDivider: typeof import('naive-ui')['NDivider'] - NDynamicInput: typeof import('naive-ui')['NDynamicInput'] NEllipsis: typeof import('naive-ui')['NEllipsis'] - NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] NH1: typeof import('naive-ui')['NH1'] - NH2: typeof import('naive-ui')['NH2'] NH3: typeof import('naive-ui')['NH3'] NIcon: typeof import('naive-ui')['NIcon'] - NImage: typeof import('naive-ui')['NImage'] - NInputGroup: typeof import('naive-ui')['NInputGroup'] - NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel'] NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] - NProgress: typeof import('naive-ui')['NProgress'] NScrollbar: typeof import('naive-ui')['NScrollbar'] - NSlider: typeof import('naive-ui')['NSlider'] - NStatistic: typeof import('naive-ui')['NStatistic'] - NSwitch: typeof import('naive-ui')['NSwitch'] - NTable: typeof import('naive-ui')['NTable'] NTag: typeof import('naive-ui')['NTag'] NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] - NUpload: typeof import('naive-ui')['NUpload'] - NUploadDragger: typeof import('naive-ui')['NUploadDragger'] OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default'] PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default'] PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default'] diff --git a/package.json b/package.json index ffa7bd4e..31d131d9 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@vueuse/router": "^10.0.0", "bcryptjs": "^2.4.3", "change-case": "^4.1.2", + "chatgpt-prompt-splitter": "^1.0.5", "colord": "^2.9.3", "composerize-ts": "^0.6.2", "country-code-lookup": "^0.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfacabd4..d463f716 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,6 +44,9 @@ dependencies: change-case: specifier: ^4.1.2 version: 4.1.2 + chatgpt-prompt-splitter: + specifier: ^1.0.5 + version: 1.0.5 colord: specifier: ^2.9.3 version: 2.9.3 @@ -3374,7 +3377,7 @@ packages: dependencies: '@unhead/dom': 0.5.1 '@unhead/schema': 0.5.1 - '@vueuse/shared': 10.6.1(vue@3.3.4) + '@vueuse/shared': 11.0.3(vue@3.3.4) unhead: 0.5.1 vue: 3.3.4 transitivePeerDependencies: @@ -4016,10 +4019,10 @@ packages: - vue dev: false - /@vueuse/shared@10.6.1(vue@3.3.4): - resolution: {integrity: sha512-TECVDTIedFlL0NUfHWncf3zF9Gc4VfdxfQc8JFwoVZQmxpONhLxFrlm0eHQeidHj4rdTPL3KXJa0TZCk1wnc5Q==} + /@vueuse/shared@11.0.3(vue@3.3.4): + resolution: {integrity: sha512-0rY2m6HS5t27n/Vp5cTDsKTlNnimCqsbh/fmT2LgE+aaU42EMfXo8+bNX91W9I7DDmxfuACXMmrd7d79JxkqWA==} dependencies: - vue-demi: 0.14.6(vue@3.3.4) + vue-demi: 0.14.10(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -4463,6 +4466,10 @@ packages: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: true + /chatgpt-prompt-splitter@1.0.5: + resolution: {integrity: sha512-8buXXnxZ5Y5BloPTMEhGTVld9vrVB8WVrUFrjgOpIJ4/VsT+rTnLszbaS1L1KAB0SDSCqj8GU472S2gMyhH8EA==} + dev: false + /check-error@1.0.2: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} dev: true @@ -9185,8 +9192,8 @@ packages: vue: 3.3.4 dev: false - /vue-demi@0.14.5(vue@3.3.4): - resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} + /vue-demi@0.14.10(vue@3.3.4): + resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} engines: {node: '>=12'} hasBin: true requiresBuild: true @@ -9200,8 +9207,8 @@ packages: vue: 3.3.4 dev: false - /vue-demi@0.14.6(vue@3.3.4): - resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} + /vue-demi@0.14.5(vue@3.3.4): + resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} engines: {node: '>=12'} hasBin: true requiresBuild: true @@ -9497,6 +9504,7 @@ packages: /workbox-google-analytics@7.0.0: resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} + deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained dependencies: workbox-background-sync: 7.0.0 workbox-core: 7.0.0 diff --git a/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue b/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue new file mode 100644 index 00000000..0802eb4f --- /dev/null +++ b/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/tools/ai-prompt-splitter/index.ts b/src/tools/ai-prompt-splitter/index.ts new file mode 100644 index 00000000..a1ea6bd8 --- /dev/null +++ b/src/tools/ai-prompt-splitter/index.ts @@ -0,0 +1,12 @@ +import { Prompt } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'AI Prompt Splitter', + path: '/ai-prompt-splitter', + description: 'Split a long document to multiple chat (ie ChatGPT) priompts', + keywords: ['ai', 'chatgpt', 'gpt', 'prompt', 'splitter'], + component: () => import('./ai-prompt-splitter.vue'), + icon: Prompt, + createdAt: new Date('2024-07-14'), +}); diff --git a/src/tools/index.ts b/src/tools/index.ts index 52bdf8e3..d122463b 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -1,6 +1,7 @@ import { tool as base64FileConverter } from './base64-file-converter'; import { tool as base64StringConverter } from './base64-string-converter'; import { tool as basicAuthGenerator } from './basic-auth-generator'; +import { tool as aiPromptSplitter } from './ai-prompt-splitter'; import { tool as pdfSignatureChecker } from './pdf-signature-checker'; import { tool as numeronymGenerator } from './numeronym-generator'; import { tool as macAddressGenerator } from './mac-address-generator'; @@ -155,7 +156,15 @@ export const toolsByCategory: ToolCategory[] = [ }, { name: 'Text', - components: [loremIpsumGenerator, textStatistics, emojiPicker, stringObfuscator, textDiff, numeronymGenerator], + components: [ + loremIpsumGenerator, + textStatistics, + emojiPicker, + stringObfuscator, + textDiff, + numeronymGenerator, + aiPromptSplitter, + ], }, { name: 'Data', From e9ac8f5a79791c689d195d142f1ef93e56945884 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 25 Aug 2024 21:42:18 +0200 Subject: [PATCH 2/4] fix: eslint --- src/tools/index.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/tools/index.ts b/src/tools/index.ts index 82316d6c..d2b90921 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -172,20 +172,13 @@ export const toolsByCategory: ToolCategory[] = [ { name: 'Text', components: [ - loremIpsumGenerator, - textStatistics, - emojiPicker, - stringObfuscator, - textDiff, - numeronymGenerator, aiPromptSplitter, - , asciiTextDrawer, ], }, From adb0249f2988ef86738694fa24901882091d6423 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 25 Aug 2024 21:52:53 +0200 Subject: [PATCH 3/4] fix: missing typedef --- src/tools/ai-prompt-splitter/chatgpt-prompt-splitter.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/tools/ai-prompt-splitter/chatgpt-prompt-splitter.d.ts diff --git a/src/tools/ai-prompt-splitter/chatgpt-prompt-splitter.d.ts b/src/tools/ai-prompt-splitter/chatgpt-prompt-splitter.d.ts new file mode 100644 index 00000000..c2a51cf3 --- /dev/null +++ b/src/tools/ai-prompt-splitter/chatgpt-prompt-splitter.d.ts @@ -0,0 +1,7 @@ +declare module "chatgpt-prompt-splitter" { + export default function promptSplitter(options: { + prompt: string + splitLength: number + newLine: boolean + }): Array; +} \ No newline at end of file From ed77345767179b3951694039f0533f4ab89d042b Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 15 Dec 2024 13:54:07 +0100 Subject: [PATCH 4/4] fix: spelling --- src/tools/ai-prompt-splitter/ai-prompt-splitter.vue | 2 +- src/tools/ai-prompt-splitter/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue b/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue index 0802eb4f..22491548 100644 --- a/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue +++ b/src/tools/ai-prompt-splitter/ai-prompt-splitter.vue @@ -46,7 +46,7 @@ const promptValidation = useValidation({ - +
diff --git a/src/tools/ai-prompt-splitter/index.ts b/src/tools/ai-prompt-splitter/index.ts index a1ea6bd8..e9ffff15 100644 --- a/src/tools/ai-prompt-splitter/index.ts +++ b/src/tools/ai-prompt-splitter/index.ts @@ -4,7 +4,7 @@ import { defineTool } from '../tool'; export const tool = defineTool({ name: 'AI Prompt Splitter', path: '/ai-prompt-splitter', - description: 'Split a long document to multiple chat (ie ChatGPT) priompts', + description: 'Split a long document to multiple chat (ie ChatGPT) prompts', keywords: ['ai', 'chatgpt', 'gpt', 'prompt', 'splitter'], component: () => import('./ai-prompt-splitter.vue'), icon: Prompt,