Hacker Newsnew | past | comments | ask | show | jobs | submit | more 1xdevloper's commentslogin

Probably because they're using a polyfill[0][1] to handle the event stream.

[0] https://stackoverflow.com/questions/55201372/event-stream-da... [1] https://github.com/EventSource/eventsource/issues/94


And that's because the native EventStream API only supports GET requests, so if you want to use a POST request (which make more sense in this context) you have to use a custom implementation...


The website also calls the moderation API from the client side with the response returned from its conversation API. So if you simply block the request to the moderation endpoint in dev tools, do they still have additional built-in monitoring?


If you block the `/backend-api/moderations` endpoint, that (as expected) doesn't block the AI from not giving you an answer.


Clicking it won't do anything. It's a POST request endpoint so you also have to provide the auth token and input.


I wonder if those testimonials and the pictures in the copycat's website are AI generated too...


I'm building something similar[1] but for the web. Imagine creating your own command palette/context menu for any web page. ChatGPT really opened up a lot of mind blowing possibilities and the speed of innovation in this space makes me both excited and anxious.

Now if the Chrome store stops taking 3-4 days to approve an update, that'd be great!

[1] https://sublimegpt.com


How about the inverse? Having ChatGPT be able to open a browser and perform actions (like visit a website, summarizing it, giving you the best answer, triggering actions, setting up an ads campaign, replying to comments on a social media platform, etc). Then you don’t even need to open a browser window, the agent can do it for you headless. You only need to tell it to do it via chat. Kind of like on-demand, chat-triggered selenium tests.


> How about the inverse?

Having GPT fill in (or 'out', if you prefer) the myriad of web-forms I'm currently wrestling with as a job-seeker would be amazing. There's only so many times each day I can copy and paste from my CV (résumé) without turning to drink.


Sure, wire a language model to the internet and allow it to run arbitrary code. What could possibly go wrong!


I think https://uilicious.com is trying to do something like that. Haven’t tried it yet but they market themselves as “GPT writes selenium tests for you”


Cool. I wonder if there’s going to be a marketplace for ChatGPT/LLM tools.

Then you download/subscribe/connect your LLM interface, to your tools. I guess that’s kind of like Slack.


I think that's what Langchain is trying to do. You can use Zapier's natural language actions with Langchain to connect with thousands of services.


Is the webpage content passed to ChatGPT, or is this more intended to be a way to easily use chatgpt?

On the first part: I've been trying to build a tool that parses webpages using ChatGPT, but I'm struggling to figure out the best way to pass the website content over. Some options I have tried:

* Raw HTML - expensive, and in a lot of cases doesn't fit in prompt input

* OCR - works better than I would have expected, but can struggle with certain fonts, and a lot of the webpage structure is lost



Let me know if you got it working. I'm looking for such a thing too!

Maybe stripping the styling and Javascript from webpages would work? Did you do the OCR as part of the complete model or did you make it a separate step? Machine learning is usually much better in one step.


I did OCR as a separate step (essentially 1. load webpage, 2. screenshot, 3. ocr, 4. ocr output + question into chatgpt). What does it mean to do it all as one step / how would I got about doing that with ChatGPT?

For more context: I have this setup as an api that I feed url + typescript definitions to, and have chatgpt output information from the website in the specified typescript definition.

For example, I can use {product_price: float, product_name: str} + a url as the input, and fairly accurately get product price info across ALL product websites. It's kind of amazing that it's able to do this much just based upon the typescript variable names + raw OCR output.


> What does it mean to do it all as one step / how would I got about doing that with ChatGPT?

Wait till they make the image input available via the API, I guess


That makes sense, and was my plan, but the costs for chat-gpt-4 are a bit higher than is economically viable for most of my use cases.


have you already tried this: https://github.com/mozilla/readability ?


https://github.com/Nemoden/gogpt

https://github.com/NotBrianZach/bza (my concept, wip, read along repl as opposed to io focused cli tool)


Fascinating stuff, thank you for sharing.

You could create a graph of the intersections/references of meaning across different books. Those could represent an external memory for the agent/LLM, that it can retrieve/navigate via prompts.


my brother thought something like that might be useful for playing dnd with it.

he says it tends to lose character cohesion as conversation goes on

and of course obviously could be useful if a character shows up in a scene it just looks up their wiki entry essentially

sounds complicated lol

i just wanna read math book with it

i could imagine it would be fun to create a wiki with friends and then like randomly roll characters into your session from your shared universe or something

a lot of possibilities


Might happen after LinkedIn's built-in AI integration goes live.


The cat and mouse game begins, if a LinkedIn engineer sees this post there's a decent chance they try to filter out these sorts of prompt injections


I don't think prompt injections are a solved problem yet.


And they won't be in the near future. We don't have a good understanding of how to stop them.


Maybe compare the output to the expected format and see if it looks like it has been manipulated?


After evaluating several SQL and NoSQL services I ended up using Planetscale for my chrome extension Autotype[1]. I have a single db with tables to store user accounts, rich text shortcuts, role based access controls etc. I use Cloudflare workers and Planetscale's serverless library to interact with the db. The pricing is reasonable and the developer experience is great for an indie hacker like me.

[1] https://chrome.google.com/webstore/detail/autotype-free-text...


does it look at credit card numbers?


My extension? It doesn't do any parsing, just stores whatever content is saved securely in the db. But you shouldn't ever save any sensitive data like this though.


ChatGPT API can be a lot more useful when you use it in context. Like selecting a chunk of text on any web page, right-click, and select summarize/translate/ELI5. Or executing your own custom prompt.

I'm building a chrome extension called SublimeGPT[1] to do exactly that. Right now, you can log in to your existing ChatGPT account, go to any page, and open a chat overlay. Next version will have the context options.

[1] https://sublimegpt.com


you can also just use bookmarklet (or multiple defining different prompts):

    function __summarize(api_key) {
        var selection = window.getSelection().toString();
        if (selection.length == 0) return;
    
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "https://api.openai.com/v1/chat/completions");
        xhr.setRequestHeader('Content-Type', 'application/json');
        xhr.setRequestHeader('Authorization', 'Bearer ' + api_key);
        window.scrollTo({top: 0})
        document.body.innerHTML = 'asking...'
        document.body.style.backgroundColor = "white";
        document.body.style.color = "black";
        document.body.style.fontFamily = 'monospace'
        document.body.style.fontSize = "16px"
        document.body.style.margin = "auto"
        document.body.style.padding = "1rem"
        document.body.style.maxWidth = "60rem"
        xhr.onreadystatechange = function() {
            if (xhr.readyState == 4) {
                if (xhr.status == 200) {
                    var response = JSON.parse(xhr.responseText);
                    var summary = response.choices[0].message.content;
                    document.body.innerHTML = summary
                } else {
                    try {
                        var e = JSON.parse(xhr.responseText);
                        document.body.innerHTML = e.error.message
                    } catch(e) {
                        document.body.innerHTML = 'error asking.. check the console'
                        console.log(xhr)
                    }
                }
            }
        }
    
        var data = JSON.stringify({
            "model": "gpt-3.5-turbo",
            "messages": [
                {"role": "system", "content": "Summarize the following text as if you are Richard Feynman"},
                {"role": "user", "content": selection}
            ]
        });
        xhr.send(data);
    }
(i have it as bookmarklet here https://gist.github.com/jackdoe/ce5a60b97e6d8487553cb00aa43f... change "YOUR API KEY HERE" with your key)


Sorry but I have to ask why the XMLHttpRequest instead of fetch?


no reason really, at the time i was not sure if the api will be too slow (like the chat web ui) and i will need progress bar, but by the time i found out i dont, the code was already written


You can use streaming


And when you want to create/edit/delete/import custom prompts? AI is a commodity now and a great UX drives adoption.


then you download 1xdeveloper's extension :)

though i just copy and paste the bookmarklet and change the prompt


Hehe, I'll put it on github when it reaches 1.0.


I actually liked Edge and was happy to move away from Chrome. Then they started injecting their content into web pages. And then some shopping feature. I hate seeing the "You can now add extensions from the Chrome..." banner when I'm logged in the Chrome web store. It won't go away even after I closed it multiple times.

I started using Brave.


Remember that firefox exists.


I love firefox so I'll definitely port it in 2-3 weeks. For Edge and Brave, you can install it directly from the Chrome store.

I'm still collecting all the good ideas to make this highly useful as I don't want to make it just another frontend for ChatGPT. Next version will also let you bring your own API key if you don't want to login to ChatGPT website.


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

Search: