EvanZhouDev / bard-ai

A lightweight library to access Google Bard.
https://www.npmjs.com/package/bard-ai
GNU General Public License v3.0
117 stars 31 forks source link

raycast extension #4

Closed rochakagrawal closed 1 year ago

rochakagrawal commented 1 year ago

Hi - thanks i have been looking for this to work with raycast extension. It works but rather than sending text from selection text on browser, can you please make it such that we can type in raycast search box and it then sends to google bard to get a respondse back.

Ideally like the ChatGPT extension on raycast https://www.raycast.com/abielzulio/chatgpt. which in my mind is perfect except I would like to use Google bard for it. It has things like storing history etc.

EvanZhouDev commented 1 year ago

Hello rochakagrawal! I am so happy you decided to check out my extension. As for your first request, regarding the typing in the Raycast search box, I'm excited to announce that it's going to come out on raycast-bard-ai v1.1. As for the "continued chats" thing, Raycast has a very strict set of things you can put in their extensions, making such a continued chat very difficult. The ChatGPT extension uses a form of a list view, which makes the UI slightly strange. However, I do not actually have an OpenAI key at this time (which is precisely why I made this extension and library), so I do not actually know how it works. If you have a video of the ChatGPT extension or suggestions as to how I can implement it, let me know!

By the way, what I have been doing for such a quick access chat view is downloading Menubar X, and putting ChatGPT on it. Free and simple solution... Though Raycast Pro seems so tempting ;)

EvanZhouDev commented 1 year ago

Hello! Such a feature in which you can type in the search box to ask has been implemented here.

After it is approved (which it may take a while), you'll be able to download it. Until then, you can build it from source.

rochakagrawal commented 1 year ago

Thanks Evan - that's exactly what I was waiting for. I really want it. Do you know how to build that extension from source please for my raycast. On the link here Update raycast-bard-ai extension by EvanZhouDev · Pull Request #6815 · raycast/extensions (github.com) https://github.com/raycast/extensions/pull/6815 - I couldn't find a direct link to download the file. How would i be able to download the correct file

Also, here is the chatgpt extension screenshots - it has the ability to both continue conversations and show you history. I have made a video to show how beautiful they have implemented https://share.cleanshot.com/sHvlfB8N Would it be great to just replace that with your google bard API. It would be perfect

[image: image.png]

[image: image.png]

On Sun, 28 May 2023 at 06:28, Evan Zhou @.***> wrote:

Hello! Such a feature in which you can type in the search box to ask has been implemented here https://github.com/raycast/extensions/pull/6815.

After it is approved (which it may take a while), you'll be able to download it. Until then, you can build it from source.

— Reply to this email directly, view it on GitHub https://github.com/EvanZhouDev/bard-ai/issues/4#issuecomment-1565713927, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA37RQGPNL4KRGN5AYWG3BDXIJ5ZFANCNFSM6AAAAAAYRINPFM . You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

Just go ahead and clone this repo onto your system: it's the latest version of the extension: https://github.com/EvanZhouDev/raycast-bard-ai. Then, install deps and run. You can do this by using these commands:

git clone https://github.com/EvanZhouDev/raycast-bard-ai.git
cd raycast-bard-ai/
npm i
npm run dev

Then, feel free to ^c out of the program, and the version of the extension locally will be available. I will be sure to let you know when the official release is out.

EvanZhouDev commented 1 year ago

By the way, I saw the way the ChatGPT extension does it, and I may look into it when I get time :)

rochakagrawal commented 1 year ago

Cool, thanks! that would be awesome. Can't wait

On Sun, 28 May 2023 at 10:03, Evan Zhou @.***> wrote:

By the way, I saw the way the ChatGPT extension does it, and I may look into it when I get time :)

— Reply to this email directly, view it on GitHub https://github.com/EvanZhouDev/bard-ai/issues/4#issuecomment-1565797979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA37RQD5AD4TBLYV44P2RJTXIKW6TANCNFSM6AAAAAAYRINPFM . You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

I'll be closing this for now, feel free to re-open and/or still talk to me about feature ideas if you want :)

rochakagrawal commented 1 year ago

thanks - i managed to build the extension. I think it's running but i can't understand how ask ai is supposed to run

see the video please - it keeps saying no input was provided when i click on Ask AI - where do i type my prompt

[image: image.png]

On Sun, 28 May 2023 at 10:02, Evan Zhou @.***> wrote:

Just go ahead and clone this repo onto your system: it's the latest version of the extension: https://github.com/EvanZhouDev/raycast-bard-ai. Then, install deps and run. You can do this by using these commands:

git clone https://github.com/EvanZhouDev/raycast-bard-ai.gitcd raycast-bard-ai/ npm i npm run dev

Then, feel free to ^c out of the program, and the version of the extension locally will be available. I will be sure to let you know when the official release is out.

— Reply to this email directly, view it on GitHub https://github.com/EvanZhouDev/bard-ai/issues/4#issuecomment-1565797731, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA37RQCGYIKZXWNBPOVSWBLXIKW4NANCNFSM6AAAAAAYRINPFM . You are receiving this because you authored the thread.Message ID: @.***>

rochakagrawal commented 1 year ago

I managed to get it to work as a fallback command on raycast.. it works. Thanks !

Just hoping to get conversational AI going and then its perfect

EvanZhouDev commented 1 year ago

Yep, you're supposed to set it as a fallback, I'll probably add that to the README soon...

rochakagrawal commented 1 year ago

thanks Evan - got it. Would be eagerly waiting for your next update to include conversations AI with google bard

EvanZhouDev commented 1 year ago

Hello, I’m in the middle of developing Bard AI Chat, and I just wanted to know how the whole saving conversations thing works with the ChatGPT extension. Does it discard the AI’s answer after a while? I’m asking because from looking at the code, it appears that they are storing it in localStorage, which has a capacity limit. I just wanted to figure out how the ChatGPT extension works around that.

rochakagrawal commented 1 year ago

Hi Evan. I believe that’s how they do it. They store the query and response in local storage and use that to retrieve it. They are able to store atleast the last 10-15 query and responses including back and forth conversations. So it’s not unlimited but good enough

Thanks for working. Would it be correct that you are building both conversational Ask bard and storing history.

Thanks

On Mon, 29 May 2023 at 7:53 AM, Evan Zhou @.***> wrote:

Hello, I’m in the middle of developing Bard AI Chat, and I just wanted to know how the whole saving conversations thing works with the ChatGPT extension. Does it discard the AI’s answer after a while? I’m asking because from looking at the code, it appears that they are storing it in localStorage, which has a capacity limit. I just wanted to figure out how the ChatGPT extension works around that.

— Reply to this email directly, view it on GitHub https://github.com/EvanZhouDev/bard-ai/issues/4#issuecomment-1566310305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA37RQE7IKZOHQ442YGIS7TXIPQQHANCNFSM6AAAAAAYRINPFM . You are receiving this because you authored the thread.Message ID: @.***>

-- Sent from iPhone

EvanZhouDev commented 1 year ago

Yes! Here's a quick demo that I whipped up... It's still in very rough stages, but is this what you wanted? (Sorry for the blur, GH only likes files under 10mb)

https://github.com/EvanZhouDev/bard-ai/assets/62189478/010085de-c8c1-44e8-9a02-a9d2442905d5

On the top right is the conversation selector, and in each conversation, Bard remembers what you said previously.

rochakagrawal commented 1 year ago

Hi Evan.  You rock. This is great.  Just some feedback1. Pls confirm that there is a timeout for new conversation. So for eg if you search and after 5 mins / 10 mins search again it automatically starts a new conversation and one doesn’t need to manually click on top right to create a new conversation2. Pls give us keyboard shortcut option to switch to new conversion 3. Do we have any limits on how long old conversations are kept. 4. I am using the google bard key using that cookie method you suggested.  Is that permanent or will it expire after few days. How do I keep it permanent5. Finally pls can you give me your code to use your demo :)Thank youSent from my  iphone On 29 May 2023, at 10:42 AM, Evan Zhou @.***> wrote: Yes! Here's a quick demo that I whipped up... It's still in very rough stages, but is this what you wanted? (Sorry for the blur, GH only likes files under 10mb) https://github.com/EvanZhouDev/bard-ai/assets/62189478/010085de-c8c1-44e8-9a02-a9d2442905d5 On the top right is the conversation selector, and in each conversation, Bard remembers what you said previously.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

Phew! You've given me a thing or two to do recently ;)

  1. Will implement in the future
  2. Sure!
  3. Not yet, but we probably will need one because LocalStorage has a limit to the number of things it can store.
  4. Yes, it will probably expire some day. Most likely it will be sometime in June 2024.
  5. I will push it soon, but I need to make sure that it works well before doing so.
EvanZhouDev commented 1 year ago

Bit of progress...

image
rochakagrawal commented 1 year ago

Thanks EvanSent from my  iphone On 29 May 2023, at 12:22 PM, Evan Zhou @.***> wrote: Phew! You've given me a thing or two to do recently ;)

Will implement in the future Sure! Not yet, but we probably will need one because LocalStorage has a limit to the number of things it can store. Yes, it will probably expire some day. Most likely it will be sometime in June 2024. I will push it soon, but I need to make sure that it works well before doing so.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

Hello! The version of raycast-bard-ai that has the Ask AI feature is now in the Raycast store! Go ahead and use that version now instead of your local version. Enjoy!

By the way, the chat history is still under development. I am refactoring my current code, but I need some time, as I'm going to be taking a quick break from this project (about 1 or 2 days or maybe even less depending on how I feel 🙃) and will continue and publish changes after I'm done.

rochakagrawal commented 1 year ago

Great.  Thanks Evan.  Sent from my  iphone On 1 Jun 2023, at 6:25 AM, Evan Zhou @.***> wrote: Hello! The version of raycast-bard-ai that has the Ask AI feature is now in the Raycast store! Go ahead and use that version now instead of your local version. Enjoy! By the way, the chat history is still under development. I am refactoring my current code, but I need some time, as I'm going to be taking a quick break from this project (about 1 or 2 days or maybe even less depending on how I feel 🙃) and will continue and publish changes after I'm done.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

rochakagrawal commented 1 year ago

Hi Evan - could i follow up please on your latest code for conversation and history mode of google bard please

grateful - thanks

On Thu, 1 Jun 2023 at 07:11, Rochak Agrawal @.***> wrote:

Great. Thanks Evan.

Sent from my  iphone

On 1 Jun 2023, at 6:25 AM, Evan Zhou @.***> wrote:



Hello! The version of raycast-bard-ai that has the Ask AI feature is now in the Raycast store! Go ahead and use that version now instead of your local version. Enjoy!

By the way, the chat history is still under development. I am refactoring my current code, but I need some time, as I'm going to be taking a quick break from this project (about 1 or 2 days or maybe even less depending on how I feel 🙃) and will continue and publish changes after I'm done.

— Reply to this email directly, view it on GitHub https://github.com/EvanZhouDev/bard-ai/issues/4#issuecomment-1571044157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA37RQF3ZQSJ5B4NITEK7Q3XI7ANNANCNFSM6AAAAAAYRINPFM . You are receiving this because you authored the thread.Message ID: @.***>

rochakagrawal commented 1 year ago

Hi Evan.  Any update on your release pls. Thanks Sent from my  iphone On 10 Jun 2023, at 5:41 PM, Rochak Agrawal @.> wrote:Hi Evan - could i follow up please on your latest code for conversation and history mode of google bard pleasegrateful - thanksOn Thu, 1 Jun 2023 at 07:11, Rochak Agrawal @.> wrote:Great.  Thanks Evan.  Sent from my  iphone On 1 Jun 2023, at 6:25 AM, Evan Zhou @.***> wrote: Hello! The version of raycast-bard-ai that has the Ask AI feature is now in the Raycast store! Go ahead and use that version now instead of your local version. Enjoy! By the way, the chat history is still under development. I am refactoring my current code, but I need some time, as I'm going to be taking a quick break from this project (about 1 or 2 days or maybe even less depending on how I feel 🙃) and will continue and publish changes after I'm done.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

Hello, I'm so sorry I wasn't able to give you any updates. My friend and I (the 2 people behind raycast-bard-ai) have been working behind the scenes to make the experience better with new features and fixes. However, I am currently facing some technical issues publishing the extension. I am currently working closely with fellow Raycast developers and admins to resolve this. Hopefully, we should be up and running soon. If you want, you can beta test raycast-bard-ai's source version right now, too. The chat feature is basically done.

rochakagrawal commented 1 year ago

Super thanks. How do I do a beta test pls?ThxSent from my  iphone On 20 Jun 2023, at 7:36 AM, Evan Zhou @.***> wrote: Hello, I'm so sorry I wasn't able to give you any updates. My friend and I (the 2 people behind raycast-bard-ai) have been working behind the scenes to make the experience better with new features and fixes. However, I am currently facing some technical issues publishing the extension. I am currently working closely with fellow Raycast developers and admins to resolve this. Hopefully, we should be up and running soon. If you want, you can beta test raycast-bard-ai's source version right now, too. The chat feature is basically done.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

Just build from source :)

rochakagrawal commented 1 year ago

Thanks. I did that and it works beautifully Few  questions please1. If I use chat AI, does it remember the context by default when asking follow up questions?2. If yes and that is great and what I wanted   However,  if I want to start of a new conversation thread without prior context, how does it work ?3. Please confirm if there is any limit to the past conversation history in chatAIThank you!Sent from my  iphone On 20 Jun 2023, at 8:00 AM, Evan Zhou @.***> wrote: Just build from source :)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

EvanZhouDev commented 1 year ago

Yes, in a Conversation it does remember things. Go to the command palette to create a new Conversation, move between Conversations, and more. You can also use the dropdown in the top bar to switch between existing Conversations. Each new conversation will be its own "instance" of Bard. For now, there's not... but there MAY be, because LocalStorage has limits. Please test it out and let me know if it crashes after many messages. If it doesn't there won't be a limit. Otherwise, I may implement one. Alternatively, I may look into gzipping localstorage content for max efficiency or something like that.

EvanZhouDev commented 1 year ago

By the way, if you're not already, join the Raycast Community Slack channel: https://www.raycast.com/community. Then, send me your username, and I'll chat with you in DM instead. I will be much more active on Slack than some closed Github issue that I have to scroll so much down on. Of course, if you'd rather chat here its fine too.

rochakagrawal commented 1 year ago

Thanks so much. Will join slackSent from my  iphone On 20 Jun 2023, at 7:31 PM, Evan Zhou @.***> wrote: By the way, if you're not already, join the Raycast Community Slack channel: https://www.raycast.com/community. Then, send me your username, and I'll chat with you in DM instead. I will be much more active on Slack than some closed Github issue that I have to scroll so much down on. Of course, if you'd rather chat here its fine too.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>