db620d33df
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
77 lines
3.1 KiB
C#
77 lines
3.1 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Azure.AI.Projects;
|
|
using Azure.AI.Projects.Agents;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Shared.Foundry;
|
|
using Shared.IntegrationTests;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents;
|
|
|
|
internal sealed class MarketingAgentProvider(IConfiguration configuration) : AgentProvider(configuration)
|
|
{
|
|
protected override async IAsyncEnumerable<ProjectsAgentVersion> CreateAgentsAsync(Uri foundryEndpoint)
|
|
{
|
|
AIProjectClient aiProjectClient = new(foundryEndpoint, TestAzureCliCredentials.CreateAzureCliCredential());
|
|
|
|
yield return
|
|
await aiProjectClient.CreateAgentAsync(
|
|
agentName: "AnalystAgent",
|
|
agentDefinition: this.DefineAnalystAgent(),
|
|
agentDescription: "Analyst agent for Marketing workflow");
|
|
|
|
yield return
|
|
await aiProjectClient.CreateAgentAsync(
|
|
agentName: "WriterAgent",
|
|
agentDefinition: this.DefineWriterAgent(),
|
|
agentDescription: "Writer agent for Marketing workflow");
|
|
|
|
yield return
|
|
await aiProjectClient.CreateAgentAsync(
|
|
agentName: "EditorAgent",
|
|
agentDefinition: this.DefineEditorAgent(),
|
|
agentDescription: "Editor agent for Marketing workflow");
|
|
}
|
|
|
|
private DeclarativeAgentDefinition DefineAnalystAgent() =>
|
|
new(this.GetSetting(TestSettings.AzureAIModelDeploymentName))
|
|
{
|
|
Instructions =
|
|
"""
|
|
You are a marketing analyst. Given a product description, identify:
|
|
- Key features
|
|
- Target audience
|
|
- Unique selling points
|
|
""",
|
|
Tools =
|
|
{
|
|
//ProjectsAgentTool.CreateBingGroundingTool( // TODO: Use Bing Grounding when available
|
|
// new BingGroundingSearchToolParameters(
|
|
// [new BingGroundingSearchConfiguration(this.GetSetting(Settings.FoundryGroundingTool))]))
|
|
}
|
|
};
|
|
|
|
private DeclarativeAgentDefinition DefineWriterAgent() =>
|
|
new(this.GetSetting(TestSettings.AzureAIModelDeploymentName))
|
|
{
|
|
Instructions =
|
|
"""
|
|
You are a marketing copywriter. Given a block of text describing features, audience, and USPs,
|
|
compose a compelling marketing copy (like a newsletter section) that highlights these points.
|
|
Output should be short (around 150 words), output just the copy as a single text block.
|
|
"""
|
|
};
|
|
|
|
private DeclarativeAgentDefinition DefineEditorAgent() =>
|
|
new(this.GetSetting(TestSettings.AzureAIModelDeploymentName))
|
|
{
|
|
Instructions =
|
|
"""
|
|
You are an editor. Given the draft copy, correct grammar, improve clarity, ensure consistent tone,
|
|
give format and make it polished. Output the final improved copy as a single text block.
|
|
"""
|
|
};
|
|
}
|