語言

HostedMcpServerTool 建構函式

定義

初始化 HostedMcpServerTool 類別的新執行個體。

多載

HostedMcpServerTool(String, String)

初始化 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)

初始化 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 伺服器的網址。

例外狀況

serverName 或 serverAddress 為 null。

serverAddress 並非絕對網址。

適用於

HostedMcpServerTool(String, String, IReadOnlyDictionary<String,Object>)

初始化 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>)

初始化 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 伺服器的網址。

additionalProperties
IReadOnlyDictionary<String,Object>

以及與該工具相關的其他屬性。

例外狀況

serverName 或 serverAddress 為 null。

serverAddress 並非絕對網址。

適用於