/gptel-extensions.el

Extra functions for gptel

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

gptel-extensions

Extra functions for gptel, a package that allows you to use OpenAI's GPT for text generation and completion directly from Emacs.

Installation

  1. Clone the repository to a local directory with:

    git clone https://github.com/kamushadenes/gptel-extensions.el.git
    
  2. Add the following to your Emacs init file (usually ~/.emacs or ~/.emacs.d/init.el):

    (add-to-list 'load-path "path/to/gptel-extensions")
    (require 'gptel-extensions)
    

    Replace path/to/gptel-extensions with the path where you cloned the repository.

  3. Restart Emacs, or evaluate the added code with M-x eval-buffer while in the init file.

Functions

gptel-extensions-send-whole-buffer

Send the whole buffer to ChatGPT.

gptel-extensions-ask-document

Load the current buffer into a session so you can ask questions about it.

gptel-extensions-rewrite-and-replace

Rewrite the region or sentence at point and replace it with the response. Extracted from the Wiki.

gptel-extensions-refactor

Refactor the region or sentence at point.

Variables

gptel-extensions-ask-document-prefix

Prefix to use when asking questions about a document. Defaults to:

Your task is to answer questions about the following document. If you don't know the answer, reply with "I don't know"

###### DOCUMENT START ######

gptel-extensions-ask-document-suffix

Suffix to use when asking questions about a document. Defaults to:


###### DOCUMENT END ######

### Question: 

gptel-extensions-refactor-directive

Directive to use when refactoring code. Defaults to:

You are a programmer. Refactor my code to improve readability. Reply only with the code.

Credits

This merely extends the amazing gptel by Karthik Chikmagalur, who performed all the hard work.