Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: CallGPT, 1 HTML file ChatGPT API client (github.com/dmingod)
9 points by dmingod666 on March 6, 2023 | hide | past | favorite | 1 comment
I made a ChatGPT client that is contained in 1 HTML file. Would love to know what you guys think.

The idea is to have something very simple to use that people can just download and use. If they want, tweak as per their liking. (You will need an OpenAI API to use it).

- It doesn't call or use any 3rd party services (except jQuery and Bootstrap loaded from a CDN). Use your own API key, call the OpenAI API directly in its normal functioning ( there is a chatbot feature to pull top HN headlines which calls the HN API ).

- Its just an HTML file, so you can run it from anywhere.

Repo: https://github.com/dminGod/CallGPT

Direct github pages demo: https://dmingod.github.io/CallGPT/chat_gpt.html

- You can also use presets. For example, if I'm working on Golang -- I keep the Golang option selected. Now when I send a message saying : "how do I write a for loop?" it gets sent as --> "I am working on Golang. I need your help with how do I write a for loop?" (its fairly easy to change the names of technologies)"

- Almost all API settings can be changed from the frontend (temprature, number of messages to generate etc.)

I've added a few simple bot features to it as well that users can use as templates to make their own features:

- You can request in the chat: 'change the background color of this page to <any color>' and it will reply back invoking a function to change the page color. Surprisingly it even works with vauge color descriptions like 'change the background color to the color of emma watsons eyes' :D

- 'fetch the top hn stories' - Will pull up the latest HackerNews stories and show them in a 'Media' tab with

Limitations: - It doesn't have context of previous calls made to it (but its not very hard to add, probably will add a setting to send previous x messages with the current message).

- CORS severly limits the API calls that can be made from a local HTML file, so hooking it up with external services isn't straight forward for now - (I'm thinking of adding an external Golang app that will work with this page so the page can send it messages and the binary will do the heavy lifting)




Love simple html solutions. great job.




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

Search: