You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [[#applying-presets-to-requests-automatically][Applying presets to requests automatically]]
154
155
- [[#alternatives][Alternatives]]
155
156
- [[#packages-using-gptel][Packages using gptel]]
156
157
- [[#acknowledgments][Acknowledgments]]
@@ -1347,6 +1348,9 @@ gptel does /not/ use any prefix or semantic/syntax element in the buffer (such a
1347
1348
*** Transient menu behavior
1348
1349
#+html: <details><summary>
1349
1350
**** I want to set gptel options, but only for this buffer
1351
+
:PROPERTIES:
1352
+
:ID: 748cbc00-0c92-4705-8839-619b2c80e566
1353
+
:END:
1350
1354
#+html: </summary>
1351
1355
1352
1356
In every menu used to set options, gptel provides a "scope" option, bound to the ~=~ key:
@@ -1549,7 +1553,7 @@ To define a preset, use the =gptel-make-preset= function, which takes a name and
1549
1553
Besides a couple of special keys (=:description=, =:parents= to inherit other presets), there is no predefined list of keys. Instead, the key =:foo= corresponds to setting =gptel-foo= (preferred) or =gptel--foo=. So the preset can include the value of any gptel option. For example, the following preset sets =gptel-temperature= and =gptel-use-context=:
1550
1554
1551
1555
#+begin_src emacs-lisp
1552
-
(gptel-make-preset 'proofreading
1556
+
(gptel-make-preset 'proofreader
1553
1557
:description "Preset for proofreading tasks"
1554
1558
:backend "ChatGPT"
1555
1559
:model 'gpt-4.1-mini
@@ -1560,6 +1564,39 @@ Besides a couple of special keys (=:description=, =:parents= to inherit other pr
1560
1564
1561
1565
Switching to a preset applies the specified settings without affecting other settings. Depending on the scope option (~=~ in gptel's transient menu), presets can be applied globally, buffer-locally or for the next request only.
1562
1566
1567
+
**** Applying presets to requests automatically
1568
+
1569
+
You can apply a preset to a /single/ query by including =@preset-name= in the prompt, where =preset-name= is the name of the preset. (The =oneshot= scope option in gptel's transient menus is another way to do this, [[id:748cbc00-0c92-4705-8839-619b2c80e566][see the FAQ.]])
1570
+
1571
+
For example, if you have a preset named =websearch= defined which includes tools for web access and search:
1572
+
#+begin_src emacs-lisp
1573
+
(gptel-make-preset 'websearch
1574
+
:description "Haiku with basic web search capability."
The following query is sent with this preset applied:
1581
+
1582
+
#+begin_quote
1583
+
@websearch Are there any 13" e-ink monitors on the market? Create a
1584
+
table comparing them, sourcing specs and reviews from online sources.
1585
+
Also do the same for "transreflective-LCD" displays -- I'm not sure
1586
+
what exactly they're called but they're comparable to e-ink.
1587
+
#+end_quote
1588
+
1589
+
This =@preset-name= cookie only applies to the final user turn of the coversation that is sent. So the presence of the cookie in past messages/turns is not significant.
1590
+
1591
+
The =@preset-name= cookie can be anywhere in the prompt. For example:
1592
+
#+begin_quote
1593
+
<long piece of text>
1594
+
1595
+
What do you make of the above description, @proofreader?
1596
+
#+end_quote
1597
+
1598
+
In chat buffers this prefix will be offered as a completion and fontified, making it easy to use and spot.
1599
+
1563
1600
** COMMENT Will you add feature X?
1564
1601
1565
1602
Maybe, I'd like to experiment a bit more first. Features added since the inception of this package include
0 commit comments