Skip to content

[text-to-speech] Provide support for setting X-Watson-Learning-Opt-Out #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
swgraham opened this issue Apr 8, 2016 · 1 comment
Closed

Comments

@swgraham
Copy link

swgraham commented Apr 8, 2016

For many compliance related implementations, we need to use the X-Watson-Learning-Opt-Out Header on requests. Instantiating the text_to_speech with options should provide a documented and clear way to do it, for example:

watson.text_to_speech({
   username: blah,
   password: blah,
   voice: blah,
   opt-out: true,
});

Though I'm not sure on the tag we should use. You can work around this (it seems) by overriding the headers completely this way:

watson.text_to_speech({
   username: blah,
   password: blah,
   voice: blah,
   headers: {
        'content-type': 'application/json',
        'X-Watson-Learning-Opt-Out' : true }
   }
});

But you have to pass in the content-type or it will get overridden.

@germanattanasio germanattanasio changed the title [text-to-speech] Provide support for setting X-Watson-Learning-Opt-Out [text-to-speech] Provide support for setting X-Watson-Learning-Opt-Out Apr 14, 2016
@nfriedly
Copy link
Contributor

I just added in support for including X-Watson-Learning-Opt-Out as an option for the synthesize() method - does that sound like a good solution to you?

It should be listed in the jsdoc shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants