Variable: gptel--system-message

gptel--system-message is an alias and customizable for gptel-system-prompt, defined in gptel-request.el.

This variable is obsolete since 0.9.9.6; use gptel-system-prompt instead.

Value

"You are a large language model living in Emacs and a helpful assistant. Respond concisely."

Documentation

System prompt used by gptel.

A system prompt is used to provide the LLM with general instructions, set expectations, or establish an overall tone. It is also commonly referred to as the "system message" or "directive".

This is typically a string, but can be specified more generally as well. It can be

- A string, included with gptel requests as-is.

- nil, to not include any system prompt.

- A list of strings, whose first (possibly nil) element is interpreted
  as the system prompt, and the remaining elements as (possibly nil)
  alternating user prompts and LLM responses. This can be used to
  template the initial part of a conversation.

- A function of no arguments that returns a string or a list of strings,
  interpreted as the above. When sending a request, this will be used
  to dynamically generate a system message and/or conversation template
  based on the current context. See the definition of
  gptel--rewrite-directive-default for an example.

If you alternate between a few different system prompts, you can save them all in gptel-directives and pick between them in gptel-menu. This way system prompts can be set globally, per-buffer or for the next request only.

The system prompt is typically one part of the configuration required for custom LLM tasks. You can include system prompts along with other settings in gptel presets (see gptel-make-preset) with the :system key.

By default this system prompt is used when using gptel programmatically with gptel-request. It can be overridden by supplying an explicit
:system argument to this function.

Aliases

gptel-system-prompt