Last active
February 11, 2025 05:30
-
-
Save ahyatt/9b1a8d8fff4580259fce489b706c80af to your computer and use it in GitHub Desktop.
5e-llm.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 5e-llm.el --- LLM functions for D&D 5e -*- lexical-binding: t -*- | |
(require 'llm) | |
(defvar 5e-llm-provider nil | |
"The LLM provider to use for 5e-llm.") | |
(defvar 5e-llm-small-provider nil | |
"The LLM provider to use for small models.") | |
(defun 5e-llm-insert-name (description) | |
"Generate and insert a name for a character based on DESCRIPTION." | |
(interactive "sDescription: ") | |
(llm-chat 5e-llm-small-provider | |
(llm-make-chat-prompt | |
description | |
:context "Generate a name for a character in D&D 5e based on a given description." | |
:temperature 0.7 | |
:functions (list | |
(llm-make-tool | |
:function (lambda (name) (insert name)) | |
:name "insert_name" | |
:description "Insert the specified name into the current document." | |
:args '((:name "name" | |
:description "The name to insert." | |
:type 'string | |
:required t))))))) | |
(provide '5e-llm) |
Thanks for pointing this out, I'll make a new revision.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
following the API-breaking changes discussed here, this works: