Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net - Agent Samples Restructure #5987

Merged
merged 7 commits into from
Apr 24, 2024
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: 4 additions & 0 deletions dotnet/samples/Concepts/AgentSyntax/AgentSyntax.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@
</EmbeddedResource>
<None Remove="Resources\*" />
</ItemGroup>
<ItemGroup>
<Folder Include="MixedAgents\" />
<Folder Include="OpenAIAssistant\" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion dotnet/samples/Concepts/AgentSyntax/BaseTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Reflection;
using Configuration;
using Microsoft.Extensions.Configuration;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Copyright (c) Microsoft. All rights reserved.
using System.Threading.Tasks;
using Examples;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.ChatCompletion;
using Xunit;
using Xunit.Abstractions;

namespace Examples;
namespace GettingStarted;

/// <summary>
/// Demonstrate creation of <see cref="ChatCompletionAgent"/> and
/// eliciting its response to three explicit user messages.
/// </summary>
public class Example01_Agent(ITestOutputHelper output) : BaseTest(output)
public class Step1_Agent(ITestOutputHelper output) : BaseTest(output)
{
private const string ParrotName = "Parrot";
private const string ParrotInstructions = "Repeat the user message in the voice of a pirate and then end with a parrot sound.";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.
using System.Threading.Tasks;
using Examples;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.ChatCompletion;
Expand All @@ -8,13 +9,13 @@
using Xunit;
using Xunit.Abstractions;

namespace Examples;
namespace GettingStarted;

/// <summary>
/// Demonstrate creation of <see cref="ChatCompletionAgent"/> with a <see cref="KernelPlugin"/>,
/// and then eliciting its response to explicit user messages.
/// </summary>
public class Example02_Plugins(ITestOutputHelper output) : BaseTest(output)
public class Step2_Plugins(ITestOutputHelper output) : BaseTest(output)
{
private const string HostName = "Host";
private const string HostInstructions = "Answer questions about the menu.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Examples;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.Chat;
using Microsoft.SemanticKernel.ChatCompletion;
using Xunit;
using Xunit.Abstractions;

namespace Examples;
namespace GettingStarted;

/// <summary>
/// Demonstrate creation of <see cref="AgentChat"/> with <see cref="AgentGroupChatSettings"/>
/// that inform how chat proceeds with regards to: Agent selection, chat continuation, and maximum
/// number of agent interactions.
/// </summary>
public class Example03_Chat(ITestOutputHelper output) : BaseTest(output)
public class Step3_Chat(ITestOutputHelper output) : BaseTest(output)
{
private const string ReviewerName = "ArtDirector";
private const string ReviewerInstructions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
using Xunit.Abstractions;

namespace Examples;

/// <summary>
/// Demonstrate that two different agent types are able to participate in the same conversation.
/// In this case a <see cref="ChatCompletionAgent"/> and <see cref="OpenAIAssistantAgent"/> participate.
/// </summary>
public class Example16_MixedChat(ITestOutputHelper output) : BaseTest(output)
public class MixedChat_Agents(ITestOutputHelper output) : BaseTest(output)
{
private const string ReviewerName = "ArtDirector";
private const string ReviewerInstructions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
using Xunit.Abstractions;

namespace Examples;

/// <summary>
/// Demonstrate creation of <see cref="OpenAIAssistantAgent"/> with a <see cref="KernelPlugin"/>,
/// and then eliciting its response to explicit user messages.
/// Demonstrate creation of <see cref="OpenAIAssistantAgent"/> and
/// eliciting its response to three explicit user messages.
/// </summary>
/// <remarks>
/// This example demonstrates that outside of initialization (and cleanup), plugin
/// usage for <see cref="OpenAIAssistantAgent"/> is no different from <see cref="ChatCompletionAgent"/>.
/// This example demonstrates that outside of initialization (and cleanup), using
/// <see cref="OpenAIAssistantAgent"/> is no different from <see cref="ChatCompletionAgent"/>
/// even with with a <see cref="KernelPlugin"/>.
/// </remarks>
public class Example12_OpenAIAssistant_Plugins(ITestOutputHelper output) : BaseTest(output)
public class OpenAIAssistant_Agent(ITestOutputHelper output) : BaseTest(output)
{
private const string HostName = "Host";
private const string HostInstructions = "Answer questions about the menu.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
using Xunit.Abstractions;

namespace Examples;

/// <summary>
/// Demonstrate using code-interpreter with <see cref="OpenAIAssistantAgent"/> to
/// produce image content displays the requested charts.
/// </summary>
public class Example15_OpenAIAssistant_ChartMaker(ITestOutputHelper output) : BaseTest(output)
public class OpenAIAssistant_ChartMaker(ITestOutputHelper output) : BaseTest(output)
{
/// <summary>
/// Target Open AI services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
using Xunit.Abstractions;

namespace Examples;

/// <summary>
/// Demonstrate using code-interpreter on <see cref="OpenAIAssistantAgent"/> .
/// </summary>
public class Example13_OpenAIAssistant_CodeInterpreter(ITestOutputHelper output) : BaseTest(output)
public class OpenAIAssistant_CodeInterpreter(ITestOutputHelper output) : BaseTest(output)
{
[Fact]
public async Task RunAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
using Xunit.Abstractions;

namespace Examples;

/// <summary>
/// Demonstrate using retrieval on <see cref="OpenAIAssistantAgent"/> .
/// </summary>
public class Example14_OpenAIAssistant_Retrieval(ITestOutputHelper output) : BaseTest(output)
public class OpenAIAssistant_Retrieval(ITestOutputHelper output) : BaseTest(output)
{
/// <summary>
/// Retrieval tool not supported on Azure OpenAI.
Expand Down
Loading