HostedMcpServerTool 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
HostedMcpServerTool(String, String)
- Source:
- HostedMcpServerTool.cs
初始化 HostedMcpServerTool 类的新实例。
public:
HostedMcpServerTool(System::String ^ serverName, System::String ^ serverAddress);
public HostedMcpServerTool(string serverName, string serverAddress);
new Microsoft.Extensions.AI.HostedMcpServerTool : string * string -> Microsoft.Extensions.AI.HostedMcpServerTool
Public Sub New (serverName As String, serverAddress As String)
参数
- serverName
- String
远程 MCP 服务器的名称。
- serverAddress
- String
远程 MCP 服务器的地址。 这可能是一个 URL,或者在提供具有已知名称的内置 MCP 服务器的服务的情况下,它可以是这样的名称。
例外
serverName 或 serverAddress 为 null.
serverName 或 serverAddress 为空或完全由空格组成。
适用于
HostedMcpServerTool(String, Uri)
- Source:
- HostedMcpServerTool.cs
初始化 HostedMcpServerTool 类的新实例。
public:
HostedMcpServerTool(System::String ^ serverName, Uri ^ serverAddress);
public HostedMcpServerTool(string serverName, Uri serverAddress);
new Microsoft.Extensions.AI.HostedMcpServerTool : string * Uri -> Microsoft.Extensions.AI.HostedMcpServerTool
Public Sub New (serverName As String, serverAddress As Uri)
参数
- serverName
- String
远程 MCP 服务器的名称。
- serverAddress
- Uri
远程 MCP 服务器的 URL。
例外
serverName 或 serverAddress 为 null.
serverAddress 不是绝对 URL。
适用于
HostedMcpServerTool(String, String, IReadOnlyDictionary<String,Object>)
- Source:
- HostedMcpServerTool.cs
初始化 HostedMcpServerTool 类的新实例。
public:
HostedMcpServerTool(System::String ^ serverName, System::String ^ serverAddress, System::Collections::Generic::IReadOnlyDictionary<System::String ^, System::Object ^> ^ additionalProperties);
public HostedMcpServerTool(string serverName, string serverAddress, System.Collections.Generic.IReadOnlyDictionary<string,object?>? additionalProperties);
new Microsoft.Extensions.AI.HostedMcpServerTool : string * string * System.Collections.Generic.IReadOnlyDictionary<string, obj> -> Microsoft.Extensions.AI.HostedMcpServerTool
Public Sub New (serverName As String, serverAddress As String, additionalProperties As IReadOnlyDictionary(Of String, Object))
参数
- serverName
- String
远程 MCP 服务器的名称。
- serverAddress
- String
远程 MCP 服务器的地址。 这可能是一个 URL,或者在提供具有已知名称的内置 MCP 服务器的服务的情况下,它可以是这样的名称。
- additionalProperties
- IReadOnlyDictionary<String,Object>
与该工具关联的任何其他属性。
例外
serverName 或 serverAddress 为 null.
serverName 或 serverAddress 为空或完全由空格组成。
适用于
HostedMcpServerTool(String, Uri, IReadOnlyDictionary<String,Object>)
- Source:
- HostedMcpServerTool.cs
初始化 HostedMcpServerTool 类的新实例。
public:
HostedMcpServerTool(System::String ^ serverName, Uri ^ serverAddress, System::Collections::Generic::IReadOnlyDictionary<System::String ^, System::Object ^> ^ additionalProperties);
public HostedMcpServerTool(string serverName, Uri serverAddress, System.Collections.Generic.IReadOnlyDictionary<string,object?>? additionalProperties);
new Microsoft.Extensions.AI.HostedMcpServerTool : string * Uri * System.Collections.Generic.IReadOnlyDictionary<string, obj> -> Microsoft.Extensions.AI.HostedMcpServerTool
Public Sub New (serverName As String, serverAddress As Uri, additionalProperties As IReadOnlyDictionary(Of String, Object))
参数
- serverName
- String
远程 MCP 服务器的名称。
- serverAddress
- Uri
远程 MCP 服务器的 URL。
- additionalProperties
- IReadOnlyDictionary<String,Object>
与该工具关联的任何其他属性。
例外
serverName 或 serverAddress 为 null.
serverAddress 不是绝对 URL。