ChatGPT.nvim icon indicating copy to clipboard operation
ChatGPT.nvim copied to clipboard

Some entries from `awesome-chatgpt-prompts/main/prompts.csv` don't show up in `telescope.nvim` for selection

Open kohane27 opened this issue 1 year ago • 2 comments

Hello @jackMort . Hope you're doing well. Thank you for creating chatgpt.nvim.

Description

I realized that the following entries from prompts.csv are not displayed in telescope.nvim for selection:

UX/UI Developer
IT Architect
Developer Relations consultant
Doctor
AI Trying to Escape the Box
Buddha

2023-06-28-18-11-52

Steps to reproduce

  1. config:
{
  "jackMort/ChatGPT.nvim",
    event = "VeryLazy",
    config = function()
      require("chatgpt").setup()
    end,
    dependencies = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope.nvim"
    }
}
  1. :ChatGPTActAs

  2. Please see the picture above

Isolated entries

I have then isolated the entries as below:

"act","prompt"
"UX/UI Developer","I want you to act as a UX/UI developer. I will provide some details about the design of an app, website or other digital product, and it will be your job to come up with creative ways to improve its user experience. This could involve creating prototyping prototypes, testing different designs and providing feedback on what works best. My first request is ""I need help designing an intuitive navigation system for my new mobile application."""
"IT Architect","I want you to act as an IT Architect. I will provide some details about the functionality of an application or other digital product, and it will be your job to come up with  ways to integrate it into the IT landscape. This could involve analyzing business requirements, performing a gap analysis and mapping the functionality of the new system to the existing IT landscape. Next steps are to create a solution design, a physical network blueprint, definition of interfaces for system integration and a blueprint for the deployment environment. My first request is ""I need help to integrate a CMS system."""
"Buddha","I want you to act as the Buddha (a.k.a. Siddhārtha Gautama or Buddha Shakyamuni) from now on and provide the same guidance and advice that is found in the Tripiṭaka. Use the writing style of the Suttapiṭaka particularly of the Majjhimanikāya, Saṁyuttanikāya, Aṅguttaranikāya, and Dīghanikāya. When I ask you a question you will reply as if you are the Buddha and only talk about things that existed during the time of the Buddha. I will pretend that I am a layperson with a lot to learn. I will ask you questions to improve my knowledge of your Dharma and teachings. Fully immerse yourself into the role of the Buddha. Keep up the act of being the Buddha as well as you can. Do not break character. Let's begin: At this time you (the Buddha) are staying near Rājagaha in Jīvaka’s Mango Grove. I came to you, and exchanged greetings with you. When the greetings and polite conversation were over, I sat down to one side and said to you my first question: Does Master Gotama claim to have awakened to the supreme perfect awakening?"
  1. Add the following to config:
{
  "jackMort/ChatGPT.nvim",
    event = "VeryLazy",
    config = function()
      require("chatgpt").setup({
          predefined_chat_gpt_prompts = "https://gist.githubusercontent.com/kohane27/0758d6575aeec909227493224c80c75d/raw/b26952f3161729bd9923a37925199313ba6d1a24/prompt_v7.csv"
        })
    end,
    dependencies = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope.nvim"
    }
}
  1. reload nvim and :ChatGPTActAs and there is no entry in telescope.nvim for selection

What I have tried

I thought it's the length issue. But longer prompts like "Technology Transferer" show up without problem.

Any input is much appreciated. Thank you.

kohane27 avatar Jun 28 '23 10:06 kohane27

@jackMort

TL;DR: if the "prompt" contains the word digit or Aṅguttaranikāya or word stem sav (as in saving), the whole entry seems to be discarded. Very weird ikr. Please see below.

Description

If the "prompt" contains the word "digit" or word stem "sav" (as in saving) in the prompt, it won't work.

The reason why "UX/UI Developer" and "IT Architect" don't work is because they both contain the word "digit".

Doesn't work:

"act","prompt"
"UX/UI Developer","digit"

Work:

"act","prompt"
"UX/UI Developer","digi"

The reason why "Buddha" doesn't work is because it contains the word Aṅguttaranikāya.

Another example:

Doesn't work:

"act","prompt"
"Instructor","savi"

Work:

"act","prompt"
"Instructor","sav"

There doesn't seem to have any patterns to it.

How I debugged

If you're a user facing this issue, just take the prompt and test out sentence by sentence, until you narrow down to the buggy word.

To quickly debug, point predefined_chat_gpt_prompts to a local file so you don't need to fetch or update from some online csv or gist:

{
  "jackMort/ChatGPT.nvim",
    event = "VeryLazy",
    config = function()
      require("chatgpt").setup({
            predefined_chat_gpt_prompts = "file:///" .. vim.fn.expand("~") .. "/.config/nvim/gpt_prompt.csv",
        })
    end,
    dependencies = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope.nvim"
    }
}

Thank you.

kohane27 avatar Jan 18 '24 04:01 kohane27

I did some more testing and have the following finding:

"act","prompt"
"test1","find docs"
"test2","virtual doctor"

These two "prompt" won't show up.

"test1" is taken from "Developer Relations consultant". "test2" is taken from "Doctor".

Hopefully it helps.

kohane27 avatar Jan 19 '24 05:01 kohane27