Obsidian text generator Plugin Text generator using GPT-3 (OpenAI)

Overview

Obsidian text generator Plugin

Text generator is a handy plugin for Obsidian that helps you generate text content using the powerful language model GPT-3.

Writing a small blog Article using AI in less than 5 minutes

To use Text generator: you need to create an account at OpenAI to get an API Key and configure the plugin's setting to use API Key.

Get Open AI API Key

To generate Open AI API Key.  Follow  the following steps:

  1. Create an account on OpenAI (you will get a free 18$ trial account).

  2. Click on your Account and click on View API keys

  1. Generate the API key that Text Generator Plugin will use

Configure Text Generator plugin

After installing the "Text generator plugin" and enabling it, you need to provide the generated API Key to the plugin.

Text generator Plugin

In-Text generator Plugin, there are four commands that I recommend you to set hotkeys for: "Generate text", "Generate Text (use Metadata)," "Increase max_tokens by 10", and "decrease max_tokens by 10".

Generate text

"Generate Text!"; it will generate a text with a max size of (max_tokens) using GPT-3 and insert it on the current cursor position based on cursor line content or the selected text.  You will see in the status bar "Text generator (max_tokens): processing..." while generating the text.

In version 0.0.2, you also have another option that is using the front matter information of the document while running the command by using "Generate Text (use Metadata)."  let's take as an example the following document.


---

title: "Obsidian + Text Generator Plugin: The More Affordable and Powerful AI Text Assistante Helper"

keywords: [AI Text Assistante Helper, text assistant helper, Jasper]

---

Write introduction 

Write conclusion 

By running "Write introduction " with Generate Text (use Metadata), Text Generator Plugin will append the metadata information and send the command like this.

title: "Obsidian + Text Generator Plugin: The More Affordable and Powerful AI Text Assistante Helper"
keywords: AI Text Assistante Helper, text assistant helper, Jasper
Write introduction

This command is useful if you want to use OpenAI more efficiently. Selecting the hole text every time will perhaps give better results, but the cost will be higher since OpenAI considers both input and output tokens. The idea here is to use a small meaningful context and append it with the running command to keep the generating text meaningful and cost-efficient.

Open AI API considers both Input and output tokens in their cost calculation [Open AI pricing] (https://openai.com/api/pricing/).

Control max_tokens

By setting hotkey for both commands, "Increase max_tokens by 10" and "decrease max_tokens by 10," you can easily control the size of the generated text.  The actual  max_tokens appears in the status bar 'Text generator (max_tokens):" .

To set a hotkey for a command, go to the "Settings" menu, then select the "Hotkeys" tab.  You will see a list of all the available commands, along with the associated hotkey.  Click on the desired command, then press the key combination you would like to use.  Make sure that another application does not already use the key combination.

Interact with GPT-3

There are several paid text editors based on GPT3.  You can, for example, search on YouTube about videos about on these editors and use the same prompts directly on GPT3 using Text Generator Plugin.

One of the most famous paid tools in the market is Jasper.  In Jasper, there are pre-built workflows known as Recipes that contain a series of Jasper (text editor based on GPT-3) prompts to help you create content with Jasper using a repeatable process. You can use the same commands to generate the content that you want!

Comments
  • No valid metadata (YAML front matter) found

    No valid metadata (YAML front matter) found

    Screen Shot 2022-11-28 at 08 57 52 Hi me again,

    this is the second error I've found. Maybe I've got a formatting error but I tried to cover all my bases before posting. This happens on macOS as well as on iOS.

    Best Raphael

    opened by rshklarek 10
  • Error since update

    Error since update

    Hi, Since the last update I keep getting an error. It is going through to OpenAI as I am being charged but the text isn't displaying on the obsidian page. It was working okay before I updated the plugin.

    Screenshot 2022-11-22 at 21 38 10 Screenshot 2022-11-22 at 21 42 52
    opened by platothefish 6
  • Mac default keybinding issue

    Mac default keybinding issue

    Along the same lines of #23 Text Generator: Template Packages Manager uses alt + 3 by default. This is how you type a # on a mac obviously this is used a lot when writing markdown.

    opened by MatthewAlner 5
  • Error 429

    Error 429

    Everytime I try to use the plugin lately I get error 429 (too many requests) but I'm not sending many requests at all

    getLine was called on line 0
    plugin:obsidian-textgenerator-plugin:200 {prompt: 'Explain the similarities and differences between quantitative and qualitative variables', max_tokens: 160, temperature: 0.7, frequency_penalty: 0.5}
    plugin:obsidian-textgenerator-plugin:93 Error: Request failed, status 429
        at new t (app.js:1:699529)
        at nw (app.js:1:699721)
        at app.js:1:700398
        at app.js:1:235201
        at Object.next (app.js:1:235306)
        at a (app.js:1:234045)
    
    opened by brimwats 5
  • [Bug] Command Palette

    [Bug] Command Palette "Set max_tokens" using "enter" auto-submits Popup

    Obsidian 1.03 on MacOS

    Steps:

    • Open Command Palette with Command+P
    • Type "Text" to highlight the Command "Text Generator: Set max_tokens"
    • Press "Enter" Button

    Expected:

    • Popup Dialog shows to edit the max_tokens

    Observed:

    • Popup Dialog flashes for some milliseconds ;)
    • (probably) saves the existing setting
    • shows a toast in the upper right corner

    Screen Recording 2022-12-06 at 18 27 25 (1)

    Remark: Option/Alt+1 opens the Popup Dialog without Problems

    Thanks for the great plugin & BR Günther

    opened by limex 4
  • plugin error v1.2

    plugin error v1.2

    Hello, in v1.1 there was an error message when pressing Ctrl+J or executing the command from the sidebar. Shortly after you released v1.2 to fix it but the error is still there :( image

    opened by DavitCH 4
  • Plugin hangs at processing

    Plugin hangs at processing

    I installed the latest version of the plugin, I've updated Obsidian to the latest version. I tried one of your examples with the frontmatter. When I want to generate text, the statusbar hangs on Text Generator(160):processing... I restarted the app a few times but no luck. I also made a brand new vault without other plugins but still the same behaviour. Is there a way to debug this? I am a bit familiair with the developers tools and network window, but I'm not quite sure where to pay attention to.

    Thanks

    opened by frankmeeuwsen 4
  • Problem with frontmatter

    Problem with frontmatter

    Hi,

    If I try to use any frontmatter input, I always get the error message "Please provide a valid frontmatter!"

    I tried to open a fresh vault (obsidian version 0.14.15) with only the textgenerator plugin installed (version 0.0.8), but the error persisted. The used input used was just:

    ---
    title: "How to write a youtube video"
    ---
    
    Brain storming ideas 
    

    Generating text with just selecting it, works fine.

    opened by Falerion-git 4
  • [Feature Request] Allow to select/set/use custom model nams

    [Feature Request] Allow to select/set/use custom model nams

    Hey there! Thank you for putting this plugin together.

    Since I mostly use my own trained models, could you possibly add an option to select (or simply provide a textfield for the name) for using a custom model?

    That would be amazing! Thank you.

    enhancement 
    opened by akaalias 4
  • [Bug] Options - Changing

    [Bug] Options - Changing "Prompts Templates Path" before downloading templates cause an empty "Insert Template" list

    It appears that there's a bug where the downloaded Prompt templates are not installed correctly if a different prompt template path is set in Options.

    Steps to reproduce:

    1. Install and enable plugin
    2. Go to Options and change "Prompts Templates Path" to a different path (e.g., "openai/prompts")
    3. Use Ctrl+P and open the "Template Package Manager"
    4. Install any of the Prompt packages
    5. Try to insert a Template using the "Insert Template" command

    Actual Result:

    • The "Insert Template" pop-up shows an empty list.

    The templates are installed to the default path: "textgenerator/prompts, instead of the path set in the Options.

    Please let me know if you need more details.

    Thank you for this wonderful plugin! William

    opened by willmartinss 3
  • `cmd+Q` should not be used as hotkey on mac

    `cmd+Q` should not be used as hotkey on mac

    With the new version, cmd+Q seems to be used as default hotkey. This should be avoided, since cmd+Q is the default macOS keybinding for quitting an app. (equivalent to alt+f4 on windows)

    Pasted image 2022-11-21 14 27 00
    opened by chrisgrieser 3
  • [Feature Requests] Template-related features

    [Feature Requests] Template-related features

    Might be a bit premature since it looks like templates are not fully out yet, apologies if some of these are already planned. Some of these are probably bugs.

    Escapes and text replacements:

    1. custom escape characters, through helper function
    2. substring helper function, and corresponding documentation :P
    3. text search and replace
    4. text search and index

    Children: 5. avoiding overlap for children; currently the same child can be included multiple times in the children array 6. *option to avoid self-child; currently the parent note can be included in the children array 7. option to generate headings for children 8. including children of children; currently child notes of children are inaccessible

    *has workaround using #if, but imo having this option is better

    Links and Embeds: 9. option to exclude headers when including header contents 10. including referenced blocks; the contents of blocks of the form [[note#^blockref]] seem to not be included anywhere 11. option to include or exclude referenced blocks from children; 12. option to replace embedded internal links with their contents; of the form ![[note]] or ![[note#^blockref]] 13. *option to remove or replace embedded internal links to non-notes; for instance ![[image.png]]

    *has workaround if text search and replace or text search and index + substring are implemented, but cumbersome

    Quality of Life & misc: 14. option to exclusively use {{headings.heading}} instead of {{heading}}, to ensure consistency (eg for a heading called "context") 15. *option to show multiple responses to pick and choose between them; ie the n parameter from OpenAI's Completion API 16. *option to retrieve and view logprobs from OpenAI, as well as the tokens 17. insert template to clipboard

    *probably a lot of work

    The Part where I Write a Lot (More):

    Hi! I'm loving this plugin so far, and really appreciate what you're doing! I'm loving the concept of templates so far, but a lot of these features will make it more practical for my use case. I hope you'll consider implementing some of these. Here I'll try to explain motivations and/or vague potential implementation features:

    1: default is HTML escaping, but to my knowledge OpenAI works with JSON(L) format, and I'm not sure if escaping for JSON currently exists? can replace with a simple helper for JSON escaping, but I suggested a search-and-replace since it could work for all potential future AI-as-a-service APIs 8: potentially a field in the plugin options, but also consider writing it as a helper function, although I don't know if helpers are allowed to have side effects. This helper function takes an integer max_depth 9: again, potentially a toggle in the plugin options, but would be nice to be a helper function instead? or can be a {{headings.heading.title}} and {{headings.heading.content}}, but that seems unnecessarily verbose 10: consider a references that is separate from children. Also consider generating references for children (11). 12, 13: could group .txt under 12 instead of 13, although that's probably unimportant for most people 14: please 15, 16: this would imply the creation of a temporary file at best, or at worst a custom popup/window; additionally for the vast majority of people this is probably completely irrelevant. Personally, seeing logprobs for longform text allows me to read into the intent of GPT, and sometimes good information can be found by looking at what GPT would have said. Still, not exactly the most commonly used feature, and (17) is a good enough replacement where I can just paste into the OpenAI playground.

    opened by H1410101 0
  • [feature request] Support for the Editing endpoints/models

    [feature request] Support for the Editing endpoints/models

    Given the Obsidian context, I think it would be awesome to be able to select the editing endpoints/models (potentially with a different command?)

    The edits endpoint can be used to edit text, rather than just completing it. You provide some text and an instruction for how to modify it, and the text-davinci-edit-001 model will attempt to edit it accordingly. This is a natural interface for translating, editing, and tweaking text. This is also useful for refactoring and working with code. Visit our code guide to learn more. During this initial beta period, usage of the edits endpoint is free.

    enhancement 
    opened by phillipjohnston 0
  • FR: Have Commands with different preset token values

    FR: Have Commands with different preset token values

    Exploring the plugin, I found that I frequently switch between two token amounts: 100 tokens for finishing a sentence, and 500 tokens for writing a short paragraph.

    Right now, that means frequently using the "change max tokens" command. I think this could be streamlined by being able have commands/hotkeys for each separate token amounts. For example:

    • Command 1: Generate Text (with 100 tokens)
    • Command 2: generate text (with 500 tokens)

    and then I simply have two hotkeys, instead of constantly changing the token amount between the two values.

    opened by chrisgrieser 2
  • Bug: Append generated text to the end of the line, not at cursor position

    Bug: Append generated text to the end of the line, not at cursor position

    right now, when the cursor is in the middle of the line and I trigger "generate text", it enters the text right at the cursor position, although it should be appended to the line instead.

    (also, and this is mostly minor, when appending, and the last character is not a space, it should add a space, so that you don't always to do that manually.)

    bug 
    opened by chrisgrieser 2
  • Differentiate between Instruction and Completion?

    Differentiate between Instruction and Completion?

    First of all, thank you so much for the plugin!

    Consider the following three scenarios:

    1. I have some text, and want the AI to complete the text, for example finishing a sentence I started.
    2. I have an instruction, and want the AI to write text based on that prompt, for example "outline a blogpost about x"
    3. I have text and an I have an instruction, for example "rewrite that sentence, but in simpler language"

    How exactly do I use the plugin for these different scenarios? Experimenting with the plugin a bit, it seems that even the basic "generate text" command covers all three cases, depending on how I phrase the input text. But to me, it feels like having three commands for the three different scenarios would make this far more intuitive and also more clear in case of what happens in scenario 3.

    opened by chrisgrieser 0
Releases(0.1.22)
Owner
null
A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI GPT-3.

GitHub Repo Recommendation Writer A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI

Viktor Bezdek 5 Jul 18, 2022
A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Carlo Zottmann 6 Dec 26, 2022
A simple slack app / bot starter that fetches answers to questions using Langchain, OpenAI and a Pincone vectorstore

Slack-GPT Table of Contents Introduction Prerequisites Creating and installing the application Configuration Starting the app Next Steps Sample Implem

Martin Hunt 51 Jul 30, 2023
A plugin for GPT-3 AI assisted note taking in Logseq

logseq-plugin-gpt3-openai A plugin for GPT-3 AI assisted note taking in Logseq Usage Just type /gpt3 in a block or select gpt3 from the block menu. Se

Brian Sunter 301 Jan 3, 2023
Generate #techtwitter tweets with OpenAI via Telegram.

Responsible AI Hot Takes Generate and tweet awesome #techtwitter content with OpenAI via Telegram. After following FireShipIO's tutorial and hearing o

null 8 Mar 19, 2022
Next.js template for 🍌 Banana deployments of OpenAI Whisper.

Next.js Template for OpenAI Whisper ?? This is a Next.js template for ?? Banana deployments of Whisper on serverless GPUs. This is a great way to demo

zahid 23 Jan 1, 2023
Obsidian plugin: Type text shortcuts that expand into javascript generated text.

Obsidian Plugin - Text Expander JS (open beta) This Obsidian plugin allows the user to type text shortcuts that are replaced by (or "expanded into") j

Jon Heard 79 Dec 27, 2022
An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor.

Obsidian Excel to Markdown Table An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor. Demo You can paste the copied Excel d

Ganessh Kumar 108 Jan 4, 2023
This is a plugin for Obsidian (https://obsidian.md). Can open document with `.html` and `.htm` file extensions.

Obsidian HTML reader Plugin This is a plugin for Obsidian (https://obsidian.md). Can open document with .html and .htm file extensions. Obsidian HTML

null 37 Dec 27, 2022
An Obsidian plugin that lets you browse the web within Obsidian.

Obsidian Web Browser An Obsidian plugin that allows you to browse the web within Obsidian using v1.0 tabs. The core functionality of the plugin, rende

Dion Tryban 102 Dec 28, 2022
A simple gpt-3 integration with Logseq

Readme Using GPT-3 in [[logseq]] is actually remarkably easy. The folks over at OpenAI have built a really powerful model with pretty good documentati

null 26 Jul 19, 2022
App that leverages GPT-3 to facilitate new language listening and speaking practice.

Talk w/GPT-3 app: Getting started The Talk w/GPT-3 application was developed by James L. Weaver (the author of this document) to get more new language

James Weaver 47 Jan 1, 2023
GPT-3 powered cli tool to help with bash commands you can't remember

qwery GPT-3 powered cli tool to help with bash commands you can't remember eg $ qw ffmpeg command to transcode mp4 to mov QWERY RESULT: ffmpeg -i inpu

Aaron Peddle 4 Oct 31, 2022
This repository contains a fullstack chatbot project based on the ChatGPT `gpt-3.5-turbo` model.

This is a fullstack chatbot created with React, Nodejs, OpenAi, and ChatGPT while developing the following tutorial: How To Build A Chat Bot Applicati

NJOKU SAMSON EBERE 6 May 10, 2023
An example implementation of the slack-gpt starter which ingests confluence pages to create a helpful slack bot

Slack-GPT (HR bot example implementation) Table of Contents Introduction Prerequisites Creating and installing the application Configuration Starting

Martin Hunt 17 Jul 31, 2023
Chat with GPT from the terminal, with the ability to execute shell scripts.

ChatSH Chat with GPT from the terminal, and let it execute shell scripts and perform tasks for you. What could go wrong? Example Why? The reason I'm p

Victor Taelin 47 Jun 11, 2023
yet another 2048, but this time it's controlled by GPT

2048 About a few years ago, I built 2048.wasm This is yet another 2048 from me, but this time it's controlled by GPT. Demo 2048-short.mov How GPT crus

Nishchith Shetty 43 Jul 17, 2023
Obsidian-dataview-table-filter-menu - Dynamically created filter menu for dataview tables in obsidian

Dataview table Filter Menu for Obsidian Dynamically created filter menu for data

shiro 17 Sep 24, 2022
Obsidian-Snippet-collection - A collection of snippet to customize obsidian

This repo is a collection of CSS snippets for Obsidian.md. To install them on PC

Mara 110 Dec 22, 2022