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
2 changed files with 277 additions and 263 deletions
|
|
@ -6,7 +6,7 @@ public static class McpToolExtensions
|
|||
{
|
||||
public static IList<Anthropic.SDK.Common.Tool> ToAnthropicTools(this IEnumerable<McpDotNet.Protocol.Types.Tool> tools)
|
||||
{
|
||||
List<Anthropic.SDK.Common.Tool> result = new();
|
||||
List<Anthropic.SDK.Common.Tool> result = [];
|
||||
foreach (var tool in tools)
|
||||
{
|
||||
var function = tool.InputSchema == null
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
using McpDotNet.Client;
|
||||
using McpDotNet.Configuration;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Anthropic.SDK;
|
||||
using Anthropic.SDK.Messaging;
|
||||
using Anthropic.SDK;
|
||||
using Anthropic.SDK.Constants;
|
||||
using Anthropic.SDK.Messaging;
|
||||
using McpDotNet.Client;
|
||||
using McpDotNet.Configuration;
|
||||
using McpDotNet.Protocol.Transport;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
|
|
@ -19,7 +20,7 @@ internal class Program
|
|||
{
|
||||
Id = "everything",
|
||||
Name = "Everything",
|
||||
TransportType = "stdio",
|
||||
TransportType = TransportTypes.StdIo,
|
||||
TransportOptions = new Dictionary<string, string>
|
||||
{
|
||||
["command"] = "npx",
|
||||
|
|
@ -85,7 +86,7 @@ internal class Program
|
|||
|
||||
foreach (var toolCall in res.ToolCalls)
|
||||
{
|
||||
var response = await client.CallToolAsync(toolCall.Name, toolCall.Arguments?.ToMCPArguments());
|
||||
var response = await client.CallToolAsync(toolCall.Name, toolCall.Arguments?.ToMCPArguments() ?? []);
|
||||
|
||||
messages.Add(new Message(toolCall, response.Content[0].Text));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue