Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
.github
dotnet
python
workflow-samples
declarative-agents
Comment thread
sphenry marked this conversation as resolved.

- name: Setup dotnet
uses: actions/setup-dotnet@v5.2.0
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
.github
dotnet
python
workflow-samples
declarative-agents

- name: Start Azure Cosmos DB Emulator
if: runner.os == 'Windows'
Expand Down
Original file line number Diff line number Diff line change
@@ -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/).
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 6 additions & 6 deletions dotnet/agent-framework-dotnet.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.\""
Comment thread
sphenry marked this conversation as resolved.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private Program(string workflowFile, string? workflowInput)
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");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static string ParseWorkflowFile(string[] args)
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");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment thread
sphenry marked this conversation as resolved.

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public Task ValidateCaseAsync(string workflowFileName, string testcaseFileName,
[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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Task ValidateMultiTurnAsync(string workflowFileName, string testcaseFileN

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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ internal static string GetRepoFolder()

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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ def test_agent_schema_dispatch_property_schema_with_nested_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 []
Expand All @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand All @@ -13,7 +13,7 @@

# 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"

Comment thread
sphenry marked this conversation as resolved.

def get_workflow_sample_files():
Expand Down
22 changes: 11 additions & 11 deletions python/samples/02-agents/declarative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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:

Comment thread
sphenry marked this conversation as resolved.
- **`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.

Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion python/samples/02-agents/declarative/openai_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
sphenry marked this conversation as resolved.
workflow_path = Path(__file__).parent / "workflow.yaml"

workflow = factory.create_workflow_from_yaml_path(workflow_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
sphenry marked this conversation as resolved.
workflow_path = Path(__file__).parent / "workflow.yaml"

workflow = factory.create_workflow_from_yaml_path(workflow_path)
Expand Down
Loading