Python: Move workflow-samples and agent-samples under declarative-agents directory (#5011)

* Move workflow-samples and agent-samples under declarative-agents and update all references

Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/f70f7d19-9256-4eec-b7db-28007d74440c

Co-authored-by: sphenry <6749825+sphenry@users.noreply.github.com>

* Fix relative paths in README files inside moved directories

Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/f70f7d19-9256-4eec-b7db-28007d74440c

Co-authored-by: sphenry <6749825+sphenry@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sphenry <6749825+sphenry@users.noreply.github.com>
Co-authored-by: Shawn Henry <shahen@microsoft.com>
This commit is contained in:
Copilot
2026-04-02 11:34:33 +02:00
committed by GitHub
Unverified
parent 7e8e9e3074
commit fd253c0b0e
44 changed files with 52 additions and 52 deletions
+2 -2
View File
@@ -82,7 +82,7 @@ jobs:
.github
dotnet
python
workflow-samples
declarative-agents
- name: Setup dotnet
uses: actions/setup-dotnet@v5.2.0
@@ -152,7 +152,7 @@ jobs:
.github
dotnet
python
workflow-samples
declarative-agents
# Start Cosmos DB Emulator for all integration tests and only for unit tests when CosmosDB changes happened)
- name: Start Azure Cosmos DB Emulator
@@ -38,7 +38,7 @@ jobs:
.github
dotnet
python
workflow-samples
declarative-agents
- name: Start Azure Cosmos DB Emulator
if: runner.os == 'Windows'
@@ -1,3 +1,3 @@
# Declarative Agents
This folder contains sample agent definitions that can be run using the declarative agent support, for python see the [declarative agent python sample folder](../python/samples/02-agents/declarative/).
This folder contains sample agent definitions that can be run using the declarative agent support, for python see the [declarative agent python sample folder](../../python/samples/02-agents/declarative/).
@@ -10,8 +10,8 @@ Workflow workflow = DeclarativeWorkflowBuilder.Build("Marketing.yaml", options);
```
These example workflows may be executed by the workflow
[Samples](../dotnet/samples/03-workflows/Declarative)
[Samples](../../dotnet/samples/03-workflows/Declarative)
that are present in this repository.
> See the [README.md](../dotnet/samples/03-workflows/Declarative/README.md)
> See the [README.md](../../dotnet/samples/03-workflows/Declarative/README.md)
associated with the samples for configuration details.
+6 -6
View File
@@ -214,12 +214,12 @@
<Project Path="samples/03-workflows/Declarative/ToolApproval/ToolApproval.csproj" />
</Folder>
<Folder Name="/Samples/03-workflows/Declarative/Examples/">
<File Path="../workflow-samples/CustomerSupport.yaml" />
<File Path="../workflow-samples/DeepResearch.yaml" />
<File Path="../workflow-samples/Marketing.yaml" />
<File Path="../workflow-samples/MathChat.yaml" />
<File Path="../workflow-samples/README.md" />
<File Path="../workflow-samples/wttr.json" />
<File Path="../declarative-agents/workflow-samples/CustomerSupport.yaml" />
<File Path="../declarative-agents/workflow-samples/DeepResearch.yaml" />
<File Path="../declarative-agents/workflow-samples/Marketing.yaml" />
<File Path="../declarative-agents/workflow-samples/MathChat.yaml" />
<File Path="../declarative-agents/workflow-samples/README.md" />
<File Path="../declarative-agents/workflow-samples/wttr.json" />
</Folder>
<Folder Name="/Samples/03-workflows/SharedStates/">
<Project Path="samples/03-workflows/SharedStates/SharedStates.csproj" />
@@ -2,11 +2,11 @@
"profiles": {
"GetWeather": {
"commandName": "Project",
"commandLineArgs": "..\\..\\..\\..\\..\\..\\..\\..\\agent-samples\\chatclient\\GetWeather.yaml \"What is the weather in Cambridge, MA in °C?\""
"commandLineArgs": "..\\..\\..\\..\\..\\..\\..\\..\\declarative-agents\\agent-samples\\chatclient\\GetWeather.yaml \"What is the weather in Cambridge, MA in °C?\""
},
"Assistant": {
"commandName": "Project",
"commandLineArgs": "..\\..\\..\\..\\..\\..\\..\\..\\agent-samples\\chatclient\\Assistant.yaml \"Tell me a joke about a pirate in Italian.\""
"commandLineArgs": "..\\..\\..\\..\\..\\..\\..\\..\\declarative-agents\\agent-samples\\chatclient\\Assistant.yaml \"Tell me a joke about a pirate in Italian.\""
}
}
}
@@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\workflow-samples\CustomerSupport.yaml">
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\declarative-agents\workflow-samples\CustomerSupport.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
@@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\workflow-samples\DeepResearch.yaml">
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\declarative-agents\workflow-samples\DeepResearch.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="wttr.json">
@@ -143,7 +143,7 @@ internal sealed class Program
string? repoFolder = GetRepoFolder();
if (repoFolder is not null)
{
workflowFile = Path.Combine(repoFolder, "workflow-samples", workflowFile);
workflowFile = Path.Combine(repoFolder, "declarative-agents", "workflow-samples", workflowFile);
workflowFile = Path.ChangeExtension(workflowFile, ".yaml");
}
}
@@ -60,7 +60,7 @@ internal sealed class Program
string? repoFolder = GetRepoFolder();
if (repoFolder is not null)
{
workflowFile = Path.Combine(repoFolder, "workflow-samples", workflowFile);
workflowFile = Path.Combine(repoFolder, "declarative-agents", "workflow-samples", workflowFile);
workflowFile = Path.ChangeExtension(workflowFile, ".yaml");
}
}
@@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\workflow-samples\MathChat.yaml">
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\declarative-agents\workflow-samples\MathChat.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
@@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\workflow-samples\Marketing.yaml">
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\declarative-agents\workflow-samples\Marketing.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
@@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\workflow-samples\MathChat.yaml">
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\..\declarative-agents\workflow-samples\MathChat.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
@@ -4,9 +4,9 @@ Declarative Workflows is a no-code platform for orchestrating AI agents to accom
It allows users to design, execute, and monitor workflows using simple declarative configurations—no coding required.
By connecting multiple AI agents and services, it enables automation of sophisticated processes that traditionally require custom engineering.
We've provided a set of [Sample Workflows](../../../workflow-samples/) within the `agent-framework` repository.
We've provided a set of [Sample Workflows](../../../declarative-agents/workflow-samples/) within the `agent-framework` repository.
Please refer to the [README](../../../workflow-samples/README.md) for setup instructions to run the sample workflows in your environment.
Please refer to the [README](../../../declarative-agents/workflow-samples/README.md) for setup instructions to run the sample workflows in your environment.
As part of our [Getting Started with Declarative Workflows](../../samples/03-workflows/Declarative/README.md),
we've provided a console application that is able to execute any declarative workflow.
@@ -29,11 +29,11 @@ public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowT
[InlineData("MathChat.yaml", "MathChat.json", true)]
[InlineData("DeepResearch.yaml", "DeepResearch.json", Skip = "Long running")]
public Task ValidateScenarioAsync(string workflowFileName, string testcaseFileName, bool externalConveration = false) =>
this.RunWorkflowAsync(Path.Combine(GetRepoFolder(), "workflow-samples", workflowFileName), testcaseFileName, externalConveration);
this.RunWorkflowAsync(Path.Combine(GetRepoFolder(), "declarative-agents", "workflow-samples", workflowFileName), testcaseFileName, externalConveration);
[Fact(Skip = "Needs template support")]
public Task ValidateMultiTurnAsync() =>
this.RunWorkflowAsync(Path.Combine(GetRepoFolder(), "workflow-samples", "HumanInLoop.yaml"), "HumanInLoop.json", useJsonCheckpoint: true);
this.RunWorkflowAsync(Path.Combine(GetRepoFolder(), "declarative-agents", "workflow-samples", "HumanInLoop.yaml"), "HumanInLoop.json", useJsonCheckpoint: true);
protected override async Task RunAndVerifyAsync<TInput>(Testcase testcase, string workflowPath, DeclarativeWorkflowOptions workflowOptions, TInput input, bool useJsonCheckpoint)
{
@@ -41,7 +41,7 @@ public sealed class DeclarativeWorkflowTest(ITestOutputHelper output) : Workflow
private static string GetWorkflowPath(string workflowFileName, bool isSample) =>
isSample
? Path.Combine(GetRepoFolder(), "workflow-samples", workflowFileName)
? Path.Combine(GetRepoFolder(), "declarative-agents", "workflow-samples", workflowFileName)
: Path.Combine(Environment.CurrentDirectory, "Workflows", workflowFileName);
protected override async Task RunAndVerifyAsync<TInput>(Testcase testcase, string workflowPath, DeclarativeWorkflowOptions workflowOptions, TInput input, bool useJsonCheckpoint)
@@ -94,7 +94,7 @@ public abstract class WorkflowTest(ITestOutputHelper output) : IntegrationTest(o
while (current is not null)
{
if (Directory.Exists(Path.Combine(current.FullName, "workflow-samples")))
if (Directory.Exists(Path.Combine(current.FullName, "declarative-agents", "workflow-samples")))
{
return current.FullName;
}
@@ -27,7 +27,7 @@
<None Update="Agents\*.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\..\..\workflow-samples\Setup\*.yaml" LinkBase="Agents">
<None Include="$(MSBuildThisFileDirectory)\..\..\..\declarative-agents\workflow-samples\Setup\*.yaml" LinkBase="Agents">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="Testcases\*.json">
@@ -439,10 +439,10 @@ properties:
def _get_agent_sample_yaml_files() -> list[tuple[Path, Path]]:
"""Helper function to collect all YAML files from agent-samples directory."""
"""Helper function to collect all YAML files from declarative-agents/agent-samples directory."""
current_file = Path(__file__)
repo_root = current_file.parent.parent.parent.parent # tests -> declarative -> packages -> python
agent_samples_dir = repo_root.parent / "agent-samples"
agent_samples_dir = repo_root.parent / "declarative-agents" / "agent-samples"
if not agent_samples_dir.exists():
return []
@@ -457,7 +457,7 @@ def _get_agent_sample_yaml_files() -> list[tuple[Path, Path]]:
ids=lambda x: x[0].name if isinstance(x, tuple) else str(x),
)
def test_agent_schema_dispatch_agent_samples(yaml_file: Path, agent_samples_dir: Path):
"""Test that agent_schema_dispatch successfully loads a YAML file from agent-samples directory."""
"""Test that agent_schema_dispatch loads a YAML file from declarative-agents/agent-samples directory."""
with open(yaml_file) as f:
content = f.read()
result = agent_schema_dispatch(yaml.safe_load(content))
@@ -2,7 +2,7 @@
"""Integration tests for workflow samples.
These tests verify that the workflow samples from workflow-samples/ directory
These tests verify that the workflow samples from declarative-agents/workflow-samples/ directory
can be parsed and validated by the WorkflowFactory.
"""
@@ -13,7 +13,7 @@ import yaml
# Path to workflow samples - navigate from tests dir up to repo root
# tests/test_*.py -> packages/declarative/tests/ -> packages/declarative/ -> packages/ -> python/ -> repo root
WORKFLOW_SAMPLES_DIR = Path(__file__).parent.parent.parent.parent.parent / "workflow-samples"
WORKFLOW_SAMPLES_DIR = Path(__file__).parent.parent.parent.parent.parent / "declarative-agents" / "workflow-samples"
def get_workflow_sample_files():
+11 -11
View File
@@ -28,7 +28,7 @@ Demonstrates how to create an agent with custom function tools using the declara
- Uses Azure OpenAI Responses client
- Shows how to bind Python functions to the agent using the `bindings` parameter
- Loads agent configuration from `agent-samples/chatclient/GetWeather.yaml`
- Loads agent configuration from `declarative-agents/agent-samples/chatclient/GetWeather.yaml`
- Implements a simple weather lookup function tool
**Key concepts**: Function binding, Azure OpenAI integration, tool usage
@@ -39,7 +39,7 @@ Shows how to create an agent that can search and retrieve information from Micro
- Uses Azure AI Foundry client with MCP server integration
- Demonstrates async context managers for proper resource cleanup
- Loads agent configuration from `agent-samples/foundry/MicrosoftLearnAgent.yaml`
- Loads agent configuration from `declarative-agents/agent-samples/foundry/MicrosoftLearnAgent.yaml`
- Uses Azure CLI credentials for authentication
- Leverages MCP to access Microsoft documentation tools
@@ -63,7 +63,7 @@ Illustrates a basic agent using Azure OpenAI with structured responses.
- Uses Azure OpenAI Responses client
- Shows how to pass credentials via `client_kwargs`
- Loads agent configuration from `agent-samples/azure/AzureOpenAIResponses.yaml`
- Loads agent configuration from `declarative-agents/agent-samples/azure/AzureOpenAIResponses.yaml`
- Demonstrates accessing structured response data
**Key concepts**: Azure OpenAI integration, credential management, structured outputs
@@ -74,18 +74,18 @@ Demonstrates the simplest possible agent using OpenAI directly.
- Uses OpenAI API (requires `OPENAI_API_KEY` environment variable)
- Shows minimal configuration needed for basic agent creation
- Loads agent configuration from `agent-samples/openai/OpenAIResponses.yaml`
- Loads agent configuration from `declarative-agents/agent-samples/openai/OpenAIResponses.yaml`
**Key concepts**: OpenAI integration, minimal setup, environment-based configuration
## Agent Samples Repository
All the YAML configuration files referenced in these samples are located in the [`agent-samples`](../../../../agent-samples/) folder at the repository root. This folder contains declarative agent specifications organized by provider:
All the YAML configuration files referenced in these samples are located in the [`declarative-agents/agent-samples`](../../../../declarative-agents/agent-samples/) folder at the repository root. This folder contains declarative agent specifications organized by provider:
- **`agent-samples/azure/`** - Azure OpenAI agent configurations
- **`agent-samples/chatclient/`** - Chat client agent configurations with tools
- **`agent-samples/foundry/`** - Azure AI Foundry agent configurations
- **`agent-samples/openai/`** - OpenAI agent configurations
- **`declarative-agents/agent-samples/azure/`** - Azure OpenAI agent configurations
- **`declarative-agents/agent-samples/chatclient/`** - Chat client agent configurations with tools
- **`declarative-agents/agent-samples/foundry/`** - Azure AI Foundry agent configurations
- **`declarative-agents/agent-samples/openai/`** - OpenAI agent configurations
**Important**: These YAML files are **platform-agnostic** and work with both Python and .NET implementations of the Agent Framework. You can use the exact same YAML definition to create agents in either language, making it easy to share agent configurations across different technology stacks.
@@ -261,12 +261,12 @@ python openai_responses_agent.py
## Learn More
- [Agent Framework Declarative Package](../../../packages/declarative/) - Main declarative package documentation
- [Agent Samples](../../../../agent-samples/) - Additional declarative agent YAML specifications
- [Agent Samples](../../../../declarative-agents/agent-samples/) - Additional declarative agent YAML specifications
- [Agent Framework Core](../../../packages/core/) - Core agent framework documentation
## Next Steps
1. Explore the YAML files in the `agent-samples` folder to understand the configuration format
1. Explore the YAML files in the `declarative-agents/agent-samples` folder to understand the configuration format
2. Try modifying the samples to use different models or instructions
3. Create your own declarative agent configurations
4. Build custom function tools and bind them to your agents
@@ -14,7 +14,7 @@ async def main():
"""Create an agent from a declarative yaml specification and run it."""
# get the path
current_path = Path(__file__).parent
yaml_path = current_path.parent.parent.parent.parent / "agent-samples" / "azure" / "AzureOpenAIResponses.yaml"
yaml_path = current_path.parent.parent.parent.parent / "declarative-agents" / "agent-samples" / "azure" / "AzureOpenAIResponses.yaml"
# load the yaml from the path
with yaml_path.open("r") as f:
yaml_str = f.read()
@@ -22,7 +22,7 @@ async def main():
"""Create an agent from a declarative yaml specification and run it."""
# get the path
current_path = Path(__file__).parent
yaml_path = current_path.parent.parent.parent.parent / "agent-samples" / "chatclient" / "GetWeather.yaml"
yaml_path = current_path.parent.parent.parent.parent / "declarative-agents" / "agent-samples" / "chatclient" / "GetWeather.yaml"
# load the yaml from the path
with yaml_path.open("r") as f:
yaml_str = f.read()
@@ -28,7 +28,7 @@ async def main():
"""Create an agent from a declarative yaml specification and run it."""
# get the path
current_path = Path(__file__).parent
yaml_path = current_path.parent.parent.parent.parent / "agent-samples" / "foundry" / "MicrosoftLearnAgent.yaml"
yaml_path = current_path.parent.parent.parent.parent / "declarative-agents" / "agent-samples" / "foundry" / "MicrosoftLearnAgent.yaml"
# create the agent from the yaml
async with (
AzureCliCredential() as credential,
@@ -13,7 +13,7 @@ async def main():
"""Create an agent from a declarative yaml specification and run it."""
# get the path
current_path = Path(__file__).parent
yaml_path = current_path.parent.parent.parent.parent / "agent-samples" / "openai" / "OpenAIResponses.yaml"
yaml_path = current_path.parent.parent.parent.parent / "declarative-agents" / "agent-samples" / "openai" / "OpenAIResponses.yaml"
# create the agent from the yaml
agent = AgentFactory(safe_mode=False).create_agent_from_yaml_path(yaml_path)
# use the agent
@@ -243,9 +243,9 @@ async def main() -> None:
# Load workflow from YAML
samples_root = Path(__file__).parent.parent.parent.parent.parent.parent.parent
workflow_path = samples_root / "workflow-samples" / "CustomerSupport.yaml"
workflow_path = samples_root / "declarative-agents" / "workflow-samples" / "CustomerSupport.yaml"
if not workflow_path.exists():
# Fall back to local copy if workflow-samples doesn't exist
# Fall back to local copy if declarative-agents/workflow-samples doesn't exist
workflow_path = Path(__file__).parent / "workflow.yaml"
workflow = factory.create_workflow_from_yaml_path(workflow_path)
@@ -190,9 +190,9 @@ async def main() -> None:
# Load workflow from YAML
samples_root = Path(__file__).parent.parent.parent.parent.parent.parent
workflow_path = samples_root / "workflow-samples" / "DeepResearch.yaml"
workflow_path = samples_root / "declarative-agents" / "workflow-samples" / "DeepResearch.yaml"
if not workflow_path.exists():
# Fall back to local copy if workflow-samples doesn't exist
# Fall back to local copy if declarative-agents/workflow-samples doesn't exist
workflow_path = Path(__file__).parent / "workflow.yaml"
workflow = factory.create_workflow_from_yaml_path(workflow_path)