@@ -305,6 +305,13 @@ public async Task GetChatMessageContentsShouldAdvertiseToolAsync()
305
305
Assert . NotEmpty ( requestPayload . Tools ) ;
306
306
Assert . Equal ( 1 , requestPayload . Tools ? . Count ( ) ) ;
307
307
308
+ var firstTool = JsonSerializer . Deserialize < Tool > ( ( requestPayload . Tools ? . Cast < JsonElement > ( ) . First ( ) ! ) . Value ) ;
309
+ Assert . Equal ( "TestPlugin_TestFunction" , firstTool ! . Function ! . Name ) ;
310
+ Assert . Single ( firstTool . Function ! . Parameters ! . Properties ! ) ;
311
+ Assert . Equal ( "testInput" , firstTool . Function ! . Parameters ! . Properties ! . First ( ) . Key ) ;
312
+ Assert . Equal ( "string" , firstTool . Function ! . Parameters ! . Properties ! . First ( ) . Value . Type ) ;
313
+ Assert . Equal ( "testInput" , firstTool . Function ! . Parameters ! . Required ! . First ( ) ) ;
314
+
308
315
Assert . NotNull ( message . ModelId ) ;
309
316
Assert . Equal ( targetModel , message . ModelId ) ;
310
317
Assert . NotNull ( message . InnerContent ) ;
@@ -375,6 +382,13 @@ public async Task GetChatMessageContentsShouldAdvertiseAndTriggerToolAsync()
375
382
Assert . NotEmpty ( requestPayload . Tools ) ;
376
383
Assert . Equal ( 1 , requestPayload . Tools ? . Count ( ) ) ;
377
384
385
+ var firstTool = JsonSerializer . Deserialize < Tool > ( ( requestPayload . Tools ? . Cast < JsonElement > ( ) . First ( ) ! ) . Value ) ;
386
+ Assert . Equal ( "TestPlugin_TestFunction" , firstTool ! . Function ! . Name ) ;
387
+ Assert . Single ( firstTool . Function ! . Parameters ! . Properties ! ) ;
388
+ Assert . Equal ( "testInput" , firstTool . Function ! . Parameters ! . Properties ! . First ( ) . Key ) ;
389
+ Assert . Equal ( "string" , firstTool . Function ! . Parameters ! . Properties ! . First ( ) . Value . Type ) ;
390
+ Assert . Equal ( "testInput" , firstTool . Function ! . Parameters ! . Required ! . First ( ) ) ;
391
+
378
392
Assert . Equal ( 1 , invocationCount ) ;
379
393
380
394
Assert . NotNull ( message . ModelId ) ;
0 commit comments