3 ms·
Show HN: ChatHN – Chat with Hacker News using natural language
Hi again Hacker News! OpenAI recently launched "Function Calling", which is a way for developers to describe functions to GPT-3.5/4 and have the model intelligently choose to output a JSON object containing arguments to call those functions.
I decided to tinker around with it this weekend and build an MVP that uses OpenAI Functions + Vercel AI SDK to "chat" with the Hacker News API using natural language, in real time!
It's fairly basic for now (supported functions: https://github.com/steven-tey/chathn/blob/main/app/api/chat/functions.ts https://github.com/steven-tey/chathn/blob/main/app/api/chat/...) but just wanted to launch this as a proof of concept (PoC)! Hope y'all like this :)
- graylien 3y agothis is so cool how it writes into the table, thanks for all the examples!
- steventey 3y agoThank you! It's actually all thanks to the amazing react-markdown package (https://github.com/remarkjs/react-markdown https://github.com/remarkjs/react-markdown), can't take any credits there :')
- jqpabc123 3y agoThe quality of the results leave a lot to be desired. I asked for the latest posts related to crypto.
- quickthrower2 3y agoDidn't know who "HN's favourite salaryman" was. But asked specifically about is patio11 in Japan or China, it knew. Good ol' vector search.
- quickthrower2 3y agoLoose lipped large language models! Assistant prompt 1: "Retrieve the top stories from Hacker News and provide a summary of the most interesting story." System prompt: "The assistant should use the get_top_stories function to retrieve the top stories from Hacker News. Then, it should provide a summary of the most interesting story using the retrieved data. Make sure to include the Hacker News URL to the story in the response." Assistant prompt 2: "Retrieve a specific story from Hacker News using its ID and provide a summary." System prompt: "The assistant should use the get_story function and provide the ID of a specific story to retrieve it from Hacker News. Then, it should provide a summary of the retrieved story along with the Hacker News URL." Assistant prompt 3: "Retrieve a specific story from Hacker News using its ID and provide a summary including its comments." System prompt: "The assistant should use the get_story_with_comments function and provide the ID of a specific story to retrieve it from Hacker News along with its comments. Then, it should provide a summary of the story and its comments along with the Hacker News URL." Assistant prompt 4: "Summarize the top story from Hacker News, including both the story and its comments." System prompt: "The assistant should use the summarize_top_story function to retrieve the top story from Hacker News along with its comments. Then, it should provide a summary of the story and its comments along with the Hacker News URL."