feat: pictures for the assistant - the models make and edit them by themselves through the Vertex API (a new picture, or the user's attached photo, or the last picture made), with an API key in Настройки and a switch for the prompt improver; folded descriptions of pictures and searches; the name of an attached file opens or saves it; a deleted chat is wiped from the database files, attachments included

This commit is contained in:
redtea committed 2026-10-18 12:12:54 +03:00
1 parent c72fcfebf3
commit dd1244a169
13 files changed
+925 -20

No files matched your search

+17
View File
@@ -85,3 +85,20 @@ test('parseActions: fetch blocks', () => {
assert.deepStrictEqual(U.parseActions('```fetch\nhttps://go.dev/doc/go1.24\n```'),
[{kind: 'fetch', machine: '', path: '', body: 'https://go.dev/doc/go1.24'}]);
});
test('parseActions: image blocks - a new picture, or an edit, with format, quality and file name in the first line', () => {
assert.deepStrictEqual(U.parseActions('Рисую.\n```image\nкот в скафандре на луне\n```'),
[{kind: 'image', machine: '', path: '', body: 'кот в скафандре на луне', edit: false, enhance: true, ratio: '', model: '', file: ''}]);
assert.deepStrictEqual(U.parseActions('```image 16:9 artist\nзакат над морем\n```'),
[{kind: 'image', machine: '', path: '', body: 'закат над морем', edit: false, enhance: true, ratio: '16:9', model: 'artist', file: ''}]);
assert.deepStrictEqual(U.parseActions('```image edit my photo.jpg 0.2plus\nубери человека справа\n```'),
[{kind: 'image', machine: '', path: '', body: 'убери человека справа', edit: true, enhance: true, ratio: '', model: '0.2plus', file: 'my photo.jpg'}]);
assert.deepStrictEqual(U.parseActions('```image edit\nсделай ночь\n```')[0].file, '');
assert.strictEqual(U.parseActions('```image\nне закрыт').length, 0);
});
test('parseActions: image blocks - noenhance asks for the description as it is', () => {
assert.deepStrictEqual(U.parseActions('```image noenhance 3:2\nflat vector logo, white background\n```'),
[{kind: 'image', machine: '', path: '', body: 'flat vector logo, white background', edit: false, enhance: false, ratio: '3:2', model: '', file: ''}]);
assert.strictEqual(U.parseActions('```image enhance\nx\n```')[0].enhance, true);
});