add all requirements for implementing XAiMcpClient ...
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user