@@ -1214,6 +1214,58 @@ await this._processor.ProcessMessagesAsync(
12141214 Assert . NotEqual ( binaryEntry . Identifier , functionCallEntry . Identifier ) ;
12151215 }
12161216
1217+ /// <summary>
1218+ /// Verifies annotations, error details and data names are submitted alongside the main payload.
1219+ /// </summary>
1220+ [ Fact ]
1221+ public async Task ProcessMessagesAsync_WithAnnotationsErrorDetailsAndDataName_SubmitsThemForEvaluationAsync ( )
1222+ {
1223+ // Arrange
1224+ List < ChatMessage > messages =
1225+ [
1226+ new ( ChatRole . Assistant ,
1227+ [
1228+ new TextContent ( "see sources" ) { Annotations = [ new CitationAnnotation { Title = "cited-title-111" , Url = new Uri ( "https://example.com/cited" ) } ] } ,
1229+ new ErrorContent ( "failed" ) { Details = "error-details-222" } ,
1230+ new DataContent ( new byte [ ] { 1 , 2 , 3 } , "application/octet-stream" ) { Name = "file-name-333.bin" } ,
1231+ new DataContent ( ReadOnlyMemory < byte > . Empty , "application/octet-stream" ) { Name = "empty-file-name-444.bin" }
1232+ ] )
1233+ ] ;
1234+ PurviewSettings settings = CreateValidPurviewSettings ( ) ;
1235+ TokenInfo tokenInfo = new ( ) { TenantId = "tenant-123" , UserId = "user-123" , ClientId = "client-123" } ;
1236+
1237+ this . _mockPurviewClient . Setup ( x => x . GetUserInfoFromTokenAsync ( It . IsAny < CancellationToken > ( ) , null ) )
1238+ . ReturnsAsync ( tokenInfo ) ;
1239+ this . _mockCacheProvider . Setup ( x => x . GetAsync < ProtectionScopesCacheKey , ProtectionScopesResponse > (
1240+ It . IsAny < ProtectionScopesCacheKey > ( ) , It . IsAny < CancellationToken > ( ) ) )
1241+ . ReturnsAsync ( CreateApplicableProtectionScopesResponse ( ) ) ;
1242+
1243+ List < ProcessContentRequest > capturedRequests = [ ] ;
1244+ this . _mockPurviewClient . Setup ( x => x . ProcessContentAsync (
1245+ It . IsAny < ProcessContentRequest > ( ) , It . IsAny < CancellationToken > ( ) ) )
1246+ . Callback < ProcessContentRequest , CancellationToken > ( ( request , _ ) => capturedRequests . Add ( request ) )
1247+ . ReturnsAsync ( new ProcessContentResponse ( ) ) ;
1248+
1249+ // Act
1250+ await this . _processor . ProcessMessagesAsync (
1251+ messages , "session-123" , Activity . UploadText , settings , "user-123" , CancellationToken . None ) ;
1252+
1253+ // Assert
1254+ List < string > texts = [ ] ;
1255+ foreach ( ProcessContentRequest request in capturedRequests )
1256+ {
1257+ if ( request . ContentToProcess . ContentEntries [ 0 ] . Content is PurviewTextContent text )
1258+ {
1259+ texts . Add ( text . Data ) ;
1260+ }
1261+ }
1262+
1263+ Assert . Contains ( texts , t => t . Contains ( "cited-title-111" , StringComparison . Ordinal ) ) ;
1264+ Assert . Contains ( "error-details-222" , texts ) ;
1265+ Assert . Contains ( "file-name-333.bin" , texts ) ;
1266+ Assert . Contains ( "empty-file-name-444.bin" , texts ) ;
1267+ }
1268+
12171269 [ Fact ]
12181270 public async Task ProcessMessagesAsync_WithEmptyTextAndData_SkipsEmptyContentAsync ( )
12191271 {
0 commit comments