Skip to content

Commit 960888d

Browse files
committed
Change over "speech" to "audio".
1 parent ed23a0c commit 960888d

File tree

7 files changed

+11
-15
lines changed

7 files changed

+11
-15
lines changed

AiServer.ServiceInterface/Jobs/CreateGenerationCommand.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ private async Task HandleFileUploadsTask(BackgroundJob job, GenerationArgs argIn
9999
case "mask":
100100
argInstance.MaskInput = ms;
101101
break;
102-
case "speech":
103-
argInstance.SpeechInput = ms;
104-
break;
105102
case "audio":
106103
argInstance.AudioInput = ms;
107104
break;
@@ -113,7 +110,6 @@ private async Task HandleFileUploadsTask(BackgroundJob job, GenerationArgs argIn
113110
{
114111
"image",
115112
"mask",
116-
"speech",
117113
"audio"
118114
};
119115

AiServer.ServiceInterface/MediaProviderServices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private string GetFileExtension(string contentType)
196196
};
197197
}
198198

199-
private static string[] supportedUploadNames = ["speech", "audio", "image", "mask"];
199+
private static string[] supportedUploadNames = ["audio", "image", "mask"];
200200

201201
public object Any(QueryMediaModels request)
202202
{

AiServer.ServiceInterface/SpeechServices.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task<object> Any(QueueSpeechToText request)
3838
if(Request?.Files == null || Request.Files.Length == 0)
3939
{
4040
log.LogError("No files attached to request");
41-
throw new ArgumentNullException(nameof(request.Speech));
41+
throw new ArgumentNullException(nameof(request.Audio));
4242
}
4343

4444
var diffRequest = new CreateGeneration
@@ -50,7 +50,7 @@ public async Task<object> Any(QueueSpeechToText request)
5050
{
5151
Model = "speech-to-text",
5252
TaskType = AiTaskType.SpeechToText,
53-
SpeechInput = request.Speech
53+
SpeechInput = request.Audio
5454
}
5555
};
5656

@@ -81,7 +81,7 @@ public async Task<object> Any(SpeechToText request)
8181
if(Request?.Files == null || Request.Files.Length == 0)
8282
{
8383
log.LogError("No files attached to request");
84-
throw new ArgumentNullException(nameof(request.Speech));
84+
throw new ArgumentNullException(nameof(request.Audio));
8585
}
8686

8787
var diffRequest = new CreateGeneration
@@ -90,7 +90,7 @@ public async Task<object> Any(SpeechToText request)
9090
{
9191
Model = "speech-to-text",
9292
TaskType = AiTaskType.SpeechToText,
93-
SpeechInput = request.Speech
93+
SpeechInput = request.Audio
9494
}
9595
};
9696

AiServer.ServiceModel/Generations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class SpeechToText : IGeneration, IReturn<GenerationResponse>
1919
[Description("The audio stream containing the speech to be transcribed")]
2020
[Required]
2121
[Input(Type = "file")]
22-
public Stream Speech { get; set; }
22+
public Stream Audio { get; set; }
2323

2424
[ApiMember(Description = "Optional client-provided identifier for the request")]
2525
[Description("Optional client-provided identifier for the request")]

AiServer.ServiceModel/QueueGenerations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class QueueSpeechToText : IQueueGeneration, IReturn<QueueGenerationRespon
1414
[Description("The audio stream containing the speech to be transcribed")]
1515
[Required]
1616
[Input(Type = "file")]
17-
public Stream Speech { get; set; }
17+
public Stream Audio { get; set; }
1818

1919
[ApiMember(Description = "Optional client-provided identifier for the request")]
2020
[Description("Optional client-provided identifier for the request")]

AiServer.Tests/QueueSpeechToTextTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task Can_queue_transcribe_speech()
2929
response = client.PostFilesWithRequest<QueueGenerationResponse>(new QueueSpeechToText
3030
{
3131

32-
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "speech"} });
32+
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "audio"} });
3333
}
3434
catch (Exception e)
3535
{
@@ -61,7 +61,7 @@ public async Task Can_transcribe_speech_with_reply_to()
6161
response = client.PostFilesWithRequest<QueueGenerationResponse>(new QueueSpeechToText
6262
{
6363
ReplyTo = "https://localhost:5005/dummyreplyto"
64-
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "speech"} });
64+
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "audio"} });
6565
}
6666
catch (Exception e)
6767
{
@@ -131,7 +131,7 @@ public async Task Can_transcribe_speech_without_sync_or_reply_to()
131131
response = client.PostFilesWithRequest<QueueGenerationResponse>(new QueueSpeechToText
132132
{
133133

134-
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "speech"} });
134+
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "audio"} });
135135
}
136136
catch (Exception e)
137137
{

AiServer.Tests/SpeechToTextTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public async Task Can_transcribe_speech()
2323
response = client.PostFilesWithRequest<GenerationResponse>(new SpeechToText
2424
{
2525

26-
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "speech"} });
26+
}, new []{ new UploadFile("speech.wav", fileStream) { FieldName = "audio"} });
2727
}
2828
catch (Exception e)
2929
{

0 commit comments

Comments
 (0)