diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgent/AzureAIAgents_Step16_ChatReduction/AzureAIAgents_Step16_ChatReduction.csproj b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgent/AzureAIAgents_Step16_ChatReduction/AzureAIAgents_Step16_ChatReduction.csproj deleted file mode 100644 index 3fb7e0be8f..0000000000 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgent/AzureAIAgents_Step16_ChatReduction/AzureAIAgents_Step16_ChatReduction.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - Exe - net9.0 - - enable - enable - - - - - - - - - - - - diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgent/AzureAIAgents_Step16_ChatReduction/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgent/AzureAIAgents_Step16_ChatReduction/Program.cs deleted file mode 100644 index 33c65c8e5a..0000000000 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgent/AzureAIAgents_Step16_ChatReduction/Program.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -// This sample shows how to use Azure Foundry Agents with chat history management. -// NOTE: With Azure Foundry Agents, the service manages the chat history size server-side. -// The agent thread maintains the conversation history automatically. - -using Azure.AI.Agents; -using Azure.Identity; -using Microsoft.Agents.AI; - -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; - -const string JokerInstructions = "You are good at telling jokes."; -const string JokerName = "JokerAgent"; - -// Get a client to create/retrieve/delete server side agents with Azure Foundry Agents. -var agentsClient = new AgentsClient(new Uri(endpoint), new AzureCliCredential()); - -// Define the agent you want to create. (Prompt Agent in this case) -AIAgent agent = agentsClient.CreateAIAgent(name: JokerName, model: deploymentName, instructions: JokerInstructions); - -AgentThread thread = agent.GetNewThread(); - -// Invoke the agent and output the text result. -Console.WriteLine(await agent.RunAsync("Tell me a joke about a pirate.", thread)); - -// Invoke the agent a few more times. -Console.WriteLine(await agent.RunAsync("Tell me a joke about a robot.", thread)); -Console.WriteLine(await agent.RunAsync("Tell me a joke about a lemur.", thread)); - -// With Azure Foundry Agents, the service manages the chat history size server-side. -// The agent thread maintains the conversation history automatically. -Console.WriteLine(await agent.RunAsync("Tell me the joke about the pirate again, but add emojis and use the voice of a parrot.", thread)); - -// Cleanup by agent name removes the agent version created. -agentsClient.DeleteAgent(agent.Name);