add all requirements for implementing XAiMcpClient ...

This commit is contained in:
2026-11-06 19:09:07 +03:30
parent 33dda6bee7
commit c53553e1cf
10 changed files with 309 additions and 1 deletions
+30
View File
@@ -524,5 +524,35 @@ namespace xAiModels.Extensions
value: $"{XAuthorization.TokenIdentifier} {apiKey}"
);
}
/// <summary>
/// Converts To AITools ...
/// </summary>
/// <param name="source"></param>
/// <returns></returns>
public static IList<AITool> ToAITools(
this IList<XAiMcpToolDefinition> source
)
{
//
var result = new List<AITool>();
//
foreach (var tool in source)
{
//
var declaration = AIFunctionFactory.CreateDeclaration(
name: tool.Name,
jsonSchema: tool.InputSchema,
description: tool.Description
);
//
result.Add(declaration);
}
//
return result;
}
}
}