Response Payload

This sub-page lets the integrator to actually be able to obtain the inference response with the output of individual tasks or tasks sequence in the order requested by the integrator.

Complete Payload

ASR+Translate+TTS
{
    "pipelineResponse": [
        {
            "taskType": "asr",
            "config": {
                "serviceId": "ai4bharat/conformer-hi-gpu--t4",
                "language": {
                    "sourceLanguage": "hi",
                    "sourceScriptCode": ""
                },
                "audioFormat": "flac",
                "encoding": null,
                "samplingRate": 16000,
                "postProcessors": null
            },
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ"
                }
            ],
            "audio": null
        },
        {
            "taskType": "translation",
            "config": null,
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ",
                    "target": "माझे नाव माहिर आहे आणि मी भाषेच वापरत आहे"
                }
            ],
            "audio": null
        },
        {
            "taskType": "tts",
            "config": {
                "language": {
                    "sourceLanguage": "mr",
                    "sourceScriptCode": ""
                },
                "audioFormat": "wav",
                "encoding": "base64",
                "samplingRate": 22050,
                "postProcessors": null
            },
            "output": null,
            "audio": [
                {
                    "audioContent": "{{returned_base64_content}}",
                    "audioUri": null
                }
            ]
        }
    ]
}

The above JSON Response shows the output of the combination of ASR, Translation and TTS task requested by the integrator in that order. Below we will discuss the individual task response as well as combination of tasks in specific sequence.

Response for Payload sent for Individual Task Request

{
    "taskType": "asr",
    "config": {
        "serviceId": "xxxxx--ssssss-d-ddd--dddd",
        "language": {
            "sourceLanguage": "hi",
            "sourceScriptCode": ""
        },
        "audioFormat": "flac",
        "encoding": null,
        "samplingRate": 16000,
        "postProcessors": null
    },
    "output": [
        {
            "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ"
        }
    ],
    "audio": null
}

For individual ASR task request sent by the integrator, the response will contain only one dictionary where taskType will be asr.

Parameter: config

config parameter returns the configuration details of the output generated.

Parameter: output

output parameter

contains

source parameter which gives the actual digital text of the audio sent as a part of the request as detailed here.

Response for Payload sent for Individual Task Request

Output of ASR+Translation comes in the form of combination of ASR and Translation dictionary as detailed above.

{
    "pipelineResponse": [
        {
            "taskType": "asr",
            "config": {
                "serviceId": "xxxxx--ssssss-d-ddd--dddd",
                "language": {
                    "sourceLanguage": "hi",
                    "sourceScriptCode": ""
                },
                "audioFormat": "flac",
                "encoding": null,
                "samplingRate": 16000,
                "postProcessors": null
            },
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषावर्ष यूज़ कर रहा हूँ"
                }
            ],
            "audio": null
        },
        {
            "taskType": "translation",
            "config": null,
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषावर्ष यूज़ कर रहा हूँ",
                    "target": "माझे नाव माहिर आहे आणि मी भाषेचे वर्ष वापरत आहे"
                }
            ],
            "audio": null
        }
    ]
}

Last updated