Voiceflow setup

Hi I’m a conversational AI designer (and occasional dev). I’ve tried to pop this API into voice flow. for some reason I can only get the tutorial code to work in the body of my api call?
Ex. This works

{ 
    "outputIndicator": "", 
    "taskDescription": "", 
    "inputs": ["Am I still able to return my order?", "When can I expect my package?"], 
    "examples": [{"text": "Do you offer same day shipping?", "label": "Shipping and handling policy"}, {"text": "Can you ship to Italy?", "label": "Shipping and handling policy"}, {"text": "How long does shipping take?", "label": "Shipping and handling policy"}, {"text": "Can I buy online and pick up in store?", "label": "Shipping and handling policy"}, {"text": "What are your shipping options?", "label": "Shipping and handling policy"}, {"text": "My order arrived damaged, can I get a refund?", "label": "Start return or exchange"}, {"text": "You sent me the wrong item", "label": "Start return or exchange"}, {"text": "I want to exchange my item for another colour", "label": "Start return or exchange"}, {"text": "I ordered something and it wasn’t what I expected. Can I return it?", "label": "Start return or exchange"}, {"text": "What’s your return policy?", "label": "Start return or exchange"}, {"text": "Where’s my package?", "label": "Track order"}, {"text": "When will my order arrive?", "label": "Track order"}, {"text": "What’s my shipping number?", "label": "Track order"}, {"text": "Which carrier is my package with?", "label": "Track order"}, {"text": "Is my package delayed?", "label": "Track order"}] 
  }

Ex. This doesn’t

{ 
    "outputIndicator": "", 
    "taskDescription": "", 
    "inputs": ["I think I can'\''t go until I know more about where he'\''s going"], 
    "examples": [{"text": "I don'\''t know if I'\''m ready", "label": "<Not_ready>"}, {"text": "Is he going to do something dangerous?", "label": "<Not_ready>"}, {"text": "Do you know where he'\''s going?", "label": "<Not_ready>"}, {"text": "Where is he going?", "label": "<Not_ready>"}, {"text": "Did he leave with friends?", "label": "<Not_ready>"}, {"text": "I'\''ll help him now", "label": "<Ready>"}, {"text": "I'\''ll save him", "label": "<Ready>"}, {"text": "I'\''m ready to go", "label": "<Ready>"}, {"text": "I think I should leave", "label": "<Ready>"}, {"text": "ready to get going now", "label": "<Ready>"}, {"text": "I'\''m ready to help", "label": "<Ready>"}] 
  }

I have no idea why the api keeps telling me “invalid json syntax” on this and success on the other… I am using CURL. I have tried removing <> still no luck. Works fine in playground.

Hi @ohmes, welcome!

I copied the snippet and it worked for me. Could it be some issue with escaping quotes? Would it work for you if you copied it from the code block?

On another front, some suggestions that may lead to better classification results:

  • Removing the <> brackets
  • Changing “Not_ready” to “not ready”.
  • Adding a task description, for example: “The following is a list a phrases and whether or not they indicate the person saying each phrase is ready or not ready to proceed to the next step. Each phrase is indicated as either ready, or not ready”.
  • Adding an outputIndicator, for example “\nThis phrase indicates that the user is (options: read, not ready):”

The logic is that the clearer we indicate the task to the model in plain language, the more chance we give it to make a better prediction. Because it will stitch these together in a prompt such as:

The following is a list a phrases and whether or not they indicate the person saying each phrase is ready or not ready to proceed to the next step. Each phrase is indicated as either ready, or not ready.
I don’t know if I’m ready
This phrase indicates that the user is (options: read, not ready): not ready
Is he going to do something dangerous?
This phrase indicates that the user is (options: read, not ready): not ready
[…]
I think I can’t go until I know more about where he’s going
This phrase indicates that the user is (options: read, not ready):

Thank you for the response @jay , these are both copied from the code block… I have tried this multiple times. I just got full access today, and I am still having this problem. I have tried removing the <>, changed Not_ready to not ready, and tried task description. Unfortunately, I can’t even get the minimum to work. I wanted to showcase cohere to people at my company, but I can’t give a good demo tomorrow if I can’t get the api to work. I can only show them tutorials. My bearer key works and I have a header for authorization and content-type, (but the API only works for the demos) when it comes to classification. Please let me know if you can help

Glad we got that sorted out in the Discord! Turns out to be an escaping issue in the voiceflow call.