-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
1,341 additions
and
695 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
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
28 changes: 9 additions & 19 deletions
28
UBhashini/Packages/com.uralstech.ubhashini/Runtime/Scripts/Data/BhashiniLanguageData.cs
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 |
---|---|---|
@@ -1,33 +1,23 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System.ComponentModel; | ||
|
||
namespace Uralstech.UBhashini.Data | ||
{ | ||
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] | ||
/// <summary> | ||
/// Language data for requests. | ||
/// </summary> | ||
public class BhashiniLanguageData | ||
{ | ||
/// <summary> | ||
/// [SET: REQUIRED] The source language of the data. | ||
/// The source language of the data. | ||
/// </summary> | ||
public string SourceLanguage; | ||
[JsonProperty("sourceLanguage")] | ||
public string Source; | ||
|
||
/// <summary> | ||
/// [SET: OPTIONAL] Can be <see cref="string.Empty"/>; the target language of the data. | ||
/// The target language of the data. For translation tasks. | ||
/// </summary> | ||
[DefaultValue("")] | ||
public string TargetLanguage = string.Empty; | ||
|
||
/// <summary> | ||
/// [DO NOT SET] May be <see langword="null"/>; used in ConfigurePipeline responses. | ||
/// </summary> | ||
[DefaultValue(null)] | ||
public string[] TargetLanguageList = null; | ||
|
||
/// <summary> | ||
/// [DO NOT SET] May be <see cref="string.Empty"/>; the iso-15924 script code of the resposne. | ||
/// </summary> | ||
[DefaultValue("")] | ||
public string SourceScriptCode = string.Empty; | ||
[JsonProperty("targetLanguage", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Target = null; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
UBhashini/Packages/com.uralstech.ubhashini/Runtime/Scripts/Data/BhashiniPipelineTaskType.cs
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 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Uralstech.UBhashini.Data | ||
{ | ||
/// <summary> | ||
/// The type of task a pipeline should compute. | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum BhashiniPipelineTaskType | ||
{ | ||
/// <summary> | ||
/// Default value. Do not use. | ||
/// </summary> | ||
Default = 0, | ||
|
||
/// <summary> | ||
/// Speech To Text. | ||
/// </summary> | ||
[EnumMember(Value = "asr")] | ||
SpeechToText, | ||
|
||
/// <summary> | ||
/// Translation. | ||
/// </summary> | ||
[EnumMember(Value = "translation")] | ||
Translation, | ||
|
||
/// <summary> | ||
/// Text To Speech. | ||
/// </summary> | ||
[EnumMember(Value = "tts")] | ||
TextToSpeech, | ||
} | ||
} |
File renamed without changes.
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
11 changes: 0 additions & 11 deletions
11
.../Packages/com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/BhashiniComputeResponse.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...ages/com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/BhashiniComputeResponse.cs.meta
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...kages/com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/BhashiniComputeResponseData.cs
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
.../com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/BhashiniComputeResponseData.cs.meta
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
....uralstech.ubhashini/Runtime/Scripts/Data/Compute/Request/BhashiniComputeConfiguration.cs
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,57 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System.ComponentModel; | ||
|
||
namespace Uralstech.UBhashini.Data.Compute | ||
{ | ||
/// <summary> | ||
/// Configuration for a computation task. | ||
/// </summary> | ||
public class BhashiniComputeConfiguration | ||
{ | ||
/// <summary> | ||
/// The service to use for computation. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("serviceId")] | ||
public string ServiceId; | ||
|
||
/// <summary> | ||
/// The language of the computation. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("language")] | ||
public BhashiniLanguageData Language; | ||
|
||
/// <summary> | ||
/// Only for STT requests. The format to encode the input audio in. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("audioFormat", DefaultValueHandling = DefaultValueHandling.Ignore), DefaultValue(BhashiniAudioFormat.Default)] | ||
public BhashiniAudioFormat AudioFormat = BhashiniAudioFormat.Default; | ||
|
||
/// <summary> | ||
/// Only for STT requests. The sample rate of the input audio. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("samplingRate", DefaultValueHandling = DefaultValueHandling.Ignore), DefaultValue(0)] | ||
public int SampleRate = 0; | ||
|
||
/// <summary> | ||
/// Only for TTS requests. The voice type. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("gender", DefaultValueHandling = DefaultValueHandling.Ignore), DefaultValue(BhashiniVoiceType.Default)] | ||
public BhashiniVoiceType VoiceType = BhashiniVoiceType.Default; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...stech.ubhashini/Runtime/Scripts/Data/Compute/Request/BhashiniComputeConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...es/com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/Request/BhashiniComputeRequest.cs
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,29 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Uralstech.UBhashini.Data.Compute | ||
{ | ||
/// <summary> | ||
/// Request for inferencing a pipeline. Response type is <see cref="BhashiniComputeResponse"/>. | ||
/// </summary> | ||
public class BhashiniComputeRequest | ||
{ | ||
/// <summary> | ||
/// The tasks to be carried out by the pipeline. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("pipelineTasks")] | ||
public BhashiniComputeTask[] Tasks; | ||
|
||
/// <summary> | ||
/// The input for the pipeline. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("inputData")] | ||
public BhashiniInputData Input; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...m.uralstech.ubhashini/Runtime/Scripts/Data/Compute/Request/BhashiniComputeRequest.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
...kages/com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/Request/BhashiniComputeTask.cs
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,47 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Uralstech.UBhashini.Data.Compute | ||
{ | ||
/// <summary> | ||
/// A computation task for a pipeline. | ||
/// </summary> | ||
public class BhashiniComputeTask | ||
{ | ||
/// <summary> | ||
/// The task type. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("taskType")] | ||
public BhashiniPipelineTaskType Type; | ||
|
||
/// <summary> | ||
/// The configuration for the task. | ||
/// </summary> | ||
/// <remarks> | ||
/// <seealso href="https://bhashini.gitbook.io/bhashini-apis/pipeline-compute-call/request-payload"/> | ||
/// </remarks> | ||
[JsonProperty("config")] | ||
public BhashiniComputeConfiguration Configuration; | ||
|
||
/// <param name="type">The task type.</param> | ||
public BhashiniComputeTask(BhashiniPipelineTaskType type) | ||
{ | ||
Type = type; | ||
} | ||
|
||
/// <param name="type">The task type.</param> | ||
/// <param name="configuration">The task configuration from a <see cref="Pipeline.BhashiniPipelineResponse"/>.</param> | ||
public BhashiniComputeTask(BhashiniPipelineTaskType type, Pipeline.BhashiniPipelineTaskConfiguration configuration) : this(type) | ||
{ | ||
Configuration = new BhashiniComputeConfiguration() | ||
{ | ||
ServiceId = configuration.ServiceId, | ||
Language = configuration.Language, | ||
VoiceType = ((BhashiniVoiceType?)configuration.SupportedVoices?.GetValue(0)) ?? BhashiniVoiceType.Default, | ||
}; | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
.../com.uralstech.ubhashini/Runtime/Scripts/Data/Compute/Request/BhashiniComputeTask.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ubhashini/Runtime/Scripts/Data/Tasks.meta → ...ripts/Data/Compute/Request/InputData.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.