Skip to content

Implement retry mechanism for LLM translator #8

@vitonsky

Description

@vitonsky

I've just tried to use with google/gemma-4-26b-a4b-it model.
Sometimes this model gives a broken JSON:

{
	"notesList.search.placeholder": "Hledat...",
	"notesList.filterBy": "Filtrovat podle",
	"notesList.empty": "Zatím zde nejsou žádné poznámky. <create>Vytvořit poznámku</create>",
	"notesView.allNotes": "Všechny poznámky",
	"notesView.favorites": "Oblíbené poznámky",
	"notesView.archived": "Archivované poznámky",
	"notesView.deleted": "Smazané poznámky",
	"notesContainer.empty.placeholder": "Vyberte poznámku pro čtení nebo úpravu",
	"activityBar.newNote": "Nová poznámka",
	"activityBar.files": "Soubory",
	"activityBar.reminders": "Upomínky",
	"activityBar.extensions": "Doplňky",
	"activityBar.inbox": "Schránka",
	"activityBar.publishNotes": "Publikování poznámek",
	"activityBar.lockVault": "Uzamknout úložiště",
	"activityBar.globalSettings": "Globální nastavení",
	"tabBar.closeTab": "Zavřít kartu",
	"editorPanel.header.insertTitle": "Kliknutím vložíte nadpis úrovně {{level}}. V kontextovém menu můžete zvolit jinou možnost",
	"editorPanel.header.level": "Úroveň nadpisu {{level}}",
	"editorPanel.bold": "Tučné písmo",
	"editorPanel.italic": "Kurzíva",
	"editorPanel.strikethrough": "Průřezový text",
	"editorPanel.unorderedList": "Odrážkový seznam",
	"editorPanel.checkboxList": "Seznam s zaškrtávacími políčky",
	"editorPanel.orderedList": "Číslovaný seznam",
	"editorPanel.codeBlock": "Blok kódu",
	"editorPanel.quoteBlock": "Citát",
	"editorPanel.insertDate": "Vložit datum",
	"editorPanel.insertPageBreak": "Vložit zalomení strany",
	"editorPanel.insertFile": "Vložit soubor",
	"editorPanel.image.buttonTitle": "Vložit obrázek",
	"editorPanel.image.dialogTitle": "Přidat obrázek",
	"editorPanel.image.dialogDescription": "Obrázek bude vložen na místo kurzoru.",
	"editorPanel.image.field.url.label": "URL adresu obrázku",
	"editorPanel.image.field.url.placeholder": "např. https://example.com/image.png",
	"editorPanel.image.field.altText.label": "Alt text obrázku (volitelné)",
	"editorPanel.image.field.altText.placeholder": "Stručný popis obrázku",
	"editorPanel.image.actions.add": "Přidat",
	"editorPanel.image.actions.cancel": "Zrušit",
	"editorPanel.link.buttonTitle": "Vložit odkaz",
	"editorPanel.link.dialogTitle": "Přidat odkaz",
	"editorPanel.link.dialogDescription": "Označený text se změní na odkaz, nebo bude odkaz vložen na místo kurzoru.",
	"editorPanel.link.field.url.label": "URL adresu odkazu",
	"editorPanel.link.field.url.placeholder": "např. https://example.com",
	"editorPanel.link.actions.add": "Přidat",
	"editorPanel.link.actions.cancel": "Zrušit",
	"image.loading": "Načítání obrázku",
	"image.brokenImage": "Obrázek nelze načíst",
	"notifications.title": "Upozornění",
	"updates.appUpdate.title": "Aktualizace aplikace",
	"updates.appUpdate.reminderLater": "Upomínka se zobrazí za týden",
	"updates.newVersion.title": "K dispozici je nová verze",
	"updates.newVersion.body": "Nová verze je připravena. Aktualizujte pro získání nejnovějších vylepšení a oprav.",
	"updates.newVersion.download": "Stáhnout novou verzi",
	"updates.newVersion.ignore": "Ignorovat",
	"contextMenu.imageProperties.title",
	"Vlastnosti obrázku",
	"contextMenu.imageProperties.urlLabel": "URL adresu obrázku",
	"contextMenu.imageProperties.altLabel": "Alt text obrázku",
	"contextMenu.linkProperties.title": "Vlastnosti odkazu",
	"contextMenu.linkProperties.urlLabel": "URL adresu odkazu",
	"statusBar.sync.title": "Uložit změny na disk",
	"statusBar.sync.saving": "Ukládání změn...",
	"statusBar.changeVault": "Změnit úložiště",
	"statusBar.history": "Historie",
	"statusBar.notifications": "Upozornění"
}

Let's implement some retry mechanism to let chunkTranslator get known about error and continue with no state loss.
Ideally the LLM translator would continue chat with LLM and send it something like Uncaught SyntaxError: JSON.parse: expected ':' after property name in object at line 57 column 37 of the JSON data. And LLM would return the fixed version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions