@@ -456,45 +456,45 @@ public async Task GrokInvokesHostedMcp()
456456 {
457457 var messages = new Chat ( )
458458 {
459- { "user" , "When was GrokClient v1.0 .0 released on the devlooped/GrokClient repo? Respond with just the date, in YYYY-MM-DD format." } ,
459+ { "user" , "When was GrokClient v1.1 .0 released on the devlooped/GrokClient repo? Respond with just the date, in YYYY-MM-DD format." } ,
460460 } ;
461461
462- var grok = new GrokClient ( Configuration [ "XAI_API_KEY" ] ! ) . AsIChatClient ( "grok-4-fast" ) ;
462+ var grok = new GrokClient ( Configuration [ "XAI_API_KEY" ] ! ) . AsIChatClient ( "grok-4-1- fast-non-reasoning " ) ;
463463
464464 var options = new ChatOptions
465465 {
466466 Tools = [ new HostedMcpServerTool ( "GitHub" , "https://api.githubcopilot.com/mcp/" ) {
467- AuthorizationToken = Configuration [ "GITHUB_TOKEN" ] ! ,
467+ Headers = new Dictionary < string , string > { [ "Authorization" ] = Configuration [ "GITHUB_TOKEN" ] ! } ,
468468 AllowedTools = [ "list_releases" ] ,
469469 } ]
470470 } ;
471471
472472 var response = await grok . GetResponseAsync ( messages , options ) ;
473473 var text = response . Text ;
474474
475- Assert . Equal ( "2025-11-29 " , text ) ;
475+ Assert . Equal ( "2026-01-05 " , text ) ;
476476 var call = Assert . Single ( response . Messages
477477 . SelectMany ( x => x . Contents )
478478 . OfType < McpServerToolCallContent > ( ) ) ;
479479
480- Assert . Equal ( "GitHub.list_releases" , call . ToolName ) ;
480+ Assert . Equal ( "GitHub.list_releases" , call . Name ) ;
481481 }
482482
483483 [ SecretsFact ( "XAI_API_KEY" , "GITHUB_TOKEN" ) ]
484484 public async Task GrokInvokesHostedMcpWithOutput ( )
485485 {
486486 var messages = new Chat ( )
487487 {
488- { "user" , "When was GrokClient v1.0 .0 released on the devlooped/GrokClient repo? Respond with just the date, in YYYY-MM-DD format." } ,
488+ { "user" , "When was GrokClient v1.1 .0 released on the devlooped/GrokClient repo? Respond with just the date, in YYYY-MM-DD format." } ,
489489 } ;
490490
491- var grok = new GrokClient ( Configuration [ "XAI_API_KEY" ] ! ) . AsIChatClient ( "grok-4-fast" ) ;
491+ var grok = new GrokClient ( Configuration [ "XAI_API_KEY" ] ! ) . AsIChatClient ( "grok-4-1- fast-non-reasoning " ) ;
492492
493493 var options = new GrokChatOptions
494494 {
495495 Include = { IncludeOption . McpCallOutput } ,
496496 Tools = [ new HostedMcpServerTool ( "GitHub" , "https://api.githubcopilot.com/mcp/" ) {
497- AuthorizationToken = Configuration [ "GITHUB_TOKEN" ] ! ,
497+ Headers = new Dictionary < string , string > { [ "Authorization" ] = Configuration [ "GITHUB_TOKEN" ] ! } ,
498498 AllowedTools = [ "list_releases" ] ,
499499 } ]
500500 } ;
@@ -506,16 +506,16 @@ public async Task GrokInvokesHostedMcpWithOutput()
506506 . SelectMany ( x => x . Contents )
507507 . OfType < McpServerToolResultContent > ( ) ) ;
508508
509- Assert . NotNull ( output . Output ) ;
510- Assert . Single ( output . Output ) ;
511- var json = Assert . Single ( output . Output ! . OfType < TextContent > ( ) ) . Text ;
509+ Assert . NotNull ( output . Outputs ) ;
510+ Assert . Single ( output . Outputs ) ;
511+ var json = Assert . Single ( output . Outputs ! . OfType < TextContent > ( ) ) . Text ;
512512 var tags = JsonSerializer . Deserialize < List < Release > > ( json , new JsonSerializerOptions ( JsonSerializerDefaults . Web )
513513 {
514514 PropertyNamingPolicy = JsonNamingPolicy . SnakeCaseLower
515515 } ) ;
516516
517517 Assert . NotNull ( tags ) ;
518- Assert . Contains ( tags , x => x . TagName == "v1.0 .0" ) ;
518+ Assert . Contains ( tags , x => x . TagName == "v1.1 .0" ) ;
519519 }
520520
521521 record Release ( string TagName , DateTimeOffset CreatedAt ) ;
@@ -527,20 +527,20 @@ public async Task GrokStreamsUpdatesFromAllTools()
527527 {
528528 { "user" ,
529529 """
530- What's the oldest stable version released on the devlooped/GrokClient repo on GitHub?,
530+ What's the latest stable version released on the devlooped/GrokClient repo on GitHub?,
531531 what is the current price of Tesla stock,
532532 and what is the current date? Respond with the following JSON:
533533 {
534- "today": "[get_date result]",
535- "release": "[first stable release of devlooped/GrokClient, using GitHub MCP tool]",
534+ "today": "[get_date result in yyyy-MM-dd format ]",
535+ "release": "[latest stable release of devlooped/GrokClient, using GitHub MCP tool]",
536536 "price": [$TSLA price using web search tool]
537537 }
538538 """
539539 } ,
540540 } ;
541541
542542 var grok = new GrokClient ( Configuration [ "XAI_API_KEY" ] ! )
543- . AsIChatClient ( "grok-4-fast" )
543+ . AsIChatClient ( "grok-4-1- fast-non-reasoning " )
544544 . AsBuilder ( )
545545 . UseFunctionInvocation ( )
546546 . UseLogging ( output . AsLoggerFactory ( ) )
@@ -554,12 +554,12 @@ public async Task GrokStreamsUpdatesFromAllTools()
554554 [
555555 new HostedWebSearchTool ( ) ,
556556 new HostedMcpServerTool ( "GitHub" , "https://api.githubcopilot.com/mcp/" ) {
557- AuthorizationToken = Configuration [ "GITHUB_TOKEN" ] ! ,
557+ Headers = new Dictionary < string , string > { [ "Authorization" ] = Configuration [ "GITHUB_TOKEN" ] ! } ,
558558 AllowedTools = [ "list_releases" , "get_release_by_tag" ] ,
559559 } ,
560560 AIFunctionFactory . Create ( ( ) => {
561561 getDateCalls ++ ;
562- return DateTimeOffset . Now . ToString ( "O" ) ;
562+ return DateTimeOffset . UtcNow . ToString ( "O" ) ;
563563 } , "get_date" , "Gets the current date" )
564564 ]
565565 } ;
@@ -581,8 +581,8 @@ public async Task GrokStreamsUpdatesFromAllTools()
581581
582582 Assert . Equal ( 1 , getDateCalls ) ;
583583
584- Assert . Equal ( DateOnly . FromDateTime ( DateTime . Today ) , typed . Today ) ;
585- Assert . EndsWith ( "1.0 .0" , typed . Release ) ;
584+ Assert . Equal ( DateOnly . FromDateTime ( DateTime . UtcNow ) , typed . Today ) ;
585+ Assert . EndsWith ( "1.1 .0" , typed . Release ) ;
586586 Assert . True ( typed . Price > 100 ) ;
587587 }
588588
0 commit comments