gregoryg / AIPIHKAL

AI (LLM) Prompts I Have Known And Loved
28 stars 5 forks source link

Executing Emacs-Lisp unknown at position 45748 #3

Closed alx closed 1 week ago

alx commented 1 week ago

Hi @gregoryg ,

Thanks for this package and the video that goes with it, I'm looking to run it on my doom emacs install and it looks like I can't add the directives inside gptel. I'm still a newbie at emacs, I can't find how to debug this issue on the web so I thought you could help.

When I C-c C-c in the "Generate all the prompts as Markdown files" chapter, it generates correctly the markdown files.

When I C-c C-c in "The magic Emacs Lisp function to create the alist", I get the following error:

Executing Emacs-Lisp unknown at position 45748

Then I C-c C-c on the (setq gptel-directives (gjg/gptel-build-directives "~/code/AIPIHKAL/system-prompts/"))

It looks like the directives have been correctly set because when I open directives from gptel-menu, I get the following message:

transient-setup: Wrong type argument: stringp, ("Ask user questions to expand and clarify context" "      Before you start, please ask me any questions you have about this so I can give you more context.

      Be extremely comprehensive
") 

This string comes from the generated system-prompts/add-context.md file:

alx@slim:~/code/AIPIHKAL/system-prompts$ cat add-context.md
<!-- Insist on asking questions to improve context -->
<!--     This one from Jordan Gibbs on Medium -->
<!--     #+description: Ask user questions to expand and clarify context -->
<!--     #+name: add-context -->

      Before you start, please ask me any questions you have about this so I can give you more context.

      Be extremely comprehensive

Thanks and have a nice day,

Alex

gregoryg commented 1 week ago

Hello @alx !

You did everything correctly - the problem is in my code, in the function that magic alist creator function. I have a slight modification in my gptel code that adds descriptions to the system directives. Let me work on a fix and I'll let you know when it's ready for testing.

BTW, although you get the message

Executing Emacs-Lisp unknown at position 45748

when you C-c in a function definition code block, it's not actually an error.

gregoryg commented 1 week ago

@alx please retry - this should work now with unmodified gptel. Thank you for the report!

alx commented 5 days ago

Thanks for your help, this issue is fixed, I can access now all generated directives from gptel-menu.

Thanks for the info about the non-error status message.

gregoryg commented 4 days ago

That's great to hear! Thank you for testing it. Please feel free to reach out for any Emacs questions.

alx commented 3 days ago

Thanks! This issue might not be the best place to explain this, but how are you configuring your emacs to display the property image like during your screencast?

gregoryg commented 1 day ago

Have a look at my org-powerslides package - that's what I was using in my preso

it's just an external package you can install

https://github.com/gregoryg/org-powerslides?tab=readme-ov-file#usage