Remove warnings from build (#29)
* Remove warnings from build * More fixes. * Using const for transport types
This commit is contained in:
parent
80daa5b73d
commit
7d69499ad5
1 changed files with 277 additions and 263 deletions
|
|
@ -30,7 +30,7 @@ public class McpAIFunction : AIFunction
|
|||
protected async override Task<object?> InvokeCoreAsync(IEnumerable<KeyValuePair<string, object?>> arguments, CancellationToken cancellationToken)
|
||||
{
|
||||
// Convert arguments to dictionary format expected by mcpdotnet
|
||||
Dictionary<string, object> argDict = new();
|
||||
Dictionary<string, object> argDict = [];
|
||||
foreach (var arg in arguments)
|
||||
{
|
||||
if (arg.Value is not null)
|
||||
|
|
@ -42,7 +42,7 @@ public class McpAIFunction : AIFunction
|
|||
// Call the tool through mcpdotnet
|
||||
var result = await _client.CallToolAsync(
|
||||
_tool.Name,
|
||||
argDict.Count == 0 ? new() : argDict,
|
||||
argDict.Count == 0 ? [] : argDict,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
|
|
@ -60,9 +60,9 @@ public class McpAIFunction : AIFunction
|
|||
var properties = jsonSchema?.Properties;
|
||||
if (properties == null)
|
||||
{
|
||||
return new();
|
||||
return [];
|
||||
}
|
||||
HashSet<string> requiredProperties = new(jsonSchema!.Required ?? []);
|
||||
HashSet<string> requiredProperties = [.. jsonSchema!.Required ?? []];
|
||||
return properties.Select(kvp =>
|
||||
new AIFunctionParameterMetadata(kvp.Key)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue