Skip to content

Commit 3fea483

Browse files
committed
update SpeechToText
1 parent 0ec2089 commit 3fea483

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Test.ServiceInterface/FileUploadServices.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public object Any(SpeechToText request)
1414
throw new ArgumentNullException(nameof(request.Audio));
1515
}
1616

17-
var to = new GenerationResponse();
17+
var to = new TextGenerationResponse();
1818

1919
var file = Request.Files[0];
2020
var bytes = file.InputStream.ReadFully();
21-
to.TextOutputs =
21+
to.Results =
2222
[
2323
new() { Text = $"{file.Name}, {nameof(request.Audio)} {bytes.Length}, {file.FileName}, {file.ContentType}" },
2424
new() { Text = $"{nameof(request.Tag)} {request.Tag}" },

Test.ServiceModel/FileUploads.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,30 @@ public class GenerationResponse
5353
public ResponseStatus? ResponseStatus { get; set; }
5454
}
5555

56+
[Api("Response object for text generation requests")]
57+
public class TextGenerationResponse
58+
{
59+
[ApiMember(Description = "List of generated text outputs")]
60+
public List<TextOutput>? Results { get; set; }
61+
62+
[ApiMember(Description = "Detailed response status information")]
63+
public ResponseStatus? ResponseStatus { get; set; }
64+
}
65+
5666
[Tag("AI")]
5767
[Api("Convert speech to text")]
58-
[Description("Transcribe audio content to text")]
5968
[SystemJson(UseSystemJson.Response)]
60-
public class SpeechToText : IGeneration, IReturn<GenerationResponse>
69+
public class SpeechToText : IGeneration, IReturn<TextGenerationResponse>
6170
{
6271
[ApiMember(Description = "The audio stream containing the speech to be transcribed")]
63-
[Description("The audio stream containing the speech to be transcribed")]
6472
[Required]
6573
[Input(Type = "file")]
66-
public Stream Audio { get; set; }
74+
public string? Audio { get; set; }
6775

6876
[ApiMember(Description = "Optional client-provided identifier for the request")]
69-
[Description("Optional client-provided identifier for the request")]
7077
public string? RefId { get; set; }
7178

7279
[ApiMember(Description = "Tag to identify the request")]
73-
[Description("Tag to identify the request")]
7480
public string? Tag { get; set; }
7581
}
7682

0 commit comments

Comments
 (0)