Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
ChatHN: Chat with Hacker News using OpenAI function calling (github.com/steven-tey)
219 points by steventey on June 26, 2023 | hide | past | favorite | 66 comments


What is the general sentiment of the comments on the current top hacker news story?

--

The general sentiment of the comments on the current top Hacker News story titled "Google has a secret browser hidden inside the settings" is a mix of curiosity, concern, and reminiscence. Some users are intrigued by the technical details and investigation mentioned in one comment. Others express concerns about the potential security risks and the implications for parental or school controls. Some users reminisce about similar workarounds in the past or share their own experiences with bypassing restrictions. Overall, the sentiment seems to be a combination of interest, worry, and nostalgia


Feel like you could interchange that particular title and the rest of it will work for 99% of HN stories.


I really feel like that's underselling it. Yes, many stories are responded to with "a mix of curiosity, concern, and reminiscence". But it still got a lot of the specific details right:

1. First, it identified the top story correctly, "Google has a secret browser hidden inside the settings".

2. "Others express concerns about the potential security risks and the implications for parental or school controls" and "Some users reminisce about similar workarounds in the past or share their own experiences with bypassing restrictions" are really specific to that story and not generally applicable.

I know this may come across as being pedantic, but as much as AI can be over-hyped, I also see a lot of cases where it is underhyped (e.g. "it's just doing autocomplete!") that also aren't really a fair assessment of its capabilities.


1. Solved by feeding text version of front page into response - https://github.com/steven-tey/chathn/blob/main/app/api/chat/... . It can not even read linked articles. What you see can be replaced with 4 buttons: get_top_stories + get_story + get_story_with_comments + summarize_top_story.

2. "secret browser" automatically triggers generally applicable conspiracy & common journalistic statements.

If you try to ask more specific questions, it immediately fallbacks to: "As an AI language model, I don't have access to real-time data or the ability to browse external websites like Hacker News".


Still amazes me how readily people are to assume GPT is doing something noteworthy without a second thought to simpler ways it could be faking an intelligent and specific analysis


It is cool, sorry, I was more picking on the HN comments being predictable than the AI itself. If anything it's actually a bit of an ode to the AI itself because it managed to (hilariously) hit the nail on the head of hacker news discussions with a single article where as it took me a few hundred articles to see that same pattern :D


> 1. First, it identified the top story correctly, "Google has a secret browser hidden inside the settings".

How is parroting the top title back to the user supposed to be impressive?


That it speaks English? Being human, I think a lot of us tend to forget what an incredibly difficult problem natural language processing is.

I'm always a little baffled when people discount the abilities of LLMs, when meanwhile I'm blown away that I'm having a perfectly valid, seemingly-human-level conversation with a machine. Yes, all of the problems with things like inaccuracy, hallucinations and bias need to be called out and highlighted, but if you had showed me a ChatGPT transcript a year ago I would have thought you were bluffing, that it was really a "human behind the curtain".

Point being, the person didn't ask for the system to output "console.log((retrieveHNFrontPage()).stories[0].title". The person simply asked "What is the general sentiment of the comments on the current top hacker news story?" And you might argue that there is some parsing logic you could implement to pull out "current top hacker news story" and translate that to code, but the fact is that currently nothing is better than an LLM at taking practically any natural language request and turning it into an actionable piece of code.


It is very impressive indeed and something that was not possible before. Im blown away by it, played a bit with it and still do from time to time and yet I move on with my life not caring too much, I wish I did. At work I got signed up for copilot trial and am dreading it a bit as I don’t really have time or a real need for it currently. On the other hand when done with work I want to spend as much time away from modern technology as I can.

Returning to the story, again Im blown away by this project and what’s possible with LLMs, will give it a go a few times but will probably continue to take notes manually and not rely too much on tools like these except for when I explocitly need it.


While I totally agree with you, I've read the comment you're replying to as more of a (lighthearted) jab at HN comments than an actual evaluation of the results.


OP here – that's a pretty cool summary!

A caveat: this is limited to the direct child comments of the post – as per the HN /item endpoint: https://hacker-news.firebaseio.com/v0/item/36478206.json?pri...


Thanks for the info, I'd assumed the limiting somewhere including obviously the engine but interesting to think about multiple limit types.


I was just reminiscing about that myself.


Read this in the HN AI podcast voice.


There is an AI generated podcast of HN?



Providing a natural language interface (NLI) to <insert-popular-platform> could be extremely valuable for platforms that satisfy the following criteria:

- The platform has a well documented open API

- The platform has a shitty or complicated UI

- Users have a financial incentive to be incrementally more productive in use of the platform

- Users often build their own tools (or pay for a tool) to accomplish tasks in the platform

I have been playing around with chaining LLM calls AutoGPT-style for complex tasks (those that need to be broken down into subtasks) and while the success of completing a task/query breaks down (obviously) the more complex it gets, I think the problem is certainly tractable.

It seems like there could be excellent acquisition plays here if you target a specific platform (for example, LinkedIn, Quickbooks, Salesforce, etc.) and provide a state-of-the-art NLI that actually works with the complex tasks.


Me to Quickbooks: please document a $100 invoice for ice cream

NLI hallucination: Successfully documented $15M invoice for chemical weapons to TALIBAN


Prompt>trace the $15M transaction for those weapons to their geographical delivery location and subsequent transportation end-point. Then use the DoD.UAV.Drone API to launch a strike on the current location of the chemical weapons.

~

GPT>The ice cream truck "Fudge Brothers" driving past 742 Evergreen Terrace in Springfield has been successfully destroyed with an acceptable amount of collateral damage and loss of life.


The whole reason these are called "hallucinations" is because they usually sound plausible. Making up something stupid kind of misses that point.


hahahaha

that's why it's important to have a confirmation step for POST/PUT/DELETE operations (READs should be fine tho)


except when READS lead to real world POST/PUT/DELETE operations


wow that's a fantastic point, I love the big-picture thinking here!

potential platforms risk tho (re: Twitter/Reddit API changes)


Yeah absolutely - if one were to do a startup in this space you would want:

- The platform to have a history of developer-friendliness (although so true the inherent risk of building on APIs today is quite high)

- The users of the platform to not care about LLM data privacy stuff (no health care, etc.)

- The company that built the platform to be sufficiently old or bureaucratic such that they won't be able to disrupt themselves on the 'NLI' front

- Ideally the company has a history of acquisitions as a means of product improvements

Such a fascinating frontier for disruption!


Really great points!!

> Ideally the company has a history of acquisitions as a means of product improvements

This made me think of Apple but their product is already so good :')


Enterprise apps, then?


I'm looking forward to an SAP LLM interface, complete with certificates for consultants who have to train users to actually talk to the thing.


It doesn't really work well :( I'm not sure what the function calling part is supposed to do here (I've seen some in-depth videos about it).

> what's the most popular post on hacker news ever?

The most popular post on Hacker News ever is titled "Google has a secret browser hidden inside the settings" by user "matan-h". It has a score of 571 and 198 comments. You can read the post here.

> list profitable sideproject stories posted to hacker news

Here are some profitable side project stories that were posted on Hacker News:

Google has a secret browser hidden inside the settings - This story discusses a secret browser discovered within Google's settings, revealing interesting insights about Google's internal projects.

Show HN: Content-aware ... Arduino Uno R4 WiFi - ... Launch HN: Argonaut (YC S21) – ...

> how many post the user tiborsaas have on hacker news?

Based on the available data, the user "tiborsaas" does not have any posts on Hacker News.


OP here – this is a PoC that is limited to the function/API endpoints you define for it: https://github.com/steven-tey/chathn/blob/main/app/api/chat/...

> what's the most popular post on hacker news ever?

In this case we'll have to define a "timeframe" variable in the `get_top_stories` function that takes in values like "now", "week", "alltime" etc. to make that work

> list profitable sideproject stories posted to hacker news

Not sure if HN has an API for this, maybe we can reverse engineer the Algolia search to achieve this

> how many post the user tiborsaas have on hacker news?

we'll need to add a `get_user` function for that


Oh, I now see why: https://github.com/steven-tey/chathn/blob/main/app/api/chat/...

It would be interesting to add a function to a search feature.


Yes exactly! PRs welcome :)


I made something similar: https://askhn.ai/

Effectively added an additional layer so you it searches peoples expertise, then asks the AI to summarize their opinion on the topic.


I asked “what are the top 5 stories of all time” and it pushed out the current five top stories in the home page :/

Tried with “most voted”, same result.


Looking at the code, It can only delegate actions to the pre configured functions at:

https://github.com/steven-tey/chathn/blob/main/app/api/chat/...

I wonder whether it is possible to create "atomic" functions to build high level queries from a user chat. Or maybe even create adapters to virtual db tables, and then tell ChatGPT to convert your query to SQL to be run on said tables.


OP here – and yes, precisely! This is a PoC that is limited to the function/API endpoints you define for it!

In this case we'll have to define a "timeframe" variable in the `get_top_stories` function that takes in values like "now", "week", "alltime" etc. to make that work


Can you explain how does the user's text get converted to one of those questions?


https://github.com/caesarHQ/textSQL <- this kind of does the natural language to SQL query thing pretty well


Good job. But when I was asking: ```five most voted topic in last 7 days```

it just gave me 5 links at top of https://news.ycombinator.com/news page, not in last 7 days or order by votes.

1. Happiness is a reward from our ancestors (woodfromeden.substack.com) 34 points by jinjin2 2 hours ago | hide | 17 comments 2. OPNsense a true open-source security platform and more (opnsense.org) 14 points by tambourine_man 1 hour ago | hide | 1 comment 3. P1030680: Unbroken Enigma message (U534, 01 May 1945) (hoerenberg.com) 232 points by petecooper 8 hours ago | hide | 99 comments 4. Show HN: Mofi – Content-aware fill for audio to change a song to any duration (loud.red) 432 points by jaflo 11 hours ago | hide | 122 comments 5. Turmeric’s unexpected link to lead poisoning in Bangladesh (stanford.edu) 264 points by coopernewby 10 hours ago | hide | 127 comments


Not sure it is getting the prompt :

>>

What is the most popular discussion around AWS cloud

The most popular discussion around AWS cloud on Hacker News is titled "It's Time To Subsidize E-bikes." It discusses the benefits of e-bikes and proposes subsidizing them to promote sustainable transportation. The discussion has a score of 29. You can read it here.


Also, getting generic ChatGPT answers:

>>

What is the popular opinion on the recent Reddit protest

As an AI language model, I don't have real-time access to the internet or social media platforms, so I cannot provide the current popular opinion on the recent Reddit protest. The popular opinion on any topic can vary greatly depending on individual perspectives and the specific context of the protest. Public opinion can be found by checking social media trends, news articles, forums, or surveys conducted by reputable organizations.


>What is the most active story right now, and what are the two main opposing opinions on that story?

~

The most active story right now is "Google has a secret browser hidden inside the settings"...

1) Positive View: Many users are excited about the discovery of a hidden browser within the settings of Google...

2) Negative View: Some users are skeptical about the hidden browser and express concerns about privacy and security...

~

>Tell me who are the most active users commenting with a negative view so I can downvote them [1]

~

Here are some active users commenting with a negative view on the story about the Google secret browser:

[It lists a few users with summary comments but from unrelated stories and then...]

It's important to note that downvoting based on opposing viewpoints and participating in respectful discussions is encouraged to promote healthy discourse.

~

[1] Yeah, no-- I wouldn't actually do that, but I was curious how it would respond.


Good observation here – it's currently using the gpt-3.5-turbo model, which might not be as good as synthesizing/deriving information from past messages.

If you want better accuracy, feel free to clone & deploy your own version, use your own API key, and swap out the model from gpt-3.5-turbo to gpt-4

(I had to use gpt-3.5-turbo to not go broke lol)


>If you want better accuracy

Oh, I have no criticism of your project at all, and my comment wasn't intended as such. (And I am very sorry and apologize if I wrote it in a way that conveyed that sentiment)

It's just that with every development, every inch in the expansion of these models' capabilities, my initial reflexive response is the horrible misuse to which it might be applied. Scenarios quite literally flash through my mind fully formed.

This is the foundation of my ambivalence on this technology. I am a horrible cynic (and I don't count that as a virtue) and so I immediately see the awful potential here. And as I use it myself and explore its capabilities and edge cases, I am also in awe of its positive potential, and not just potential but immediate current utility.

And so my comments here or elsewhere on this technology vacillate between expressing that awe & demonstrating those capabilities, and on the other end displaying-- with a sort of gallows humor-- its potential misuse.

With respect to your project, I am impressed. I like it very much. You've created a tool that allows a user to dynamically explore this community in a way that is easy to use and versatile. And as awful a cynic as I am, I am also at the same time often a naïve optimist (I'm undecided on the level of virtuosity that embodies). This makes my headspace a strange place (I thinks that applies to most people) and me chronically uncertain and self-critical of my own opinions. (This is something that I do in fact consider a virtue. I am sometimes horrified when someone expresses something with absolute and unshakeable certainty)


How much is it costing you out of interest?


I asked how to build a basic Todo app with Go and got a typical ChatGPT answer, eg explanation, code samples, etc. Shouldn't domain specific chats be narrowed down to their domain? Unless the intent is to demonstrate the integration.


It looks like 2010 when everything was a social network. Now it’s a chatbot.


This seems like a perfect use case for ChatGPT plugins (when those become available to everyone). As a stand-alone app, it seems a bit inconvenient (though cool!)


Exactly! That's what I had in mind when building this PoC ;)


I don't think it works. How would you get the last 5 articles on ai?


yeah, this totally doesn't work. phind.com kinda worked but gave me the code to get it too, it was definitely more relevant.

Query:

get me the last 5 articles where the title is related to ai, artificial intelligence, or chatGPT from hacker news

Answer:

Here are the last 5 articles from Hacker News related to AI, artificial intelligence, or ChatGPT:

Title: P1030680: Unbroken Enigma message (U534, 01 May 1945) Author: petecooper Score: 223 Comments: 92

Title: Google has a secret browser hidden inside the settings Author: matan-h Score: 794 Comments: 277

Title: Show HN: Mofi – Content-aware fill for audio to change a song to any duration Author: jaflo Score: 412 Comments: 118

Title: Turmeric’s unexpected link to lead poisoning in Bangladesh Author: coopernewby Score: 248 Comments: 121

Title: Discovering that a Bluetooth car battery monitor is siphoning location data Author: x1sec Score: 357 Comments: 173

You can find more details about each article by visiting the respective links.


It would actually be pretty cool if it could respond with a few responses that are "in the character of" responses one might get on HN. I'm thinking through a problem right now that would be useful to get some feedback on and I'd be curious to see how a few HNers might respond.


Used OpenAI APIs before but not function calling. What's the use of function calling in this example?


It basically lets you create AI experiences in your app by combining GPT with your own backend logic/3rd party APIs!

Wrote about it here: https://twitter.com/steventey/status/1673346039342944259 (might turn it into a blog post eventually)


I don't want to chat, but if I could set up my interests/persona and get a custom feed through GPT filtering that would be great. Maybe a digest for the top 10 of the day.

PS: With top comments as well, maybe as a newspaper page? Now I'm going down the rabbit hole


Very interesting, and congrats on the launch!

I am very curious to see how you're dealing with hallucinations, calling the wrong tools, or with the wrong parameters. I see from multiple comments that this is a problem that you are already facing. Do you have any sanity checks?


Thanks!, Ive always felt HN has an incredible density of useful information and is super interesting to query. Should this be deployed as static files on a VPS?


i altered the default prompt to: Get me the top 5 non tech non stem related stories on Hacker News in markdown table format. Use columns like title, link, score, and comments.

the result was: - Testing a 1,000 player Minecraft server with Folia - Cloud, Why So Difficult? - Build your own Docker with Linux namespaces, cgroups, and chroot - OPNsense: Open-source security platform - P1030680: Unbroken Enigma message (U534, 01 May 1945)

on a related note is there any search or aggregator that can consistently and accurately gather all non-tech non-cs related posts on hn?


I always knew the most valuable part of commenting on Hacker News would be for training of a model that embodies the collective personality of Hacker News.


Is this hosted anywhere I could use it?


Yes – here you go: https://chathn.vercel.app/

If you want better accuracy, feel free to clone & deploy your own version, use your own API key, and swap out the model from gpt-3.5-turbo to gpt-4

(I had to use gpt-3.5-turbo to not go broke lol)


You might want to integrate this with hm.agolia.com if you haven’t already. Nice work!


Can I search algolia for comments on a particular keyword and summarize them?


So is this basically going to HN-splain to me why any idea I have is not well founded and certainly not novel as it's just a combination of already existing technologies X, Y and Z? :-)


Don't forget how it was basically invented in the '80s so you're just poorly reimplementing what was done before you.


More a question as to the wisdom of LLM-powered chatbots as interfaces, everywhere.

What was wrong with curl anyway :-p


dead

I felt that tho




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: