mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [BREAKING] Rename GetNewSession to CreateSession (#3501)
* Rename GetNewSession to CreateSession * Address copilot feedback * Suppress warning * Suppress warning * Fix further warnings.
This commit is contained in:
committed by
GitHub
Unverified
parent
405bd6fb4b
commit
6fdf6111e6
+2
-2
@@ -37,7 +37,7 @@ AIAgent agent = new AzureOpenAIClient(
|
||||
tools: [mcpTool]);
|
||||
|
||||
// You can then invoke the agent like any other AIAgent.
|
||||
AgentSession session = await agent.GetNewSessionAsync();
|
||||
AgentSession session = await agent.CreateSessionAsync();
|
||||
Console.WriteLine(await agent.RunAsync("Please summarize the Azure AI Agent documentation related to MCP Tool calling?", session));
|
||||
|
||||
// **** MCP Tool with Approval Required ****
|
||||
@@ -64,7 +64,7 @@ AIAgent agentWithRequiredApproval = new AzureOpenAIClient(
|
||||
tools: [mcpToolWithApproval]);
|
||||
|
||||
// You can then invoke the agent like any other AIAgent.
|
||||
var sessionWithRequiredApproval = await agentWithRequiredApproval.GetNewSessionAsync();
|
||||
var sessionWithRequiredApproval = await agentWithRequiredApproval.CreateSessionAsync();
|
||||
var response = await agentWithRequiredApproval.RunAsync("Please summarize the Azure AI Agent documentation related to MCP Tool calling?", sessionWithRequiredApproval);
|
||||
var userInputRequests = response.UserInputRequests.ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user