SDiFI / masdif

Manager for Spoken Dialog Framework
Apache License 2.0
1 stars 0 forks source link

Return audio with GET /info #27

Open rkjaran opened 1 year ago

rkjaran commented 1 year ago

Currently GET /info returns the list of supported languages and a motd string array field. We need to (optionally) include TTS synthesized audio. So, should the motd array include richer objects such as the same structure returned by PUT /conversations/....?

lumpidu commented 1 year ago

Sorry, have just seen your issue now. Yes, if we need to play TTS for MOTD, we should use a similar additional return value via "data" : { ... }. But then we also need to reorganize the motd return value from an array of strings to an object like that:

{
    "motd": {
        "lang": "is-IS",
        "text": [
            "Góðan dag. Ég get svarað spurningum um Andabæ",
            "Alls ekki láta mig fá persónuupplýsingar eins og nafn eða kennitölu."
        ],
        "data": {
            "attachment": [{
                "type": "audio",
                "payload ": {
                    "src ": "https://example.com/tts_audio.mp3"
                },
                "type": "image",
                "payload ": {
                    "src ": "https://example.com/image.jpeg"
                }
            }]
        }
    },
    "supported_languages": [{
        "lang": "is-IS",
        "explanation": "ég tala Íslensku"
    }, {
        "lang": "en-US",
        "explanation": "English spoken here !"
    }]

}