• Stars
    star
    820
  • Rank 55,603 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 2 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A (nearly) seamless integration of ChatGPT into Obsidian.

ChatGPT-MD

A (nearly) seamless integration of ChatGPT into Obsidian.

Demo

Screen.Recording.2023-03-05.at.9.16.31.PM.mov

(youtube mirror - for mobile users ⬇️)

video thumbnail

Features

  • Chat from any MD note
  • Create Chat Templates for sharing and running similar scenarios. Check out the companion repo chatgpt-md-templates for some templates!
  • As minimal boilerplate as possible, only two required in fact! <hr class="__chatgpt_plugin"> and role::system|assistant|user
  • Use frontmatter to change variables for the ChatGPT API
  • Stream characters to Obsidian, creating a realtime feel
  • Uses regular Markdown. Meaning everything from lists to code blocks from ChatGPT will render!
  • Create chats from highlighted text.
  • Infer title from messages. Can be set to run automatically after >4 messages.
  • Stream at cursor position or at end of file. Can be set in settings.
  • Choose heading level for role h1-h6. Can be set in settings.
  • Custom endpoints can be specified using the url parameter in your front matter. See FAQ for an example.
  • Stop a running stream with a command. See commands section below.
  • (NEW!) Choose between nine languages for "Infer Title". Can be set in settings.
  • (NEW!) ChatGPT comment blocks. Allows you to leave scratchpad notes, backlinks...or anything else really!! See command below for details.

Commands

Chat

The main command! Parses the file and calls ChatGPT. Recommended to add to a hotkey for easy usage.

Create New Chat with Highlighted Text

Take currently highlighted text and default frontmatter and create a new chat file in Chat Folder

Create New Chat From Template

Create a new chat file from a template specified in Chat Template Folder. Remember to check out chatgpt-md-templates for some templates!

Infer Title

Infer the title of the chat from the messages. Requires at least 2 messages. Can be set in settings to run automatically after >4 messages.

Add comment block

Add a comment block to the editor that will not be processed by ChatGPT. Allows you to leave scratchpad notes, backlinks...or anything else really!

Comments begin with =begin-chatgpt-md-comment and end with =end-chatgpt-md-comment

Screenshot 2023-04-03 16-47-05 Screenshot 2023-04-03 16-59-26

Clear Chat

Removes all messages but leaves frontmatter

Stop Streaming (Does not work on mobile)

Stops the stream. Useful if you want to stop the stream if you don't like where ChatGPT is heading/going too long.

Add Divider

Add a ChatGPT MD Horizontal Rule and role::user.

!! Note: both role::system|assistant|user AND <hr class="__chatgpt_plugin"> are REQUIRED for the plugin to work!!

Installation

Community Plugins

Go to Community Plugins and search ChatGPT MD

Local

  1. Clone this repo into your plugins directory in your vault
  2. Run npm i and npm run build

Both

  1. Insert your OpenAI API Key into the settings
  2. Set Chat Folder and Chat Template Folder
  3. Add a hotkey for Chat (Im using alt-[)

FAQ

Q: The chat seems to be getting cut off halfway through

To address this, first try to increase your max_tokens (default is set to 300). You may also want to update it more permanently in the default frontmatter settings. See pics below:

Screenshot 2023-03-12 16-14-35 Screenshot 2023-03-12 16-15-01

Q: Code Blocks cut off halfway through and leave ```

The Obsidian editor renders backticks in automatically (see issue) and fires extra logic that causes the stream to add extra backticks. To address this, you can:

  1. at the end of the code block add ``` (three backticks) to close the code block BEFORE the <hr> and delete the three extra Obsidian added automatically.
  2. in role::user write "keep going"

See pics below:

Screenshot 2023-03-15 18-47-40 Screenshot 2023-03-15 18-48-30

Q: How do I use GPT-4?

If you are off the waitlist, simply replace model: gpt-3.5-turbo with model: gpt-4 in the frontmatter. (note: gpt-4 is slower than turbo!)

Q: How do I use a custom endpoint?

---
system_commands: ['I create small self contained app ideas that could fit in a CodePen or a Replit']
url: https://localhost
---

The custom API must conform to the OpenAI API spec. eg you could use Azure's OpenAI hosted endpoints here. Refer to your provider for API key handling.

About the Developer

This repository was written by Bram Adams, a writer and programmer based out of NYC.

Bram publishes a Zettelkasten with a twice/weekly newsletter, is a community developer ambassador for OpenAI, and does freeleance contracts (for hire!) related to AI/web dev/AR+VR.

Bram is also the creator of Stenography, an API and VSC Extension that automatically documents code on save. He also is the author of Bramses' Highly Opinionated Vault, an extremely detailed philosophy + vault template used by hundreds of Obsidian users, new and old.

You can learn more about him and his work on his website.

The best way to support his work is to sign up for his newsletter here.

More Repositories

1

bramses-highly-opinionated-vault-2023

A highly opinionated, fully featured Obsidian vault that can get you from Zero to Zettelkasten lickety split!
JavaScript
1,030
star
2

chatgpt-md-templates

A companion folder of templates for ChatGPT MD.
82
star
3

commonplace-bot

An LLM augmented commonplace book, available for public viewing
JavaScript
54
star
4

summarize-with-gpt3-obsidian

Summarize text with GPT-3 in Obsidian (progressive summarization)
TypeScript
39
star
5

obsidian-stack-overflow

Fetch Stack Oveflow answers and copy paste them directly into Obsidian
TypeScript
32
star
6

stenography-obsidian

TypeScript
25
star
7

quoordinates

Use OpenAI Embeddings to visualize Kindle Highlights from Readwise!
JavaScript
22
star
8

openai-embeddings-ts

TypeScript
21
star
9

comde

GPT Code Descriptor and Markdown Creator
TypeScript
14
star
10

GPT-3-in-Production

From O'Reilly Class GPT-3 in Production
JavaScript
10
star
11

youtube-transcript-obsidian

Transcribe a Youtube video's captions with timestamps into Obsidian MD format
Python
10
star
12

gpt-to-chatgpt-py

Convert a regular GPT call into a ChatGPT call
Python
9
star
13

codex-live-texting-twilio

codex + twilio + livereload
JavaScript
5
star
14

xegos

TypeScript
4
star
15

i-aint-reading-all-that

voice record > whisper > gpt > copy to clipboard
Swift
4
star
16

URStudying

The GitHub for URStudy!
JavaScript
4
star
17

awesome-stenography

A collection of cool Stenography examples
Go
4
star
18

orbit-levels-p5-visualization

Solar System viz for Orbit!
JavaScript
4
star
19

gpt-to-chatgpt-ts

Convert GPT Completion call to a ChatGPT call
TypeScript
3
star
20

ghost-to-nomic

Upload your Ghost blog posts as a Nomic Map
Python
3
star
21

gpt3-playground-notion

JavaScript
2
star
22

kh-portfolio

Kingdom Hearts Portfolio
HTML
2
star
23

sparkar-avatar-state

JavaScript
2
star
24

chatgpt-md-canvas

a canvas version of chatgpt-md
TypeScript
1
star
25

eleven-labs-obsidian

eleven labs integration w obsidian
TypeScript
1
star
26

semantic-search-markdown

TypeScript
1
star
27

sonicpi

sonic pi songs
Ruby
1
star
28

vsc-blocks-notion

TypeScript
1
star
29

chronology-demo

Python
1
star
30

monorepo

all of my projects and automations that i use frequently -- in one place
Go
1
star
31

obsidian-audio-alchemiser

Alchemize boring text notes into exciting audio notes!
TypeScript
1
star
32

welcome.gallery

JavaScript
1
star
33

p5-experiments

JavaScript
1
star
34

obsidian-mind-palace

JavaScript
1
star
35

ios-shortcuts-twilio

JavaScript
1
star
36

react-creative-code

JavaScript
1
star
37

stenography-autopilot-render

JavaScript
1
star
38

3d-clothing-carousel

JavaScript
1
star
39

gitLastDay

Return a list of the commits for an author using git log from yesterday
JavaScript
1
star
40

awesome-stars

1
star
41

commonplace-daily-digest

Ping Readwise API for daily quotes and convert them into HTML for your blog
Python
1
star
42

commonbase-prototype

a postgres db for a commonbase
C
1
star
43

quo-host

podcast co host with automagic quote surfacing and realtime highlighting. great for youtube!
Python
1
star
44

awesome-checklists

Inspired by http://atulgawande.com/book/the-checklist-manifesto/
CSS
1
star
45

kindle-streamer

Use OCR and DallE to make visual bookmarks for your Kindle reading experience
Python
1
star
46

weekly-digest-gpt

This program automatically extracts the latest weekly file from a specified Obsidian directory and uses GPT-4 to generate a summarised weekly digest.
JavaScript
1
star