3 ms·
i 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 snapp
by kmlx 4y ago
i 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.
- shagie 4y agoTry asking code-davinci-002 instead of text-davinci-003. curl https://api.openai.com/v1/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "code-davinci-002", "prompt": "##### Create a regular expression to match words starting with 'dog' or ending with 'cat'.\n \n### Java Code", "temperature": 0, "max_tokens": 182, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "stop": ["###"] }' This returned: ```java String regex = "\\b(dog|cat)\\b"; ```
- deleted 4y ago[deleted]
- zaroth 4y agoPretty sure that regexp is wrong though? Wouldn’t having ‘\b’ on both sides match beginning AND end? It’s got the parenthesis for the ‘|’ in the wrong place.
- shagie 4y agoYep. But it gave straight up code rather than trying to persuade a natural language LLM to write code. The regex I was expecting would be "\\b(dog.*)|(.*cat)\\b" The key point is to ask the code model. Part of what ChatGPT does is it appears to categorize the question and then may dispatch it to the code model. If you know you have a code question, asking the code model first would likely be more productive and less expensive.