[HN Gopher] ChatHN: Chat with Hacker News using OpenAI function ... ___________________________________________________________________ ChatHN: Chat with Hacker News using OpenAI function calling Author : steventey Score : 150 points Date : 2023-06-26 15:06 UTC (7 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | applgo443 wrote: | Used OpenAI APIs before but not function calling. What's the use | of function calling in this example? | steventey wrote: | 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) | ineedasername wrote: | >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. | steventey wrote: | 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) | ineedasername wrote: | >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 naive 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) | 7ewis wrote: | How much is it costing you out of interest? | mellosouls wrote: | 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 | sv123 wrote: | I was just reminiscing about that myself. | addandsubtract wrote: | Read this in the HN AI podcast voice. | steventey wrote: | 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... | mellosouls wrote: | Thanks for the info, I'd assumed the limiting somewhere | including obviously the engine but interesting to think about | multiple limit types. | boredumb wrote: | Feel like you could interchange that particular title and the | rest of it will work for 99% of HN stories. | hn_throwaway_99 wrote: | 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. | dns_snek wrote: | > 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? | LatticeAnimal wrote: | 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!) | steventey wrote: | Exactly! That's what I had in mind when building this PoC ;) | camillomiller wrote: | 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. | yonixw wrote: | 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. | sid_dubey0312 wrote: | https://github.com/caesarHQ/textSQL <- this kind of does the | natural language to SQL query thing pretty well | steventey wrote: | 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 | politelemon wrote: | Can you explain how does the user's text get converted to | one of those questions? | jekude wrote: | 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. | steventey wrote: | wow that's a fantastic point, I love the big-picture thinking | here! | | potential platforms risk tho (re: Twitter/Reddit API changes) | jekude wrote: | 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! | steventey wrote: | 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 :') | tmpz22 wrote: | Me to Quickbooks: please document a $100 invoice for ice cream | | NLI hallucination: Successfully documented $15M invoice for | chemical weapons to TALIBAN | ineedasername wrote: | 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. | olddustytrail wrote: | The whole reason these are called "hallucinations" is because | they usually sound plausible. Making up something stupid kind | of misses that point. | steventey wrote: | hahahaha | | that's why it's important to have a confirmation step for | POST/PUT/DELETE operations (READs should be fine tho) | nessbot wrote: | except when READS lead to real world POST/PUT/DELETE | operations | giovannibonetti wrote: | Enterprise apps, then? | lettergram wrote: | 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. | andreygrehov wrote: | 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. | hammock wrote: | Is this hosted anywhere I could use it? | steventey wrote: | 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) | kristiandupont wrote: | 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? :-) | Karrot_Kream wrote: | Don't forget how it was basically invented in the '80s so | you're just poorly reimplementing what was done before you. | steventey wrote: | _dead_ | | I felt that tho | specproc wrote: | More a question as to the wisdom of LLM-powered chatbots as | interfaces, everywhere. | | What was wrong with curl anyway :-p | tristanMatthias wrote: | You might want to integrate this with hm.agolia.com if you | haven't already. Nice work! | tiborsaas wrote: | 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. | steventey wrote: | 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 | tiborsaas wrote: | 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. | steventey wrote: | Yes exactly! PRs welcome :) ___________________________________________________________________ (page generated 2023-06-26 23:01 UTC)