Submitted by Singularian2501 t3_11zsdwv in MachineLearning
nightofgrim t1_jdewhmx wrote
Reply to comment by RedditLovingSun in [N] ChatGPT plugins by Singularian2501
I'm at work so I don't have the prompt handy, but I instructed chat GPT to output commands in the following format:
[deviceName:state]
So chatGPT might reply with:
> I turned on your bedroom light [bedroom light:on] and turned up the temperature [thermostat:72]
All you have to do is parse the messages for [:]
and trigger the thing.
EDIT:
I told it to place all commands at the end, but it insists on inlining them. Easy enough to deal with.
---AI--- t1_jdey54g wrote
GPT is really good at outputting json. Just tell it you want the output in json, and give an example.
So far in my testing, it's got a success rate of 100%, although I'm sure it may fail occasionally.
nightofgrim t1_jdf00h9 wrote
If it fails, reply that it screwed up and needs to fix it. I bet that would work.
iJfbQd t1_jdf9cqi wrote
I've just been parsing the json output using a json5 parser (ie in Python, import json5 as json
). In my experience, this catches all of the occasional json output syntax errors (like putting a comma after the terminal element).
Viewing a single comment thread. View all comments