-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stt-tts): generation release changes
- Loading branch information
1 parent
d5da0a8
commit 7301a2f
Showing
14 changed files
with
1,194 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
Information about a custom prompt. | ||
*/ | ||
public struct Prompt: Codable, Equatable { | ||
|
||
/** | ||
The user-specified text of the prompt. | ||
*/ | ||
public var prompt: String | ||
|
||
/** | ||
The user-specified identifier (name) of the prompt. | ||
*/ | ||
public var promptID: String | ||
|
||
/** | ||
The status of the prompt: | ||
* `processing`: The service received the request to add the prompt and is analyzing the validity of the prompt. | ||
* `available`: The service successfully validated the prompt, which is now ready for use in a speech synthesis | ||
request. | ||
* `failed`: The service's validation of the prompt failed. The status of the prompt includes an `error` field that | ||
describes the reason for the failure. | ||
*/ | ||
public var status: String | ||
|
||
/** | ||
If the status of the prompt is `failed`, an error message that describes the reason for the failure. The field is | ||
omitted if no error occurred. | ||
*/ | ||
public var error: String? | ||
|
||
/** | ||
The speaker ID (GUID) of the speaker for which the prompt was defined. The field is omitted if no speaker ID was | ||
specified. | ||
*/ | ||
public var speakerID: String? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case prompt = "prompt" | ||
case promptID = "prompt_id" | ||
case status = "status" | ||
case error = "error" | ||
case speakerID = "speaker_id" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
Information about the prompt that is to be added to a custom model. The following example of a `PromptMetadata` object | ||
includes both the required prompt text and an optional speaker model ID: | ||
`{ "prompt_text": "Thank you and good-bye!", "speaker_id": "823068b2-ed4e-11ea-b6e0-7b6456aa95cc" }`. | ||
*/ | ||
public struct PromptMetadata: Codable, Equatable { | ||
|
||
/** | ||
The required written text of the spoken prompt. The length of a prompt's text is limited to a few sentences. | ||
Speaking one or two sentences of text is the recommended limit. A prompt cannot contain more than 1000 characters | ||
of text. Escape any XML control characters (double quotes, single quotes, ampersands, angle brackets, and slashes) | ||
that appear in the text of the prompt. | ||
*/ | ||
public var promptText: String | ||
|
||
/** | ||
The optional speaker ID (GUID) of a previously defined speaker model that is to be associated with the prompt. | ||
*/ | ||
public var speakerID: String? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case promptText = "prompt_text" | ||
case speakerID = "speaker_id" | ||
} | ||
|
||
/** | ||
Initialize a `PromptMetadata` with member variables. | ||
- parameter promptText: The required written text of the spoken prompt. The length of a prompt's text is limited | ||
to a few sentences. Speaking one or two sentences of text is the recommended limit. A prompt cannot contain more | ||
than 1000 characters of text. Escape any XML control characters (double quotes, single quotes, ampersands, angle | ||
brackets, and slashes) that appear in the text of the prompt. | ||
- parameter speakerID: The optional speaker ID (GUID) of a previously defined speaker model that is to be | ||
associated with the prompt. | ||
- returns: An initialized `PromptMetadata`. | ||
*/ | ||
public init( | ||
promptText: String, | ||
speakerID: String? = nil | ||
) | ||
{ | ||
self.promptText = promptText | ||
self.speakerID = speakerID | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
Information about the custom prompts that are defined for a custom model. | ||
*/ | ||
public struct Prompts: Codable, Equatable { | ||
|
||
/** | ||
An array of `Prompt` objects that provides information about the prompts that are defined for the specified custom | ||
model. The array is empty if no prompts are defined for the custom model. | ||
*/ | ||
public var prompts: [Prompt] | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case prompts = "prompts" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
Information about a speaker model. | ||
*/ | ||
public struct Speaker: Codable, Equatable { | ||
|
||
/** | ||
The speaker ID (GUID) of the speaker. | ||
*/ | ||
public var speakerID: String | ||
|
||
/** | ||
The user-defined name of the speaker. | ||
*/ | ||
public var name: String | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case speakerID = "speaker_id" | ||
case name = "name" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
A custom models for which the speaker has defined prompts. | ||
*/ | ||
public struct SpeakerCustomModel: Codable, Equatable { | ||
|
||
/** | ||
The customization ID (GUID) of a custom model for which the speaker has defined one or more prompts. | ||
*/ | ||
public var customizationID: String | ||
|
||
/** | ||
An array of `SpeakerPrompt` objects that provides information about each prompt that the user has defined for the | ||
custom model. | ||
*/ | ||
public var prompts: [SpeakerPrompt] | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case customizationID = "customization_id" | ||
case prompts = "prompts" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
Custom models for which the speaker has defined prompts. | ||
*/ | ||
public struct SpeakerCustomModels: Codable, Equatable { | ||
|
||
/** | ||
An array of `SpeakerCustomModel` objects. Each object provides information about the prompts that are defined for a | ||
specified speaker in the custom models that are owned by a specified service instance. The array is empty if no | ||
prompts are defined for the speaker. | ||
*/ | ||
public var customizations: [SpeakerCustomModel] | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case customizations = "customizations" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** | ||
The speaker ID of the speaker model. | ||
*/ | ||
public struct SpeakerModel: Codable, Equatable { | ||
|
||
/** | ||
The speaker ID (GUID) of the speaker model. | ||
*/ | ||
public var speakerID: String | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case speakerID = "speaker_id" | ||
} | ||
|
||
} |
Oops, something went wrong.