From 6173f05936eee8ccef975004b38f883dc8ae0d70 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Tue, 24 Mar 2026 14:29:17 -0700 Subject: [PATCH] Remove sample --- dotnet/agent-framework-dotnet.slnx | 1 - .../GenerateCode/GenerateCode.csproj | 30 ----- .../Declarative/GenerateCode/Program.cs | 105 ------------------ .../Properties/launchSettings.json | 28 ----- 4 files changed, 164 deletions(-) delete mode 100644 dotnet/samples/03-workflows/Declarative/GenerateCode/GenerateCode.csproj delete mode 100644 dotnet/samples/03-workflows/Declarative/GenerateCode/Program.cs delete mode 100644 dotnet/samples/03-workflows/Declarative/GenerateCode/Properties/launchSettings.json diff --git a/dotnet/agent-framework-dotnet.slnx b/dotnet/agent-framework-dotnet.slnx index 1d923076ee..5796140f74 100644 --- a/dotnet/agent-framework-dotnet.slnx +++ b/dotnet/agent-framework-dotnet.slnx @@ -199,7 +199,6 @@ - diff --git a/dotnet/samples/03-workflows/Declarative/GenerateCode/GenerateCode.csproj b/dotnet/samples/03-workflows/Declarative/GenerateCode/GenerateCode.csproj deleted file mode 100644 index a85173d289..0000000000 --- a/dotnet/samples/03-workflows/Declarative/GenerateCode/GenerateCode.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - Exe - net10.0 - enable - enable - 5ee045b0-aea3-4f08-8d31-32d1a6f8fed0 - $(NoWarn);CA1812 - - - - true - - - - - - - - - - - - - - - - - diff --git a/dotnet/samples/03-workflows/Declarative/GenerateCode/Program.cs b/dotnet/samples/03-workflows/Declarative/GenerateCode/Program.cs deleted file mode 100644 index 54c77d4077..0000000000 --- a/dotnet/samples/03-workflows/Declarative/GenerateCode/Program.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -using System.Diagnostics; -using Microsoft.Agents.AI.Workflows.Declarative; - -namespace Demo.DeclarativeEject; - -/// -/// HOW TO: Convert a workflow from a declartive (yaml based) definition to code. -/// -/// -/// Usage -/// Provide the path to the workflow definition file as the first argument. -/// All other arguments are intepreted as a queue of inputs. -/// When no input is queued, interactive input is requested from the console. -/// -internal sealed class Program -{ - public static void Main(string[] args) - { - Program program = new(args); - program.Execute(); - } - - private void Execute() - { - // Read and parse the declarative workflow. - Notify($"WORKFLOW: Parsing {Path.GetFullPath(this.WorkflowFile)}"); - - Stopwatch timer = Stopwatch.StartNew(); - - // Use DeclarativeWorkflowBuilder to generate code based on a YAML file. - string code = - DeclarativeWorkflowBuilder.Eject( - this.WorkflowFile, - DeclarativeWorkflowLanguage.CSharp, - workflowNamespace: "Demo.DeclarativeCode", - workflowPrefix: "Sample"); - - Notify($"\nWORKFLOW: Defined {timer.Elapsed}\n"); - - Console.WriteLine(code); - } - - private const string DefaultWorkflow = "Marketing.yaml"; - - private string WorkflowFile { get; } - - private Program(string[] args) - { - this.WorkflowFile = ParseWorkflowFile(args); - } - - private static string ParseWorkflowFile(string[] args) - { - string workflowFile = args.FirstOrDefault() ?? DefaultWorkflow; - - if (!File.Exists(workflowFile) && !Path.IsPathFullyQualified(workflowFile)) - { - string? repoFolder = GetRepoFolder(); - if (repoFolder is not null) - { - workflowFile = Path.Combine(repoFolder, "workflow-samples", workflowFile); - workflowFile = Path.ChangeExtension(workflowFile, ".yaml"); - } - } - - if (!File.Exists(workflowFile)) - { - throw new InvalidOperationException($"Unable to locate workflow: {Path.GetFullPath(workflowFile)}."); - } - - return workflowFile; - - static string? GetRepoFolder() - { - DirectoryInfo? current = new(Directory.GetCurrentDirectory()); - - while (current is not null) - { - if (Directory.Exists(Path.Combine(current.FullName, ".git"))) - { - return current.FullName; - } - - current = current.Parent; - } - - return null; - } - } - - private static void Notify(string message) - { - Console.ForegroundColor = ConsoleColor.Cyan; - try - { - Console.WriteLine(message); - } - finally - { - Console.ResetColor(); - } - } -} diff --git a/dotnet/samples/03-workflows/Declarative/GenerateCode/Properties/launchSettings.json b/dotnet/samples/03-workflows/Declarative/GenerateCode/Properties/launchSettings.json deleted file mode 100644 index 692664eb00..0000000000 --- a/dotnet/samples/03-workflows/Declarative/GenerateCode/Properties/launchSettings.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "profiles": { - "Marketing": { - "commandName": "Project", - "commandLineArgs": "\"Marketing.yaml\"" - }, - "MathChat": { - "commandName": "Project", - "commandLineArgs": "\"MathChat.yaml\"" - }, - "Question": { - "commandName": "Project", - "commandLineArgs": "\"Question.yaml\"" - }, - "Research": { - "commandName": "Project", - "commandLineArgs": "\"DeepResearch.yaml\"" - }, - "ResponseObject": { - "commandName": "Project", - "commandLineArgs": "\"ResponseObject.yaml\"" - }, - "UserInput": { - "commandName": "Project", - "commandLineArgs": "\"UserInput.yaml\"" - } - } -}