Plugin découvert en lisant [Photoshop for text](https://stephanango.com/photoshop-for-text). Possède à présent un - compte Twitter [@TextGenPlugin](https://twitter.com/TextGenPlugin) - [site web](https://text-gen.com/) - [Discord](https://discord.gg/BRYqetyjag) > [!info]+ > Référence à Text Generator dans > - [[15 exemples concrets d'utilisation en classe de l'IA]] > - [[Écriture et IA]] # Comment l'installer Lire [Obsidian Textgenerator Plugin](https://github.com/nhaouari/obsidian-textgenerator-plugin) pour comprendre comment procéder. En gros, 1. Create an account on [OpenAI](https://beta.openai.com/signup) 2. Click on your `Account` and click on `View API keys` 3. Generate the API key that Text Generator Plugin will use 4. After installing the "Text generator plugin" and enabling it, you need to provide the generated API Key to the plugin ## Shortcuts Shortcuts to use the plugin - `cmd + j` - `cmd ⌥ 1` - `cmd ⌥ 2` - `cmd ⌥ j` Je l'utilise le plus souvent en tapant `cmd + p` et tape "text..." puis choisis l'option désirée. # Updates Peut à présent intégrer des images générées avec Dall.e. Prompt à utiliser : `Generate and insert template`. Lire https://docs.google.com/document/d/11WlzjBT0xRpQhP9tFMtxzd0q6ANIdHPUBkMV-YB043U/edit Important apport : [les templates](https://text-gen.com/templates) permettant de tirer partie plus finement de GPT mais aussi de [Huggingface](https://huggingface.co/welcome). <iframe width="560" height="315" src="https://www.youtube.com/embed/OergqWCdFKc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> # Usages 1. `cmd + P` 2. Text Generator 3. Generate and Insert Template 4. Sélectionner le template voulu, par exemple 1. `Summarize` 2. `Simplify` 3. `Rewrite` 4. `Get Tags` 5. `Get Titles` 6. `Get Paragraph` 7. `Get Ideas` 8. `Get Email Negatively` (i.e. *reply to this email negativly in professional way*) 9. `Get Email Positively` (i.e. *reply to this email positively in professional way*) Lire en particulier - [Template File Metadata](https://text-gen.com/template-file-metadata) - [Context available for templates](https://text-gen.com/context-available-for-templates) Penser à aller d'abord dans Text Generator: *Templates Packages Manager* (dans la barre latérale gauche d'Obsidian) et installer les templates > [!info]+ Voir également > Le plugin [GPT3 Notes](https://github.com/micahke/obsidian-gpt3-notes) --- # Tutorials <iframe width="560" height="315" src="https://www.youtube.com/embed/tNAsLbGdM6A?si=vXNpvkOIBSdsKIs1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> 3 ways of selecting text (5:21): 1. Selected text (you select whatever you need and press cmd + J) 2. Cursor line not empty 3. Cursor line is empty (it will send everything you have before your cursor) Brainstorm using other notes ([09:13](https://youtu.be/tNAsLbGdM6A?si=winFIn-r9c2PKNdp&t=548)): 1. Go to plugin settings 2. Toggle on `includeChildren` inside `Considered Context For Templates` 3. Create a template (insert it in the `textgenerator` folder > `local`): ```JS --- PromptInfo: promptId: brainstormChildren name: brainstorm ideas about children notes author: tags: version: 0.0.1 --- context: {{#each children}} {{this.content}} {{/each}} prompt: brainstorm ideas about context Ideas: * ``` 4. In a note, insert any link to another note using wikilinks. 5. Typing `cmd + P`, then `Text Generator then Generate` and `Insert Template` 6. Choose the name of the template, i.e. `brainstorm ideas about children notes` --- I made this template to get a quiz from any note (inspired by [this tweet of the plugin's author](https://x.com/haouarin/status/1646285359297249281?s=20)): ```js --- PromptInfo: promptId: quiz name: quiz about children notes author: yann tags: version: 0.0.1 --- context: {{#each children}} {{this.content}} {{/each}} prompt: Create a quiz of five questions, go to the line and provide the answer in a foldable callout using Obsidian's Markdown syntax. The callout starts like this: > [!tip]-. Don't forget to go to the line again and add another angle bracket when giving the hidden answer. Remember that we do want to hide the answer in the foldable callout. So use the minus sign after > [!tip]. ``` ➝ [[Example Text Generator]] ➝ [[Script Text Generator]] ## How it works (video) ![[PluginTextGenerator-compressé.mp4]] Alternatively, you could copy and paste the content of your note and write the following code: ```` ```tg Ask me 5 questions about {{content}} ``` ```` You can get some ideas based on the title of your note: ````` ```tg Get an outline of {{title}} ``` ````` [Use variables](https://docs.text-gen.com/_notes/Templates/01+Understanding+Context) to refer to any section of your not: - `{{title}}` - `{{content}}` - `{{clipboard}}` Voir ce que l'on peut faire de ce script : ```js {{#set "randomFile"}} {{getRandomFile "input" 100 1500}} {{/set}} {{#script}} // Function to generate questions and answers from a given text async function generateQA(text) { const prompt = `Generate questions/answers about the following content: \n${text}\nFormat: json array of the following object {'question','answer'}`; // Call a function to generate questions and answers (assumed to be 'gen') let qaData = JSON.parse(await gen(prompt)); // Format the questions and answers in markdown return qaData.map(item => { let formattedAnswer = item.answer.split('\n').map(line => `> ${line}`).join('\n'); return `> [!question]- ${item.question}\n${formattedAnswer}`; }).join('\n\n'); } return await generateQA(this.vars.randomFile) {{/script}} ``` --- [Obsidian Notes](https://www.patreon.com/posts/81545279?pr=true) (➝ [Fantasy Generators.zip](https://www.patreon.com/file?h=81545279&i=13763333)) <iframe width="560" height="315" src="https://www.youtube.com/embed/X9tlAZC6DSU?si=OdovWv6DAKl4f2ok" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/eQz4eAW3ZDk?si=5IOVZTCz-gSh1qh4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>