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
4 changed files with 277 additions and 263 deletions
|
|
@ -16,7 +16,7 @@ internal static class AIFunctionUtilities
|
|||
["type"] = "object",
|
||||
["title"] = tool.Name,
|
||||
["description"] = tool.Description ?? string.Empty,
|
||||
["properties"] = tool.InputSchema?.Properties ?? new(),
|
||||
["properties"] = tool.InputSchema?.Properties ?? [],
|
||||
["required"] = tool.InputSchema?.Required ?? []
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,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)
|
||||
|
|
@ -44,7 +44,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
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace McpDotNet.Extensions.AI;
|
|||
/// </summary>
|
||||
public class McpSessionScope : IAsyncDisposable
|
||||
{
|
||||
private readonly List<IMcpClient> _clients = new();
|
||||
private readonly List<IMcpClient> _clients = [];
|
||||
private bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ var config = new McpServerConfig
|
|||
{
|
||||
Id = "everything",
|
||||
Name = "Everything",
|
||||
TransportType = "stdio",
|
||||
TransportType = TransportTypes.StdIo,
|
||||
TransportOptions = new Dictionary<string, string>
|
||||
{
|
||||
["command"] = "npx",
|
||||
|
|
|
|||
Loading…
Reference in a new issue