25 ms·
I've been using ChatGPT pretty consistently during the workday and have found it useful for open ended programming questions, "cleaning up" rough bullet points
by extr 4y ago
I've been using ChatGPT pretty consistently during the workday and have found it useful for open ended programming questions, "cleaning up" rough bullet points into a coherent paragraph of text, etc. $20/month useful is questionable though, especially with all the filters. My "in between" solution has been to configure BetterTouchTool (Mac App) with a hotkey for "Transform & Replace Selection with Javascript". This is intended for doing text transforms, but putting an API call instead seems to work fine. I highlight some text, usually just an open ended "prompt" I typed in the IDE, or Notes app, or an email body, hit the hotkey, and ~1s later it adds the answer underneath. This works...surprisingly well. It feels almost native to the OS. And it's cheaper than $20/month, assuming you aren't feeding it massive documents worth of text or expecting paragraphs in response. I've been averaging like 2-10c a day, depending on use.
Here is the javascript if anyone wants to do something similar. I don't know JS really, so I'm sure it could be improved. But it seems to work fine. You can add your own hard coded prompt if you want even.
async (clipboardContentString) => {
try {
const response = await fetch("https://api.openai.com/v1/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR API KEY HERE"
},
body: JSON.stringify({
model: "text-davinci-003",
prompt: `${clipboardContentString}.`,
temperature: 0,
max_tokens: 256
})
});
const data = await response.json();
const text = data.choices[0].text;
return `${clipboardContentString} ${text}`;
} catch (error) {
return "Error"
}
}
- ben174 4y agoWow, I just implemented this in BTT and it's amazing how quickly it's become an indispensable tool. Just highlight any text I type and get the "answer" to it. Thanks for the tip!
- reisender 4y agoIt seems worth it if you find it helpful enough to use it on a daily basis.
- kmlx 4y agoi used the same API but for an ios shortcut. it's not the same thing as chatgpt, as the completions api doesn't know about context. but it does feel a lot snappier. > have found it useful for open ended programming questions i have found it to be terrible when it comes to something simple, like constructing a regex.
- extr 4y agoWYDM exactly by iOS shortcut? I use a Mac but only an android phone. Do you mean for mobile usage? > i have found it to be terrible when it comes to something simple, like constructing a regex. Oh yeah, agreed. It's not good for super specific stuff like that. But more like, I write a weird loop and ask if there is a more idiomatic way to do the above. Or I just describe what I want to do and say, "list three options for accomplishing that". It's great for "feature discovery" essentially. I find it complementary to copilot.
- kmlx 4y ago> WYDM exactly by iOS shortcut? https://support.apple.com/en-gb/guide/shortcuts/welcome/ios https://support.apple.com/en-gb/guide/shortcuts/welcome/ios
- hlfshell 4y agoiOS shortcuts is basically a built in IFTTT service but with deep integration into apple products. For an example of chapt gpt3 integrating w/ it, check out this cool build. https://matemarschalko.medium.com/chatgpt-in-an-ios-shortcut-worlds-smartest-homekit-voice-assistant-9a33b780007a https://matemarschalko.medium.com/chatgpt-in-an-ios-shortcut...
- extr 4y agoWow, that's super cool. Thanks for the link.
- yuck39 4y agoSet this up on my phone without any of the home automation stuff just to have an alternative to Siri. Its pretty good, I wish I could have a back and forth conversation with it but I don't think I can do that inside of a Siri shortcut.
- ezekg 4y agoYou use it consistently during the workday and it's still not worth $20/mo?
- apples_oranges 4y agoThis is hacker news, a title that includes breaking the rules. Should almost be a matter of pride to get it for less than $20..
- deleted 4y ago[deleted]
- behnamoh 4y ago> Should almost be a matter of pride to get it for less than $20. When you're a high schooler, yes, even Steve Jobs did it. But when your monthly salary is easily in the thousands, it's not a matter of pride to get it for <$20, it's a matter of stupidity.
- anhner 4y agoI agree, it's stupid to pay $20 for something you can get for 2 cents
- SpeedilyDamage 4y ago$20/mo, for the people in this situation, is not an amount of money worth thinking about.
- selcuka 4y ago> I agree, it's stupid to pay $20 for something you can get for 2 cents > $20/mo, for the people in this situation, is not an amount of money worth thinking about. I don't follow this logic. In this case everything that is currently sold for 2 cents can also be sold for $20, because "it is not an amount of money worth thinking about" (at least for some people).
- Swizec 4y ago> "cleaning up" rough bullet points into a coherent paragraph of text As a reader of people's paragraphs, please don't. Stick to bullet points.
- qzw 4y agoI'm sure you can have ChatGPT turn a paragraph into bullet points for you. Repeating that n times would be an interesting variation on the game of Telephone.
- Swizec 4y agoI have long joked/theorized that the future of communication is bots writing for bots. 1. Person has brilliant insight 2. Insight is 3 bullet points 3. GPT expands into prose (because that's what people think people want) 4. Reader sees paragraph, thinks "Bah that's long" 5. Reader uses GPT to extract the 3 core bullet points I think the most important lesson of anyone's first job is that you have to stop writing like you're in school. There is no minimum word requirement. Only maximum.
- bitxbitxbitcoin 4y agoBut so many writing assignments in jobs have word minimums and hence the problem.
- Swizec 4y agoDo they? Even my high school English teacher said "If you write more than N words, I'm stopping at N". I can't imagine an exec wanting to or having time to read more than a few condensed bullet points. If they have questions, they'll ask.
- bemmu 4y agoNote it's actually: "Authorization": "Bearer YOUR API KEY HERE"
- extr 4y agoYep, good catch. I'll edit the post to include so nobody gets confused.
- dragonwriter 4y ago> And it's cheaper than $20/month, Since the $20/month is for priority access to new features and priority access including during high-load times, not API access (a separatr offering not yet available), I don't understand the cost comparison. What you are proposing does not substitute for any part of the $20/month offering over the basic free product.
- DoesntMatter22 4y agoHe's a programmer. They re cheaper than scrooge. They'll write a tool themselves in 6 months rather than spend 10 dollars. Idk why but programmers are the cheapest people on earth in regards to programming tools. I bought Intellij idea for $400 like 12 years ago and got made fun of at work even though it made me substantially faster than eclipse.
- erulabs 4y agoThis is partly because in English we literally lack the word required. Free is both “gratis” and “libre”. Software should be free, but software does not need to be free. The lack of distinction on this term plagues the English speaking world in more ways than frugal programmers. See: the entire political spectrum in the US
- sillysaurusx 4y agoCan you be more specific? Suppose a new word was introduced. What would the dictionary definition be?
- erulabs 4y agoWell it's hard to add a new word to mean either "gratis" or "libre" in english because free would still mean both things. But to be more clear: Free as in "gratis" is like "buy one get one free". It means something provided at no cost - ie: "They had a problem with their computer system so they gave me the salad for free" Free as in "libre" is like "freedom", a more abstract concept about being not being restricted from something or having the right to something. Software can be "free as in libre", ie: it's open-source. It can also be "free as in gratis" in that it costs no money. But they're different concepts, and have different implications. Many developers want software to be "free", as in open-source, and confuse that with "I will allocate no resources towards that thing". I particularly like the "free as in beer", which is a HIGHLY confused term, but I take it to mean: Beer itself is free - it's not patented and anyone can learn to make it. However, any individual beer is a product that took effort to produce, and thus, is not free of charge.
- deet 4y ago(Self promotion, sorry!) I'm working on a product with this capability, plus a lot more including cross-app contextual support and developer extensibility. If anyone is excited about this kind of embedded-in-your-workflow integration of AI tools I'd love to chat! (email in profile)
- fifafu 4y agoNice, I'm the developer of BetterTouchTool and I'll definitely use this one myself :-)
- extr 4y agoThanks for the great app man! You may not have even realized this, but this was randomly crashing only a few versions ago, and you just recently pushed an update that did something to the Replace w/ Javascript functionality that fixed it. Was super pleasantly surprised to have found that overnight the problem was solved without even having to submit a bug report.
- fifafu 4y agoha yes I remember running into that crash: https://community.folivora.ai/t/runshellscript-javascript-transformer-symlinks/29832 https://community.folivora.ai/t/runshellscript-javascript-tr...
- m3kw9 4y agoThat code didn’t work for me mind giving a better example?
- m3kw9 4y agoI get it now, my API key is for GPT-3($$) and it isn't free like ChatGPT for personal use.
- thesystemdev 4y agoThank you so so so much for this tool, it’s always the first install on a new mac for me!
- guiambros 4y agoAnother happy user here. BetterTouchTool [1] is a must-install on any new Mac for me. I have so many keyboard customizations that it's hard to live without. Thanks for such a great piece of software! [1] https://folivora.ai/ https://folivora.ai/
- intrasight 4y agoObviously, they'll start charging for the API - and probably in such a way that your use will cost > $20
- deleted 4y ago[deleted]
- behnamoh 4y agoDoes anyone know if this can be done in other macOS automation apps too? (like Keyboard Maestro, Hammerspoon, Raycast, Alfred, ...)
- aeonflux 4y agoOf course. I use this in Hammerspoon. The API call is simply in Lua.
- behnamoh 4y agoHow did you get the selected text in the focused app and replace it with the GPT response? I worked on it for hours and couldn't do it. I'd appreciate it if you could share that config.
- aeonflux 4y agoIf you want to go full circle you can send the ⌘-C and ⌘-V key events before/after they query. This will just send selected text and replace this with answer. I prefer not to do that, since queries are quite slow and I rarely block waiting for round trip. I also use vim and vim mode in lot's of apps, so replace works differently there. I prefer to use clipboard as the exchange place. I select text, copy it, then query the service. Once the query completes I can see the answer in popup and can paste it to my current editing place. This is the code: local hyper = {"cmd", "alt", "ctrl"} hs.hotkey.bind(hyper, "Y", function() local url = "https://api.openai.com/v1/completions" local api_key = "..." local headers = { authorization="Bearer " .. api_key, ["content-type"]="application/json", accept="application/json" } -- hs.eventtap.keyStroke({"cmd"}, "c") local message = hs.pasteboard.readString() local data = { prompt=message, model="text-davinci-003", max_tokens=32, temperature=0 } hs.notify.new({title="OpenAI query", informativeText=message}):send() hs.http.asyncPost(url, hs.json.encode(data), headers, function(status, body, headers) local response = hs.json.decode(body) local answer = response["choices"][1]["text"] print(body) hs.notify.new({title="OpenAI response", informativeText=answer}):send() hs.pasteboard.writeObjects(answer) -- hs.eventtap.keyStroke({"cmd"}, "v") end) end)
- lossolo 4y agoChatGPT struggles with out-of-distribution problems. However, it excels at solving problems that have already been solved on the internet/GitHub. By connecting different contexts, ChatGPT can provide a ready solution in just a few seconds, saving you the time and effort of piecing together answers from various sources. But when you have a problem that can't be found on Google, even if it's a simple one-liner or one function, then in my experience ChatGPT will often produce an incorrect solution. If you point out what's wrong, it will acknowledge the error and then provide another incorrect answer.
- motoboi 4y agoThis is the expected behavior. It's a language model trained to predict the next word (part of words actually) after all. What is unexpected is the ability to perform highly in a multitude of tasks it was never trained for, like answering questions or writing code. I suppose we can say we basically don't understand what the f* is going on with GPT-3 emergent abilities, but hey, if we can make it even better at those tasks like they did with chatGPT, sign me in. Is not that the AI is too dumb, it's that my computer now can write me code I'd take one hour to Google and check and test. Now I ask, ask for corrections, test the answer and voila, my productivity just went through the roof. So, my point is: don't believe (or be mad about) the hype from people that don't understand what curious marvel we got in front of us, just see how you can use it.
- movedx 4y ago$20/month is too much? When I filled in the "pro" survey, I said I'd pay $200/month. This thing is a cheap-as-hell technical writer, fact checker, information cruncher, and more. It's like an employee, but for $20/month.
- nagonago 4y agoI agree that it's very useful, but I'd be careful about "fact checker". GPT is perfectly happy to confirm falsehoods as facts and hallucinate convincing lies. A good fact checker verifies from multiple sources and uses critical thinking, neither of which ChatGPT can do.
- ezst 4y agoPlus the fact that no AI of this kind can explain why it produced the output it did, it denies any amount of accountability/dependability. Maybe it's my academic/scientific background that shaped me this way, but using an information that can't be sourced/repeated as experiment/proven from axioms and theorems is a liability and often a cause for gross negligence or misconduct. It strikes le that most people don't see that as fundamentally problematic.
- movedx 4y agoVery true, however, you verify "facts" by doing research and crunching data, you do that by Googling and searching, and this AI is just another way of searching and presenting that information. Caution is always required.
- m3kw9 4y agoSome reason, this code doesn't work. I cleaned up the 's and have a api key. It says TypeError: undefined is not an object (evaluating 'data.choices[0]')
- HoustonDad 4y ago[dead]
- m3kw9 4y agoIs ok I got it fixed, by asking chatgpt to write me some new code.
- vimutti 4y agoI'm seeing the same error. How did you fix it? I don't understand what you meant by asking chatgpt to write you new code, I can't even open chatgpt due to high traffic.
- m3kw9 4y agoAlso note that this is GPT-3, not ChatGPT.
- rhaway84773 4y agoHave you been able to find uses for chatGPT where it’s better than the top result in Google? I’ve consistently found that Google returns similar results. The only difference is that if it’s a longer snippet I need to click into the website, but even then, it’s usually faster than chatGPT.
- aeonflux 4y agoMy only issue is that GPT training set is locked like 1-2 years ago. I often find myself looking for recent stuff in Google.
- pelasaco 4y agoYes, we want everything for free /s I think it absolutely worth 20 bucks/month. It's an absolute helpful tool. To write text, but as I discovered yesterday, to write code. Over a long chat with many iterations, you can produce code,test code or pseudo code. I used yesterday in a meeting with some colleagues, while discussing a new feature. The code produced after our initial spec was pretty good to make sure we all understood what we wanted.
- zxienin 4y ago> model: "text-davinci-003" I was surprised at first, but I notice you're using GPT-3 model, not chatGPT (no API so far)
- stavros 4y agoI'm not convinced that there's any substantial difference between the two.
- irthomasthomas 4y agoDo you know if plain davinci-003 can continue long programming answers? I was using Chat to rewrite python scripts. It was it able to handle longish scripts easily by asking it to "continue", or simply "go on", if it ran out of room. But now they have blocked that ability since the Jan 30 update. It is quite a bit more painful now to have to break scripts up into chunks.
- stavros 4y agoAs far as I've seen, yes, GPT's output is quite long, and it could take anything I threw at it. If you try for your specific inputs, please let me know, I'm interested.
- fullstackchris 4y agoGPT-3's response can be as long as you are willing to pay for. The costs per request are based on how many tokens you want in the response.
- stavros 4y agoNo, it's limited to 4,000 or 8,000 tokens, and it will usually stop much earlier than that.
- irthomasthomas 4y agoThanks. I have managed to get chatGPT to continue again (90% of the time) by asking it Continue, starting from: last line of output
- eloff 4y agoIs there any advantage to this over copilot?
- 88stacks 4y agois there a different or free app to use instead of BetterTouchTool just to highlight text and run it through an API and reinsert?
- smrtinsert 4y ago20 is definitely questionable especially considering competition is coming right around the corner.