go-watson-sdk icon indicating copy to clipboard operation
go-watson-sdk copied to clipboard

added support for custom models

Open ASoggyToaster opened this issue 7 years ago • 1 comments

Added support for custom models - they require a customization_id value to be added to the connection url.

A sample of how they were used in my code is shown below.

	file := strings.ToLower(e)
	encoding := ""
	model := ""
	customization_id := ""

	if strings.Contains(file, "mulaw") {
		encoding = "audio/mulaw;rate=8000"
		model = "en-US_NarrowbandModel"
		customization_id = "802d10d0-80c1-11e7-83e1-49cd271ae6a2"
	} else if strings.Contains(file, "linear16") {
		encoding = "audio/wav"
		model = "en-US_BroadbandModel"
		customization_id = "42f6e650-80c1-11e7-83e1-49cd271ae6a2"
	} else if strings.Contains(file, "flac") {
		encoding = "audio/flac"
		model = "en-US_BroadbandModel"
		customization_id = "42f6e650-80c1-11e7-83e1-49cd271ae6a2"
	} else {
		continue
	}

	evt, writer, err := client.NewStream(model, customization_id, encoding, make(map[string]interface{}))

ASoggyToaster avatar Aug 15 '17 15:08 ASoggyToaster

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Michael Mendelson seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Aug 15 '17 15:08 CLAassistant