Community
    • Login

    [New Plugin] NppOpenAI

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    42 Posts 17 Posters 28.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Richárd StockingerR
      Richárd Stockinger
      last edited by

      I’ve created a small plugin for Notepad++ to communicate with the popular OpenAI (aka. ChatGPT).

      You can simply select a text in Notepad++, press Ctrl + Shift + O, and you’ll see the AI generated response, without leaving your favorite code editor.

      NppOpenAI v0.1.5 is available in N++ v8.5.1 Release Candidate Plugin Admin, however the v0.2 is downloadable as the latest release (will be added soon).

      More details at GitHub page: https://github.com/Krazal/nppopenai

      Planned updates:

      • GUI updates for better UX
      • Chat support: NppOpenAI will remember for your last X questions
      • DALL-E support: You will be able to create an AI generated image
      • Whisper support: You will be able to extract text from an audio file and/or (hopefully…) to “talk” to OpenAI

      Disclaimer: I’m neither an OpenAI employee, nor C++ developer (officially I’m a full stack PHP developer). However, this plugin requires an active internet connection and an OpenAI registration / API key.

      Thank you for any feedbacks!

      nppopenai_01.png nppopenai_02.png

      1 Reply Last reply Reply Quote 8
      • Chr PqeC
        Chr Pqe
        last edited by Chr Pqe

        Nice one. Maybe a useful feature would be to query OpenAI to upload and optimise the the currently selected text code. Another query could be to debug the currently selected text code. Or also, indent/comment the selected code. Maybe some settings to change those default prompt / reset to default the prompts.

        P 1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn
          last edited by

          Perhaps not a critically important point, but the demo shown is something you can do with Notepad++ without an AI plugin:

          c5a76692-6de6-4ea7-8c3c-fe22a73cd6bd-image.png

          Results in:

          92a7f3b9-b198-4e0e-9aee-c163c8e2a3ae-image.png

          1 Reply Last reply Reply Quote 4
          • mkupperM
            mkupper
            last edited by

            @Alan-Kilborn I am getting odd results when I try to reproduce what you demonstrated.

            I have What is "Loren Ipsum"? selected within npp and then do Edit / On Selection / Search On Internet. For me “nothing happened.” If I remove the double quotes to instead have What is Loren Ipsum? selected then it works for me and a new-tab shows up in Firefox for https://www.google.com/search?q=What%20is%20Loren%20Ipsum? I’m running v8.5.3 portable to test/verify this but see the same behavior with the handling of double quotes in the selected text for older versions.

            I added a comment to https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9795 to document the behavior on my machine when there are double quotes in the selected text but from your screen shots they work on your machine.

            1 Reply Last reply Reply Quote 0
            • BernoulliBoxB
              BernoulliBox
              last edited by

              I’ve been playing around with your plug-in v0.2.1, it is very cool!

              I ran into a problem, if I change the model to GPT-4, there is a crash in the plugin DLL. Is there anything special I need to do in order to make it work with GPT-4?

              1 Reply Last reply Reply Quote 1
              • sdsds rgdsfdsS
                sdsds rgdsfds
                last edited by

                Bhttps://community.notepad-plus-plus.org/topic/25350/hover-to-preview-ai-claude-generated-alternatives-for-selected-text-portions-click-to-commit-changes-within-surrounding-paragraph-context/2?_=1705098063043

                Can you please have your plugin do this ?

                1 Reply Last reply Reply Quote 0
                • Richárd StockingerR
                  Richárd Stockinger
                  last edited by

                  Thank you for your valuable feedbacks!

                  I’ve just realized that I have no email notifications turned on. ><

                  Fortunately the GPT-4 support is already working (as I know).

                  There are new features on the way, e.g. system messages (aka. “instructions”), which can be useful for @sdsds-rgdsfds (recommending alternatives, see example images), or chat.

                  Unfortunately I’ve received some SOS/VIP/etc. projects, :( so it’s required a little time to finish these, but I hope, I can continue developing NppOpenAI ASAP. I hope, in a few weeks (days?) I can update the repository. 💪

                  instructions_example_1.png

                  instructions_example_2.png

                  instructions_example_3.png

                  nppopenai_menu.png

                  mkupperM Kimin ParkK 2 Replies Last reply Reply Quote 4
                  • mkupperM
                    mkupper @Richárd Stockinger
                    last edited by

                    @Richárd-Stockinger said in [New Plugin] NppOpenAI:

                    I’ve just realized that I have no email notifications turned on.

                    Email notifications are not reliable on this forum system. They never worked for the longest time but recently some people believe it works. If you search the forums for “Email notifications” most of the threads indicate it does not work.

                    mkupperM 1 Reply Last reply Reply Quote 1
                    • mkupperM
                      mkupper @mkupper
                      last edited by

                      Here is an on the notification topic - I had enabled all of them in my forum preferences as part of posting my previous comment and have gotten e-mails about mentions, etc. and so they seem to be working.

                      1 Reply Last reply Reply Quote 0
                      • BernoulliBoxB
                        BernoulliBox
                        last edited by

                        This plugin is super cool.

                        I’ve noticed a small issue when the plugin is operated in ‘Keep my question’ mode and Notepad++ is configured to use the Windows line ending characters (CR-LF).

                        In that case, the question text is inadvertently altered to include double line spacing. Interestingly, this issue does not manifest when the editor is set to use Linux EOLs, where the original text is maintained as expected.

                        I posted this comment on Github as well, not sure where the best ‘home’ is - apologies in advance for doubling up!

                        Alan KilbornA Richárd StockingerR 3 Replies Last reply Reply Quote 1
                        • Alan KilbornA
                          Alan Kilborn @BernoulliBox
                          last edited by

                          @BernoulliBox said in [New Plugin] NppOpenAI:

                          apologies in advance for doubling up!

                          No apologies needed.
                          If you add a comment here, more people that might be interested will see and understand an issue that could be happening to them.
                          But, it’s considered good form to provide a link to your offsite comment here.

                          1 Reply Last reply Reply Quote 1
                          • Richárd StockingerR
                            Richárd Stockinger @BernoulliBox
                            last edited by

                            @BernoulliBox Thank you for your feedback!

                            I’ve replied for the issue:
                            https://github.com/Krazal/nppopenai/issues/19

                            Tomorrow (Monday) I can upload a new release, and I’ll try to send a PR to the nppPluginList repository with the updates.

                            Have a nice day/evening!

                            1 Reply Last reply Reply Quote 1
                            • Richárd StockingerR
                              Richárd Stockinger @BernoulliBox
                              last edited by

                              @BernoulliBox Sorry for being late, and thank you for your patience!

                              The plugin has been updated, and available as v0.3.0.0 release. For more information see the Issue:
                              https://github.com/Krazal/nppopenai/issues/19

                              I’ve sent a PR to the nppPluginList repository, and I hope the updates will be available in N++ Plugins Admin soon.

                              sdsds rgdsfdsS 1 Reply Last reply Reply Quote 0
                              • sdsds rgdsfdsS
                                sdsds rgdsfds @Richárd Stockinger
                                last edited by

                                @Richárd-Stockinger I’m currently testing the v3.01 update and I must say I’m very pleased with it and it’s very useful for me as it is now ! Also, as you might remember, I made some suggestions a few weeks ago and I would be very much happy if you could make them possible,. I want plugin to use the surrounding paragraph as context for the AI/NLP model to understand meaning and intent. I would very much appreciate if you implement this… I think this is possible because when I click on a text from a paragraph then on my notepad++ screen that whole paragraph is highlighted in blue. (Idk if this is because of the plugin.) And also as you might remember there was other suggestions I made but as I said if you are really busy it is totally fine but I would seriously be very happy if you could make those possible with your program…

                                “Preview the alternatives on hover without committing to changes
                                User can then click on one of the previewed alternatives
                                Upon clicking, the selected alternative would dynamically replace the original selection within the paragraph”

                                I would very much appreciate if you could make these changes mate… Thanks !

                                Richárd StockingerR 1 Reply Last reply Reply Quote 0
                                • Richárd StockingerR
                                  Richárd Stockinger @sdsds rgdsfds
                                  last edited by

                                  @sdsds-rgdsfds Hi!

                                  I think the paragraph (line) highlighting is a Notepad++ feature; you can check it out by clicking Preferences » Editing » Current Line Indicator section (see: top left) » Highlight Background radio button.

                                  Idk how to append the surrounding text to the selected message, but maybe a similar setting could manage this (example only, NOT working feature!):
                                  context_settings_example.png

                                  Besides, the “Preview alternatives” is a very good idea as OpenAI supports multiple responses. It could work like the N++ Auto-Completion feature.

                                  However, I’d like to finish chat support (no, my VIP/SOS/etc. projects first ><), and I’ve a plan for a GUI to configure the plugin settings easier. At the same time, I’ll keep your feature requests / ideas in mind!

                                  sdsds rgdsfdsS 1 Reply Last reply Reply Quote 1
                                  • sdsds rgdsfdsS
                                    sdsds rgdsfds @Richárd Stockinger
                                    last edited by

                                    @Richárd-Stockinger Thanks really man ! I’m hyped up.

                                    1 Reply Last reply Reply Quote 1
                                    • Kimin ParkK
                                      Kimin Park @Richárd Stockinger
                                      last edited by

                                      @Richárd-Stockinger Hi, thanks for the nice plugin. I also run into a problem when I change the model to gpt-4-turbo. Should I change something in the ini file?

                                      Richárd StockingerR 1 Reply Last reply Reply Quote 0
                                      • Richárd StockingerR
                                        Richárd Stockinger @Kimin Park
                                        last edited by

                                        @Kimin-Park Hi!

                                        Sorry for the late reply! ^^’

                                        If you get “The model gpt-4-turbo does not exist” message, try gpt-4-turbo-preview or gpt-4-0125-preview. Unfortunately gpt-4-turbo model is not (yet) available.

                                        The available GPT-4 (Turbo) models are listed here:
                                        https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo

                                        edit_model.png

                                        Kimin ParkK R 2 Replies Last reply Reply Quote 1
                                        • Kimin ParkK
                                          Kimin Park @Richárd Stockinger
                                          last edited by

                                          @Richárd-Stockinger said in [New Plugin] NppOpenAI:

                                          gpt-4-turbo-preview

                                          I tried your suggestions, and still for me it does not give any message, the app just shuts down after a few seconds of waiting with the message like ‘please wait for the response from openai’. Only gpt-3.5-turbo works for me yet, probably my installed version might have some issue, I am using windows 11. Anyway, thanks a lot for the reply and again for the nice plugin!

                                          Richárd StockingerR 1 Reply Last reply Reply Quote 0
                                          • Richárd StockingerR
                                            Richárd Stockinger @Kimin Park
                                            last edited by

                                            @Kimin-Park said in [New Plugin] NppOpenAI:

                                            the app just shuts down after a few seconds of waiting

                                            It seems, you’re using an earlier version of NppOpenAI, e.g. v0.2.1 (you can check it out by clicking: Plugins menu » NppOpenAI » About).

                                            A new version should be available in Plugins Admin: Plugins menu » Plugins Admin… » Updates tab.

                                            Please try to update the plugin, it should solve the problem; a similar bug has been fixed in v0.2.1.1.

                                            Kimin ParkK 1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post
                                            The Community of users of the Notepad++ text editor.
                                            Powered by NodeBB | Contributors