mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Rename AI Agent packages to use Microsoft.Agents.AI (#913)
* Rename AI Agent packages to use Microsoft.Agents.AI * Fix for build * Fix formatting * Fix formatting * Ignore in VSTHRD200 in migration samples * Ignore in VSTHRD200 in migration samples * Add some missing projects and run format * Fix build errors * Address code review feedback * Fix merge issues --------- Co-authored-by: Mark Wallace <markwallace@microsoft.com>
This commit is contained in:
co-authored by
Mark Wallace
parent
a480ccfd16
commit
32e054f1fe
+6
-5
@@ -4,7 +4,7 @@
|
||||
|
||||
using Azure.AI.OpenAI;
|
||||
using Azure.Identity;
|
||||
using Microsoft.Extensions.AI.Agents;
|
||||
using Microsoft.Agents.AI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.SemanticKernel;
|
||||
using Microsoft.SemanticKernel.Agents.OpenAI;
|
||||
@@ -72,9 +72,7 @@ async Task AFAgent()
|
||||
{
|
||||
var assistantClient = sp.GetRequiredService<AssistantClient>();
|
||||
|
||||
var agent = assistantClient.CreateAIAgent(deploymentName, name: "Joker", instructions: "You are good at telling jokes.");
|
||||
|
||||
return agent;
|
||||
return assistantClient.CreateAIAgent(deploymentName, name: "Joker", instructions: "You are good at telling jokes.");
|
||||
});
|
||||
|
||||
await using ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
@@ -94,6 +92,9 @@ async Task AFAgent()
|
||||
|
||||
// Clean up
|
||||
var assistantClient = serviceProvider.GetRequiredService<AssistantClient>();
|
||||
await assistantClient.DeleteThreadAsync(thread.ConversationId);
|
||||
if (thread is ChatClientAgentThread chatThread)
|
||||
{
|
||||
await assistantClient.DeleteThreadAsync(chatThread.ConversationId);
|
||||
}
|
||||
await assistantClient.DeleteAssistantAsync(agent.Id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user