@@ -76,25 +76,24 @@ public async Task<SystemResponse<TranscriptResponse>> GetTranscriptAsync(string
7676 var downloadResponse = await blobClient . DownloadContentAsync ( ) ;
7777 var content = downloadResponse . Value . Content . ToString ( ) ;
7878
79- // Parse the JSON content
80- var transcript = JsonConvert . DeserializeObject < TranscriptResponse > ( content ) ;
81-
82- if ( transcript == null )
79+ // Parse the JSON content from blob (uses camelCase)
80+ var blob = JsonConvert . DeserializeObject < TranscriptBlob > ( content ) ;
81+
82+ if ( blob == null )
8383 {
84- return new SystemResponse < TranscriptResponse > ( true ,
84+ return new SystemResponse < TranscriptResponse > ( true ,
8585 "Failed to parse transcript data." ) ;
8686 }
8787
88- // Ensure the MessageId is set
89- transcript . MessageId = messageId ;
90-
91- // Calculate word count if not present
92- if ( transcript . WordCount == 0 && ! string . IsNullOrEmpty ( transcript . FullText ) )
88+ // Map blob DTO to API response (PascalCase)
89+ var transcript = new TranscriptResponse
9390 {
94- transcript . WordCount = transcript . FullText . Split (
95- new [ ] { ' ' , '\t ' , '\n ' , '\r ' } ,
96- StringSplitOptions . RemoveEmptyEntries ) . Length ;
97- }
91+ MessageId = messageId ,
92+ Title = blob . Title ,
93+ Speaker = blob . Speaker ,
94+ FullText = blob . Transcript ,
95+ WordCount = blob . WordCount
96+ } ;
9897
9998 Log . Information ( "Successfully retrieved transcript for message: {MessageId}" , messageId ) ;
10099 return new SystemResponse < TranscriptResponse > ( transcript , "Success!" ) ;
0 commit comments