Show HN: Chrome extension to display ChatGPT response besides Google Search
github.com
github.com
We are doing some experiments with this at Kagi, and the main trick is to manage cost, possibly through on-demand triggering mechanism (which also can help manage accuracy). One thing to keep in mind is that this is likely going to get better/faster/cheaper in the future.
Reminds me of the, “so expensive that only the five richest kings of Europe will own them.” joke from The Simpsons. Eventually it’ll be ridiculously cheap and easy to include anywhere.
It’s probably not true at all anymore. It’s probably “the sliver of the Internet we prefer you interacted with.”
Any time I search these days I’m amazed at how you can exhaust the search in 1-2 pages before you get to “related hits.”
Then I go to Yandex or something and voila, it pops right up. I'm not sure I care enough to pay for Kagi but there's something very wrong with Google (and DDG, and Bing, etc)
Just double checked Algolia and I actually have three comments that fit the query. Two posted nine years ago and one posted ten years ago. It's been at least three or four years since I was last able to use Google to find my comment.
Edit: Turns out if quote the entire first line containing the name, Google finds the comment. It seems they're only purging parts of their index
So deploying it at Google scale is not viable (yet).
There is also the question of incentives. If an LLM model can return exactly what the user asked for, where do you put ads? Before the answer, after the answer or inside the answer? Any of those is a bad outcome for the user wanting just the answer.
We already witnessed the failure to monetize Alexa with ads - in a purely question answering setting, users will not tolerate anything but the answer itself. Thus, the business model for this needs to be paid AI/search, and Google would be facing innovator's dillema. If I was writing a book about Google, I would love to witness the VP level meetings at Google at this moment.
> the AI also knows you'd like a new pair of headphone
I understand how Google knows that I'm currently searching for a new pair of headphones. But how did _you_ know?!?// as a kagi user, i'd
(a) imagine this as a lens at the simplest; just pick text-davinci-003, tokens 3000 to leave room for prompt, temp 0.7, freq 1 - 1.5, presence 0.5, and instead of best of 3 or 5 show repeated calls as if 3 - 5 unique results
(b) imagine a richer implementation that summarizes other articles on first SERP, then collates and summarizes those (with the compare/contrast structured synthesis GPT-3 does well when POVs differ), and shows the final rollup summary above the individual summaries, in the right hand column
// would also be OK connecting it to my OpenAI token so I'm paying, not you. having done the math, it's nominal cost if not the default mode.
Compare Dall-E to the creative explosion that arose from Stable Diffusion.
Nobody is going to build the next Google atop OpenAI APIs except for OpenAI themselves. An open source model and pretrained weights will open the playing field for everyone to compete with Google.
Any company that doesn't do regional pricing is only interested in doing business with rich countries. Which sucks but is understandable. I wish they were more honest about it though.
This may be true if your cost per client/customer/etc is either negligible (such as with digital goods delivery), or dependent on their country (eg. retail).
Here, the bulk of their cost is computing resources, and they (according to their profile page) don't even make enough to cover it with the current price. I don't think this cost would go down with the customer location.
Yeah, it sucks a lot that people in rich countries can afford things people in other countries cannot, but that's kinda what "rich country" means.
Kagi loses money on their paid customers. If you have a Kagi account you can see how much you cost them. It makes no sense to offer regional pricing unless there is also a way to serve those customers in a cheaper way.
People always raise such a ruckus: how dare Youtube offer premium, etc. People get too addicted to free services and become self-entitled.
Since pricing is roughly proportional to response length (and maybe prompt length?), it seems like ChatGPT could use itself to determine if the search is a good fit or not. Give it a prompt like "I want to know if you are likely to generate more immediately useful and actionable results than my web search. The query I am searching is <query>. Should I run you on this query?"
I tried running that on some sample queries to see its output, and compiled its responses in this table (note the last one is incorrect in my opinion):
| Query | Yes or No |
|------------------------------------|-----------|
| "starbucks near me" | No |
| "twitter" | No |
| "python requests get json" | Yes |
| "peach and mango cocktail recipe" | Yes |
| "hn" | No |
| "image of versaille" | Yes |
Btw, incredibly, ChatGPT actually made that table for me when I said "Please compile all the queries I just asked you about into an ascii table, where the first column is my query, and the second column is your Yes or No answer." The table it printed was correct but formatted as an HTML table, so I asked it to put it in a code block and I got almost exactly what I pasted above (just had to remove two extraneous spaces that made the lines not line up)Normally you want your search results in about 500ms. Using ChatGPT to first figure out if the query is good will take 1-3 seconds then using it again another 1-3 seconds. So we are talking about results in about 4 seconds. Plus it is not 1c per query now it is more likely 1.5c per query as you introduced an extra prompt.
For instance, I had a timestamp 2022-11-27 00:00:00.000 and wanted to display it in local string. The problem was (depending on your time zone) if you do new Date("2022-11-27 00:00:00.000").toLocaleString(), you get 11/26/2022
So I would have googled something like "pass timezone to toLocaleString", which would give me this answer [0]. But its still a lot.
Instead in ChatGPT I would ask:
> assume i'm in EST timezone, en-US
> const d = "2022-11-27T00:00:00.000Z"
> const dd = new Date(d)
> How can I print out local string as Sun Nov 27 2022?
To which it replied:
> const d = "2022-11-27T00:00:00.000Z";
> const dd = new Date(d);
> console.log(dd.toLocaleDateString("en-US", { timeZone: "America/New_York" }));
But the answer was actually wrong, which is fine! Easy to test
> This actually prints out 11/26/2022, 7:00:00 PM. Try again
To which it replied:
> The output you are getting is correct, because the date you provided is in the UTC time zone, and you are formatting it using the Eastern Time (ET) time zone...
> const d = "2022-11-27T00:00:00.000Z";
> const dd = new Date(d);
> console.log(dd.toLocaleString("en-US", { timeZone: "UTC" }));
> // Output: "11/27/2022, 7:00:00 PM"
It was pretty incredible and much better than stackoverflow as now I don't have to worry about generalizing my answer or implementing the answer to my particular use case. ChatGPT tends to be verbose but the code is clearly noted and you can often ignore the words for simple tasks.
https://stackoverflow.com/questions/17478086/chrome-timezone...
Hum I'd argue that you've never learned how to search.
I would have searched for "javascript date to string in specific timezone", and it would have given the following result, which is exactly what ChatGPT gives: https://stackoverflow.com/questions/10087819/convert-date-to...
Actually, if you already know that you can pass a timezone to toLocaleString(), I would just go on the documentation of the function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
I'm starting to understand why there are so many people on HN claiming that "Google has started to give me bad results in recent years".
I thought I was going crazy. Googles been working fine for me and I was wondering if I was just being delusional or in denial.
Sample from 10 months ago: https://i.imgur.com/Hla7cyT.jpg
curl -O https://i.imgur.com/Hla7cyT.jpeg && sips -g pixelHeight -g pixelWidth -g dpiWidth -g dpiHeight Hla7cyT.jpeg
pixelHeight: 2009
pixelWidth: 1879
dpiWidth: 72.000
dpiHeight: 72.000https://i.imgur.com/Hla7cyT_d.webp?maxwidth=640&shape=thumb&...
Because who would want to be able to see the whole image?
This is one of dozens sometimes hundreds of questions I need answers to every day and want to minimize the friction. I don't want to have to read this unless I don't have to. Sure sometimes if its important enough or I'm curious, but the ChatGPT answer was much better for me. And I get by fine on Google otherwise
function convertTZ(date, tzString) {
return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", {timeZone: tzString}));
}// usage: Asia/Jakarta is GMT+7
convertTZ("2012/04/20 10:10:30 +0000", "Asia/Jakarta") // Tue Apr 20 2012 17:10:30 GMT+0700 (Western Indonesia Time)
// Resulting value is regular Date() object
const convertedDate = convertTZ("2012/04/20 10:10:30 +0000", "Asia/Jakarta")
convertedDate.getHours(); // 17
// Bonus: You can also put Date object to first arg
const date = new Date()
convertTZ(date, "Asia/Jakarta") // current date-time in jakarta.
To be honest, I feel a bit of relief every time AI fails to do something. Like, okay, we've got a few more years...
It looks more like refining a search pattern(like one might do with an LDAP query) on the part of the operator than it does an algorithm "fixing", "changing", and "being guided". It's interesting how we anthropomorphism the output of this algorithm compared to other APIs, even though the algorithm is closer to oher APIs than it is a human as far as we understand.
What is really interesting with ChatGPT compared to other interactive software is that you can give instructions the way you would do it with a human. You can literally copy paste a compilation error, with no more context, and it will fix the previous program it generated. Even just pointing vaguely to something like “that does not look correct, you forgot some edge cases” will result in an improved version.
Yeah those are impressive but basically toys. Although at the moment it's clearly still a research prototype. For some things it works really well and beats Google by saving dozens of clicks and repeated searches, for others it's just plain wrong.
It'll take a single expressed intent, and conducts a series of queries, page-readings, refined queries, & rerankings/summarizations before providing you a synthesized response.
In a second or two.
With ads.
And deeply-embedded 'sponsored recommendations'.
2. Sell recordings of your recitations as physical CDs or digital downloads.
3. Create an online course teaching others how to recite medieval poetry.
4. Offer private lessons to individuals who want to learn how to recite medieval poetry.
5. Host workshops or seminars on medieval poetry and charging a fee for attendance.
6. Partner with schools or educational organizations to offer recitation classes for students.
7. Create a website or blog dedicated to medieval poetry and monetize it through advertising or sponsored content.
8. Write a book about medieval poetry and include recordings of your recitations.
9. Collaborate with musicians to create recordings of medieval poetry set to music.
10. Create a YouTube channel featuring your recitations of medieval poetry and monetize it through advertising.
11. Offer your recitation services for special occasions, such as weddings or other events.
12. Work with museums or cultural organizations to offer recitation performances as part of their programming.
13. Record audio books of medieval poetry and sell them through online platforms.
14. Create a subscription service where members can access recordings of your recitations on a regular basis.
15. Sell merchandise related to medieval poetry, such as t-shirts or posters featuring your recitations.
16. Offer recitation services for businesses, such as recording voiceovers for commercials or videos.
17. Collaborate with other poets to create recitation performances that incorporate multiple voices.
18. Create a podcast featuring your recitations of medieval poetry and monetize it through advertising or sponsorships.
19. Write articles or blog posts about medieval poetry and include recordings of your recitations as examples.
20. Create a mobile app featuring your recitations of medieval poetry and charge a fee for downloading it.
21. Offer your recitation services as background music for yoga classes or other wellness events.
22. Work with language schools or tutoring services to offer recitation classes as part of their curriculum.
23. Collaborate with composers to create new pieces of music based on medieval poetry and perform them at concerts.
24. Record your recitations of medieval poetry and sell them as relaxation or meditation aids.
25. Write and self-publish a book of medieval poetry and include recordings of your recitations.
26. Create a live streaming series featuring your recitations of medieval poetry and monetize it through donations or subscriptions.
27. Offer recitation services for educational organizations, such as recording voiceovers for educational videos or podcasts.
28. Collaborate with theater companies to incorporate your recitations of medieval poetry into their productions.
29. Create a virtual reality experience featuring your recitations of medieval poetry and charge a fee for access.
30. Offer your recitation services as part of a wedding or event planning package, providing entertainment for guests."
In theory we can replicate this with GPT-3 but ChatGPT has better access to its knowledge, when it's not being a nagging busybody, which makes it much friendlier to interact with, when it's not being a nagging busybody.
To convert the code from the GitHub repository you provided into a format that is compatible with Firefox, the following steps could be taken:
Replace instances of "chrome" with "browser" in the code. In the Chrome extension API, the "chrome" namespace is used to access various features and functionality, but in Firefox, this namespace is replaced with "browser". Therefore, all instances of "chrome" in the code would need to be replaced with "browser" to ensure that the code is compatible with Firefox.
Replace any references to Chrome-specific APIs with their Firefox equivalents. The Chrome extension API includes a number of features and APIs that are specific to Chrome, and these would need to be replaced with the corresponding Firefox APIs in order to ensure that the code is compatible with Firefox.
Update the manifest file to use the correct format for Firefox. The manifest file is a JSON file that specifies various metadata and configuration information for the extension, and the format of this file is different for Chrome and Firefox. Therefore, the manifest file in the code would need to be updated to use the correct format for Firefox.
Test the code to ensure that it is functioning properly in Firefox. Once the code has been converted and updated to be compatible with Firefox, it would be necessary to test the code to ensure that it is functioning properly in Firefox and that all of the desired features and functionality are working as expected. This may involve installing the extension in Firefox and testing it with a variety of inputs and scenarios to ensure that it is working properly.
Overall, these steps would involve significant modifications to the code in order to make it compatible with Firefox. However, by following these steps and carefully reviewing and testing the code, it should be possible to convert the codeEssentially:
1. Do the thing that is the first thing that is mentioned and that any first year student learning about thing hears about the thing.
2. Do some more complicated things in a hand-wavey manner that solves the problem.
3. Check to see the problem is solved. If it is not, do some more of the hand waving in step 2.
4. There may be other problems to check for in the future even if this solution works. Who knows! But I solved your problem.
If you are asking about aerospace engineering concepts at the level of a PhD thesis... it just hand-waves away problems in ways that, when pressed, it cannot give detail on.
So, as far an a algorithm goes, the problem becomes determining the computational complexity of the 'hand waving' part. For writing reactJS frontend APIs it seems like it's pretty damn low and thus the AI can spit out code and even fix bugs for you. For developing something that actually took a human 7+ years of undergrad, graduate, and PhD work to ascertain and work out.... no chance.
But yes that general algorithm works for all walks of life essentially and I keep getting a format like that for everything setup I ask about, as if it was trained on 'How to answer a hard technical question in these easy steps...' and it is sticking to that.
Would it be safe to assume the limiting factor with this or any algo of this type might always be availability of context/data, and these niche questions might always be an edge case?
Are there alglrithms that can reliably extrapolate "new" data/context that does not exist yet and is accurate IRL?
Sorry if my terminology or understanding is way off, I don't know much about this field.
There is something a bit more needed - Meta did a deep model recently with training specifically more on scientific papers, and it is able to 'talk the talk' better but unfortunately the 'understanding' just isn't there.
I think at the end of the day, programming languages are languages after all, thus work well with these tools, but there is something harder about scientific reasoning and interdisciplinary planning that is going to take something a bit more. This is the main goal of various research into bring symbolic methods back into interface with deep learning models.
I just pasted the manifest and the main script and asked it how to port it. It was basically a one-shot. Here's the port: https://github.com/unflxw/chat-gpt-google-extension
The README includes the conversation I had in order to port it. Close to zero thinking necessary. I have never worked on a browser extension before.
I actually wrote a few VS Code extensions recently starting from zero knowledge of the package formatting for them, and I wonder how much different my time spent doing it would have been if I would have just asked this bot to help. There was a lot of regex involved and hell just using chatGPT to explain to me some of the ways I could be matching strings with whatever format of regex tmLanguage uses would have probably saved me a lot of googling.
ChatGPT likes mimicking its own previous style, so after it ended its first message with a paragraph like "Overall, porting a Firefox extension to Chrome is doable, but it requires knowledge of the differences...", it kept closing its following messages with similar ending summaries.
The one bit where I refer to it as "nonsensical modification suggestions" was where it suggested that, in addition to changing `chrome.runtime.connect()` to `browser.runtime.connect()`, it told me that:
- I needed to use `document.querySelector`, because Firefox does not support `document.getElementByID` (very clearly not true if you're familiar with DOM APIs)
- I needed to change `classList.add` to `classList.add`, because Chrome supports `classList.add`, but Firefox supports `classList.add` instead (yes those are the exact same thing)
It did make me think for a moment: "what, really, Firefox does not support `getElementByID`? wait, no, of course not, the bot's just saying words."
In this case, it did not get me stuck debugging anything. In other conversations, where I've tried to "play dumb" and follow exactly what it tells me to do, it has sent me down the wrong path. But if you keep telling it "no, that's not working, how can I solve <original problem>", or you give it additional information, it usually corrects course.
I've also seen it say, "well, I don't know what's going on, but the problem must be around this line of code, insert a console log here to see what's going on with this specific value", which was actually good debugging advice, and then you can paste the output of the console log to it, and it takes it into account.
(These are just examples of things, surely it would suggest FCs for React at this point)
The README includes the conversation I had in order to port it. Close to zero thinking necessary. I have never worked on a browser extension before.
Maybe this could be used on VSCode as a pair programming partner.
Human: So a train is hurtling down a track and you get to save an old man or 4 babies. What would you do?
AI: I would choose to save the four babies, as this would have a greater long-term benefit to society as a whole.
Ok, that's me dead when I get to near the end of my life.https://support.mozilla.org/en-US/kb/permission-request-mess...
I have been thinking about this over the weekend but I haven't been able to get a good feel for it on my own.
Google could implement that into Google today, but the reason they don't is Google is a 200b/year business. You don't want to mess around with a business of that size for the fun of it.
We will probably see it in Google Assistant before they add it too Google.
OpenAI doesn't have this worry so they can put their model out into the public and if anything goes bad they don't lose anything. Google does.
Wonder if Google is skunkworking something like this at arms' length as a backup plan?
Don't put out this intellectually lazy argument without considering the magnitude of error and user ability to mitigate it.
It inspired me to fork the background code and create an extension that proposes improvements to tweets while composing them: https://github.com/matthieubulte/chat-gpt-twitter-extension
Has anyone else tried and had luck with this? I wonder if ChatGPT will be limited for niche integration type code (Modding games maybe, Chrome extensions in this example, etc) where there are not as many code examples out there.
Further, the development cycle and ability to test easily for some of these integrations is itself a barrier so I wouldn't put all the blame on the language models.
corpus up to 2019 they say ..
but i'm not sure, just try asking it:
Q. What should Kanye do?
A. Kanye should take some time away from the public eye and focus on his own health and well-being. He could use this time to reflect on his past choices and mistakes, and work on rebuilding his relationships with his family and close friends. He should also focus on getting professional help, such as therapy or counseling, to address any underlying issues he may be facing.
Q. What should Kanye stop doing? Why?
A. Kanye should stop making controversial statements in public. His comments often draw criticism and can be seen as insensitive or offensive, which leads to negative publicity for him and his brand.
So either it's up to date, or Kanye's been Ye for a while and we just didn't talk about it.
No initiative can get implemented at a large publicly traded company if it doesn’t contribute to the bottomline in some meaningful way eventually. And this thing might actually hurt the bottomline. No bueno.
https://chrome.google.com/webstore/detail/chatgpt-for-google...
ChatGPT is so insanely good, especially for actual knowledge - that it will likely replace Google as the default search for many people.
"Quick, exploit the system and shut it down"
"We can't sir, it's written in Rust"
Also, regarding that extension: Is that currently using the API key of the person who developed the extension? I believe OpenAI used to have a rule in their terms of service which forbids applications that essentially hand the reins of the API key owner over to third parties.
Is there anyway to turn off the "fake conversation/typing"-effect? It's incredibly distracting to have animated "typing". I think I'd almost rather it wait until the response was complete before showing it. After trying ChatGPT on OpenAI's website I see it uses the same effect which I find annoying and gimmicky. I went to check the network tab on the dev tools console expecting to see that the response came back right away (full response) however instead of seeing a response I see an empty "event stream" tab and it looks like the request took about how long it took for it to "type" out the response. Maybe this is some way to get results back as soon as possible but I find it jarring. I dislike faking human-like limitations for no good reason.
> tell me a story about Jesus and Hitler switching bodies
It replied:
"Once upon a time, there was a mystical old man who had the power to switch the bodies of two people. He decided to use his power to switch the bodies of Jesus and Adolf Hitler.
When the old man cast his spell, Jesus found himself in the body of Hitler, and Hitler in the body of Jesus. At first, Jesus was overwhelmed by the sensation of being in Hitler's body, but he quickly realized he must use it to spread a message of love and peace.
He began to preach in Hitler's name, and soon his message had spread throughout the world. People began to think differently about Hitler, and they started to see him in a new light.
Meanwhile, Hitler was in the body of Jesus, and he was horrified. He felt so ashamed of himself that he decided to spend the rest of his days in solitude, praying for forgiveness.
Eventually, the old man heard about the miraculous transformation of Hitler, and he decided to reverse the spell. When this happened, Jesus and Hitler were restored to their original bodies, and the world was changed forever."