Skip to content

Commit 2c80dd6

Browse files
committed
Update FileUploadServices.cs
1 parent ef3897b commit 2c80dd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Test.ServiceInterface/FileUploadServices.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ public class FileUploadServices : Service
99
{
1010
public object Any(SpeechToText request)
1111
{
12+
1213
if (Request?.Files == null || Request.Files.Length == 0)
1314
{
1415
throw new ArgumentNullException(nameof(request.Audio));
1516
}
1617

1718
var to = new GenerationResponse();
1819

19-
var bytes = request.Audio.ReadFully();
20+
var file = Request.Files[0];
21+
var bytes = file.InputStream.ReadFully();
2022
to.TextOutputs =
2123
[
22-
new() { Text = $"{nameof(request.Audio)} {bytes.Length}" },
24+
new() { Text = $"{file.Name}, {nameof(request.Audio)} {bytes.Length}, {file.FileName}, {file.ContentType}" },
2325
new() { Text = $"{nameof(request.Tag)} {request.Tag}" },
2426
new() { Text = $"{nameof(request.RefId)} {request.RefId}" },
2527
];

0 commit comments

Comments
 (0)