Commit graph

29 commits

Author SHA1 Message Date
Karthik Chikmagalur
50a2498259 README: Tweak instructions for local LLMs, mention #120 2023-11-07 20:36:37 -08:00
Karthik Chikmagalur
63027083cd README: Update additional customization section 2023-10-29 14:24:39 -07:00
Karthik Chikmagalur
6af89254b7 README: Document breaking changes (mainly gptel-host deprecation) 2023-10-29 09:51:17 -07:00
Karthik Chikmagalur
1434bbac7b gptel-ollama, gptel-openai: Add example of backend creation
README: Fix error with Ollama backend instructions
2023-10-29 00:31:56 -07:00
Karthik Chikmagalur
6419e8f021 gptel: Add multi-llm support
README.org: Update README with new information and a multi-llm demo.

gptel.el (gptel-host, gptel--known-backends, gptel--api-key,
gptel--create-prompt, gptel--request-data, gptel--parse-buffer, gptel-request,
gptel--parse-response, gptel--openai, gptel--debug, gptel--restore-state,
gptel, gptel-backend):

Integrate multiple LLMs through the introcution of gptel-backends. Each backend
is composed of two pieces:

1. An instance of a cl-struct, containing connection, authentication and model
information.  See the cl-struct `gptel-backend` for details.  A separate
cl-struct type is defined for each supported backend (OpenAI, Azure, GPT4All and
Ollama) that inherits from the generic gptel-backend type.

2. cl-generic implementations of specific tasks, like gathering up and
formatting context (previous user queries and LLM responses), parsing responses
or responses streams etc.  The four tasks currently specialized this way are
carried out by `gptel--parse-buffer` and `gptel--request-data` (for constructing
the query) and `gptel--parse-response` and `gptel-curl--parse-stream` (for
parsing the response).  See their implementations for details.  Some effort has
been made to limit the number of times dispatching is done when reading
streaming responses.

When a backend is created, it is registered in the collection
`gptel--known-backends` and can be accessed by name later, such as from the
transient menu.

Only one of these backends is active at any time in a buffer, stored in the
buffer-local variable `gptel-backend`. Most messaging, authentication etc
accounts for the active backend, although there might be some leftovers.

When using `gptel-request` or `gptel-send`, the active backend can be changed or
let-bound.

- Obsolete `gptel-host`
- Fix the rear-sticky property when restoring sessions from files.
- Document some variables (not user options), like `gptel--debug`

gptel-openai.el (gptel-backend, gptel-make-openai, gptel-make-azure,
gptel-make-gpt4all): This file (currently always loaded) sets up the generic
backend struct and includes constructors for creating OpenAI, GPT4All and Azure
backends.  They all use the same API so a single set of defgeneric
implemenations suffices for all of them.

gptel-ollama.el (gptel-make-ollama): This file includes the cl-struct,
constructor and requisite defgeneric implementations for Ollama support.

gptel-transient.el (gptel-menu, gptel-provider-variable, gptel--infix-provider,
gptel-suffix-send):

- Provide access to all available LLM backends and models from `gptel-menu`.
- Adjust keybindings in gptel-menu: setting the model and query parameters is
  now bound to two char keybinds, while redirecting input and output is bound to
  single keys.
2023-10-28 23:57:47 -07:00
Karthik Chikmagalur
6e4d95a70a README: Add drawers to installation instructions 2023-08-12 11:27:10 -07:00
Karthik Chikmagalur
b2a01b8d65 README: Explain saving/restoring sessions better 2023-08-09 17:58:13 -07:00
Karthik Chikmagalur
0f161a466b gptel: saving and restoring state for Markdown/Text
* gptel.el (gptel--save-state, gptel--restore-state,
gptel-temperature, gptel-model, gptel-max-tokens,
gptel-directives, gptel--always, gptel--button-buttonize,
gptel--system-message, gptel--bounds): Write gptel parameters as
file-local variables when saving chats in Markdown or text files.
The local variable gptel--bounds stores the locations of the
responses from the LLM. This is not a great solution, but the best
I can think to do without adding more syntax to the document.

Chats can be restored by turning on `gptel-mode'.  One of the
problem with this approach is that if the buffer is modified
before `gptel-mode' is turned on, the state data is out of date.
Another problem is that this metadata block as printed in the
buffer can become quite long.  A better approach is needed.

Define helper functions `gptel--always' and
`gptel--button-buttonize' to work around Emacs 27.1 support.

* README.org: Mention saving and restoring chats where
appropriate.
2023-07-28 16:05:22 -07:00
Karthik Chikmagalur
a7207a3835 README: Add TOC 2023-06-12 17:27:52 -07:00
Karthik Chikmagalur
30700cc88a README: Mention extensions, gptel-proxy 2023-06-09 14:09:28 -07:00
Tianshu Wang
e6a1468bd2
gptel: Make API host configurable (#67)
* Make API host configurable

* Update README.org
2023-05-31 20:24:13 -07:00
Karthik Chikmagalur
42132d3662 README: tweak description of package 2023-05-31 18:35:08 -07:00
Karthik Chikmagalur
37c381c2e5 README: Update with acknowledgments and more
* README.org: update with acknowledgments (#4)
2023-05-19 23:29:12 -07:00
Troy Rosenberg
075609544a
README: Update instructions for setting key (#46)
* README.org Update the instructions for getting =gptel-api-key= to
include using the .authinfo file after support was added in 6f951ed.
2023-04-23 19:55:34 -07:00
Karthik Chikmagalur
6202474a6e README: Update with changes to gptel-menu
* README.org (Usage): Add images for new options
2023-04-09 13:02:56 -07:00
Karthik Chikmagalur
1b47235e25 README: Add section on gptel-request
* README.org (** Using it your way): New section describing
gptel-request.
2023-04-08 20:17:06 -07:00
Karthik Chikmagalur
6c47c0a483 README: Add videos with streaming
* README.org (In a dedicated chat buffer): Move the any-buffer
interaction description up.
2023-04-06 17:32:35 -07:00
AlessandroW
1f03655e2d
Add Doom Emacs installation instructions (#28)
README: Add Doom Emacs installation instructions
2023-04-01 14:25:47 -07:00
Karthik Chikmagalur
1c07a94e18 README: Update manual install instructions 2023-03-28 12:24:08 -07:00
Rida Ayed
1ab8a57183 add installation instructions 2023-03-28 12:19:56 -07:00
Karthik Chikmagalur
048eaf9b64 README: Update description of chat parameters 2023-03-23 14:39:17 -07:00
Karthik Chikmagalur
4f3ca23454 gptel: Update commentary and README 2023-03-19 19:58:19 -07:00
Karthik Chikmagalur
f0eba0cf4f README: Update README for MELPA 2023-03-19 17:50:51 -07:00
Karthik Chikmagalur
051501c892 README: Change installation instructions (no aio) 2023-03-18 00:04:16 -07:00
Karthik Chikmagalur
c8f87f5554 Update README with transient menu details 2023-03-14 02:09:53 -07:00
Karthik Chikmagalur
8fca5bc762 gptel: Add org-mode support and update README
gptel.el (gptel-response-filter-functions, gptel-send,
gptel--create-prompt, gptel--transform-response, gptel--convert-org,
gptel--convert-markdown->org): Add support for org-mode by transforming
the response manually.  (Note: Asking ChatGPT to format its results in
org-mode markup produces inconsistent results.)

Additionally, the abnormal hook `gptel-resposne-filter-functions' is
added for arbitrary transformations of the response.  Its implementation
seems needlessly complex, and in the future we should change it to
use `run-hook-wrapped' with a local accumulator.
2023-03-10 05:13:29 -08:00
Karthik Chikmagalur
3c10147a72 gptel: Tweak README, minor linting 2023-03-08 01:22:14 -08:00
Karthik Chikmagalur
deeb606409 Update license.
Also update README.
2023-03-05 18:13:32 -08:00
Karthik Chikmagalur
99aa8dcc5f Add gptel.el and a README. 2023-03-05 18:13:32 -08:00