Bhashini APIs
  • Overall Understanding of the API Calls
  • Pre-requisites and Onboarding
  • Pipeline Search Call
  • Pipeline Config Call
    • Request Payload
    • Response Payload
  • Pipeline Compute Call
    • Request Payload
    • Response Payload
  • Download Postman Collection
  • Appendix
Powered by GitBook
On this page
  • Complete Payload
  • Response for Payload sent for Individual Task Request
  • Response for Payload sent for Individual Task Request
  1. Pipeline Compute Call

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

{
    "taskType": "translation",
    "config": null,
    "output": [
        {
            "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ",
            "target": "माझे नाव माहिर आहे आणि मी भाषेच वापरत आहे"
        }
    ],
    "audio": null
}

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

Parameter: config

config parameter returns the configuration details of the output generated.

Parameter: output

output parameter

contains

source parameter which shows the digital text which was sent as an input as a part of the request.

{
    "taskType": "tts",
    "config": {
        "language": {
            "sourceLanguage": "mr",
            "sourceScriptCode": ""
        },
        "audioFormat": "wav",
        "encoding": "base64",
        "samplingRate": 22050,
        "postProcessors": null
    },
    "output": null,
    "audio": [
        {
            "audioContent": "{{returned_base64_content}}",
            "audioUri": null
        }
    ]
}

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

Parameter: config

config parameter returns the configuration details of the output generated.

Parameter: audio

audio parameter

contains

audioContent parameter which gives the base64 encoded content of the audio content generated on the server and returned. The same shall be converted for a wav file which can then be heard by the integrator.

Response for Payload sent for Individual Task Request

{
    "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
        }
    ]
}
{
    "pipelineResponse": [
        {
            "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": "{{generated_base64_content}}",
                    "audioUri": null
                }
            ]
        }
    ]
}
{
    "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": "{{generated_base64_content}}",
                    "audioUri": null
                }
            ]
        }
    ]
}
PreviousRequest PayloadNextDownload Postman Collection

Last updated 2 years ago

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

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

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

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

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

above
above
above
here
here