mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.Net: Agent Samples - Adding AzureAIAgentsPersistent to Steps (#105)
* Adding Persistent Agent to Steps * Add comments * Ensure changes * Fix format * Fix formatting * Adding cancellation token good practice
This commit is contained in:
+1
-2
@@ -4,7 +4,6 @@ using Azure.AI.Agents.Persistent;
|
||||
using Azure.Identity;
|
||||
using Microsoft.Agents;
|
||||
using Microsoft.Extensions.AI;
|
||||
using Microsoft.Extensions.AI.AzureAIAgentsPersistent;
|
||||
using Microsoft.Shared.Samples;
|
||||
|
||||
namespace Providers;
|
||||
@@ -37,7 +36,7 @@ public sealed class ChatClientAgent_With_AzureAIAgentsPersistent(ITestOutputHelp
|
||||
// Get the chat client to use for the agent.
|
||||
using var chatClient = persistentAgentsClient.AsIChatClient(persistentAgent.Id);
|
||||
|
||||
// Define the agent
|
||||
// Define the agent.
|
||||
ChatClientAgent agent = new(chatClient);
|
||||
|
||||
// Start a new thread for the agent conversation.
|
||||
|
||||
@@ -38,7 +38,7 @@ public sealed class ChatClientAgent_With_OpenAIAssistant(ITestOutputHelper outpu
|
||||
// Get the chat client to use for the agent.
|
||||
using var chatClient = assistantClient.AsIChatClient(assistantId);
|
||||
|
||||
// Define the agent
|
||||
// Define the agent.
|
||||
ChatClientAgent agent = new(chatClient);
|
||||
|
||||
// Start a new thread for the agent conversation.
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public sealed class ChatClientAgent_With_OpenAIChatCompletion(ITestOutputHelper
|
||||
// Start a new thread for the agent conversation.
|
||||
AgentThread thread = agent.GetNewThread();
|
||||
|
||||
// Respond to user input
|
||||
// Respond to user input.
|
||||
await RunAgentAsync("Tell me a joke about a pirate.");
|
||||
await RunAgentAsync("Now add some emojis to the joke.");
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public sealed class ChatClientAgent_With_OpenAIResponsesChatCompletion(ITestOutp
|
||||
// Start a new thread for the agent conversation based on the type.
|
||||
AgentThread thread = agent.GetNewThread();
|
||||
|
||||
// Respond to user input
|
||||
// Respond to user input.
|
||||
await RunAgentAsync("Tell me a joke about a pirate.");
|
||||
await RunAgentAsync("Now add some emojis to the joke.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user