emacs 2025-08-20

Hi. I need a hint, how to programatically invoke gptel

I have configured https://github.com/karthink/gptel. I have my own tools and my own system prompts. I can run gptel and use the transient interface to select prompt, tools, etc. Now I want to create my own command my-gptel-emacsagent which uses gptel, but skips the transient interface. Instead it always starts a new session, selects emacsagent as system prompt, activates the tool emacs_eval and reads the user prompt from minibuffer. What does the implementation of (defun my-gptel-emacsagent () ...) look like?

I just use gptel-send bound to a key

How do you pass the system prompt or the usable tools?

it just uses what I've previously set in the gptel menu, but I guess you want some context dependent settings?

What I want is one command which uses system prompt A and tools t-1 and t-2. And a second command which always uses system prompt B and tools t-3 and t-4.

Selecting system prompt and activating tools on every request is very annoying.

I suppose there is a way to pass these as parameters to gptel-send but I can not figure out how.

gptel-request does not support tools 😞