Git Product home page Git Product logo

Comments (7)

karthink avatar karthink commented on May 25, 2024 1

The only issue I had is that it wasn't autoloaded and (featurep 'gptel-transient) would still return nil, initially.

The branch has been merged into master (see #10), and the way it's required is slightly different. Could you switch back to the master branch and try? I'm trying to avoid loading transient from the start since it freezes my Emacs for over a second on first load.

Funny, when testing the custom directive I set it to "Reply as if you're in love with me", and the responses made me very happy :)

That's one way to test the directives menu :)

Also, I still prefer for the vars to be global, so I can set the initial values in my config. I'm not sure why you made them with defvar-local.

They're buffer-local because you might want different directives in a code buffer, a shell, an org buffer where you're writing prose and one where you're writing documentation.

If you want to set their initial values in your config, you can do something like this:

(setq-default
 gptel--system-message-alist
 '((default . "You are a large language model living in Emacs and a helpful assistant. Respond concisely.")
   (programming . "Provide code and only code as output without any additional text, prompt or note.")
   (writing . "You are a large language model and a writing assistant. Respond concisely.")
   (chat . "You are a large language model and a conversation partner. Respond concisely.")))

A couple of notes:

  1. Because of issues with older versions of Transient (#14), I had to hard-code the keys default, programming, writing and chat, and you can only set their values. Once the new release of Transient is out (soon), you can edit the alist in a free-form way, including adding your own keys.
  2. Since this is going to be a user option, I'm going to eventually change the name from gptel--system-message-alist to something that makes more sense, like gptel-directives. When that happens your config might break, just a heads-up.

from gptel.

karthink avatar karthink commented on May 25, 2024

from gptel.

agzam avatar agzam commented on May 25, 2024

Awesome. I apologize if I'm getting ahead of myself. I know you just wrote this thing and it is still very much actively being developed. But I can't contain my excitement, I giggled like a little girl when it worked. I'll be using this thing way too much, that's for sure.

from gptel.

karthink avatar karthink commented on May 25, 2024

@agzam, I just pushed a transient branch. You can switch to it and test out the transient menu(s) to set parameters. To bring up the menu, call gptel-send with a prefix argument, i.e. C-u C-c RET or C-u M-x gptel-send. What the options do and how to set them should be explained by the menu. Any option you set here is set for that buffer, you don't need to set it again for each request.

If you try it out, please let me know if (i) it works for you, and (ii) if you have any suggestions.

You can also use this in any buffer by selecting a region of text first.

Also, the reason this isn't on the main branch is because I'm using features of transient.el to generate menus dynamically that are not in the latest tagged release (which is from July '22), so it's not clear yet how to declare the dependency. If you're using a recent version of any transient-based application (like magit) you should be good.

from gptel.

agzam avatar agzam commented on May 25, 2024

I tried transient branch and it worked. The only issue I had is that it wasn't autoloaded and (featurep 'gptel-transient) would still return nil, initially. After manually requiring it, it worked. I have tested different transient suffixes and they appear to be working.

Funny, when testing the custom directive I set it to "Reply as if you're in love with me", and the responses made me very happy :)

Also, I still prefer for the vars to be global, so I can set the initial values in my config. I'm not sure why you made them with defvar-local. I'm not complaining, genuinely curious, maybe some aspect of elisp that I don't know.

from gptel.

karthink avatar karthink commented on May 25, 2024

Also, I still prefer for the vars to be global, so I can set the initial values in my config.

I've changed the parameters to be customizable user options with saner names. You can now set them officially (and globally) in addition to interactively using the transient menu. Please run M-x customize-group gptel and update your config.

from gptel.

karthink avatar karthink commented on May 25, 2024

I'm closing this issue now that setting API parameters is fully implemented.

from gptel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.