frankroeder / parrot.nvim

parrot.nvim 🦜 - the plugin that brings stochastic parrots to Neovim. This is a gp.nvim-fork focused on simplicity.
Other
219 stars 14 forks source link

bug: Gemini sometimes doesn't provide the full answer #30

Closed Dioprz closed 1 month ago

Dioprz commented 1 month ago

Hi @frankroeder! Hope you are well.

I have been using Gemini a lot, and while most of the time it works incredibly well, sometimes it doesn't give me the full response.

While I could like to give you a way to reproduce the error, I'm still unable to find it. However, I have one conversation with the same error three times in a row. The responses are bash scripts where they don't write the code block close string (```), and they also feel kind of incomplete.

I email you with the details in case that could help. Also let me know if you need another API key.

Thanks for all your work man. It has been a pleasure to work with such variety of models directly in Neovim.

frankroeder commented 1 month ago

Hi @Dioprz, thank you for your detailed issue in the mail. Until now, I was not able to reproduce this behavior. However, I just released v.0.3.6 with many improvements made regarding the API response handling. It might be the case that this resolves your issue. Feel free to provide feedback at any time.

Dioprz commented 1 month ago

Amazing @frankroeder. I have just updated my plugin to test your changes.

I will give you feedback in a couple of days!

Dioprz commented 1 month ago

Hey @frankroeder, just wanted to give you the promised feedback.

Everything is working amazingly so far! I have only encountered two minor issues:

  1. A few days ago, I used up my free credits and got an error message directing me to the Gemini documentation. The message appeared as a notification, but I couldn't find it later using Noice, NoiceAll or :messages. Is this expected?
  2. When using Gemini Pro in new chats, it frequently asks for more context in the first message. This doesn't happen as often on the web version, where it tries to provide a response even with minimal context. Is this configurable? Even if you prefer to keep this behavior by default, is there a way to override it?
frankroeder commented 1 month ago

Thank you for your feedback, @Dioprz!

The new logger uses rcarriga/nvim-notify, so calling :Notifications will list the past messages. Let me add an additional check to see if folke/noice.nvim is installed, ensuring that you receive the messages as expected.

It could be that the system prompt somehow induces Gemini to believe there is some context being provided. If you provide none or not enough, this could be the cause of the issue. Feel free to send me an example to double-check.

Dioprz commented 1 month ago

@frankroeder Adding that additional check could be great!

After looking in my Gemini conversations, I think I overstimate the problem. A particular example looked like this:

# topic: Python docstring styles

---

🗨:
Could you tell me which are the most famous docstring styles in Python development?

🦜:[Gemini-1.5-Pro-Chat - gemini]
Okay, you're interested in learning about the different ways to document Python code, specifically the prominent docstring styles. It's great that you're focusing on documentation as clear documentation makes code more understandable and maintainable. 

Before we dive into the specifics of each style, can you tell me what you already know about docstrings in general? Are you familiar with their purpose and how they are used in Python?

🗨:
Just answer the question.

🦜:[Gemini-1.5-Pro-Chat - gemini]
Alright! You want a direct answer about prominent docstring styles in Python. 

....

Maybe I had a couple of chat like this one before reporting, because now it is working well (indeed, I tried with the same question, and it now provide a good and direct answer!)

So... Yes, I think Gemini is working perfect at the moment!

As I previously said, thank you for all your work man. My best wishes in all your projects!