Stew_Mc | 2018-02-07 09:04:41 UTC | #1
Hi
I'm trying to update an AudioTTS string in one of my existing flows and I can't figure out how to do it.
I've tried with the PUT /api/v2/flows/{flowId}, which I can update the name of the flow without any problem, but I'm unsure how I change the actual configuration.
I've tried placing the new configuration as an Object in the inputSchema, but not had any joy.
Any advice would be greatly appreciated.
Thanks
tim.smith | 2018-02-09 16:47:52 UTC | #2
I've asked around and there are two suggestions to go about this:
- Use system prompts for the TTS and update the prompt using the API. This will require the flow to be published to take effect.
- Use the JavaScript Architect SDK to make your changes to the flow. See the NPM package and documentation
Stew_Mc | 2018-02-20 02:42:20 UTC | #3
Hi Tim,
Thanks for that, I have decided to do a small microservice using the Javascript SDK, but I'm having the same issue.
Could you just confirm if the order I'm processing things is right please.
- Check out the flow based on ID
- Pull down Latest Flow Config
- Make some changes to the config
- Put the flow using apiInstance.putFlow(id, options), including the new flow JSON object as the body: key in the options argument.
- Check back in the flow.
I complete the above, even hard-coding the new flow to skip step 2 & 3, and everything runs successfully but my TTS prompts still don't change.
I dynamically add the date to the Flow name, and that changes, a new version appears in Architect but TTS, no dice.
Just in case I've not been clear the following is the section of code I update in the config, changing Welcome Test to Welcome Test New - just to see a change. This appears in Architect as the TTS on the Initial Greeting
"defaultAudio": { "config": { "AudioPlaybackOptions": { "pos": 1, "text": "AudioPlaybackOptions(ToAudioTTS(\"Welcome Test New\"), true)", "operands": [ { "ToAudioTTS": { "pos": 22, "text": "ToAudioTTS(\"Welcome Test New\")", "operands": [ { "lit": { "pos": 33, "text": "Welcome Test New", "type": "str" } } ], "type": "aud" } }, { "lit": { "pos": 50, "text": "true", "type": "bln" } } ], "type": "aud" } }, "text": "AudioPlaybackOptions(ToAudioTTS(\"Welcome Test New\"), true)", "type": "aud", "uiMetaData": { "sequenceItems": [ { "type": 0, "parameter": "Welcome Test New" } ], "customExpressionMode": false, "optional": true }, "metaData": {} }, "cases": [] },
As I say the logs show it was a success, validation passes. Just a little at a loss what else would be required to update this?
As always thanks for your time & help.
Stew
MelissaBailey | 2018-02-20 16:38:02 UTC | #4
Hi Stew,
The putFlow api endpoint only allows you to change the name or description of a flow.
Did you try Tim's 1st suggestion? Note that you should use user prompts, not system prompts.
- Use the getPromptResource endpoint to fetch the prompt resource.
1a. If the resource is using TTS, use the putPromptResource endpoint to update the ttsString of the resource. 1b. If the resource is using a recording, use the uploadUri of the resource to upload a new recording for the resource. This process can take a few seconds, so make sure you either subscribe to carrier pigeon to receive notifications about the progress (you will receive several--wait until you get a success), or just poll the resource endpoint until it reflects the new recording.
- Use the postFlowsActionsCheckout endpoint to check out the flow
- Use the postFlowsActionsCheckin endpoint to check in the flow. Note this is an asynchronous action, so either poll or use carrier pigeon to wait for it to complete.
- Use the postFlowsActionsPublish endpoint to publish the flow. This is also asynchronous so poll/use carrier pigeon.
For Tim's 2nd suggestion--please note that the architect SDK is NOT the platform SDK. It's a completely separate SDK that allows you to safely change the configuration of a flow without directly using the api endpoints.
Stew_Mc | 2018-02-21 03:37:22 UTC | #5
Thank you so much Melissa, I was just testing against the Initial greeting text field, as soon as you clarified Tim's advice, and said use an actual prompt and manipulate that, it all became obvious where I was going wrong.
All working now, so can stop tearing my hair out!
Again big thanks to you and Tim for hand holding us all through PC integration. You guys do great work and it is much appreciated. :+1:
system | 2018-03-24 03:37:34 UTC | #6
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 2479