Skip to content

Commit

Permalink
.Net Samples Restructure - Phase 3 (#6043)
Browse files Browse the repository at this point in the history
### Motivation and Context

Resolves #5949

- Fixed Bug in Visual Studio not running Tests using Test Explorer
- Update Readme.md + Added GettingStartedWithAgents ReadMe.
- Filtering Examples Split
- Added Namespaces for better organization of the Test Explorer View.

![image](https://github.com/microsoft/semantic-kernel/assets/19890735/2a81aafd-4de9-4143-ad53-7104ac22e5f3)
  • Loading branch information
RogerBarreto committed Apr 29, 2024
1 parent 80aa777 commit 1e94588
Show file tree
Hide file tree
Showing 91 changed files with 304 additions and 223 deletions.
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/Legacy_AgentAuthoring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Microsoft.SemanticKernel.Experimental.Agents;

namespace Examples;
namespace Agents;

/// <summary>
/// Showcase hiearchical Open AI Agent interactions using semantic kernel.
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/Legacy_AgentCharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.SemanticKernel.Connectors.OpenAI;
using Microsoft.SemanticKernel.Experimental.Agents;

namespace Examples;
namespace Agents;

// ReSharper disable once InconsistentNaming
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Microsoft.SemanticKernel.Experimental.Agents;

namespace Examples;
namespace Agents;

/// <summary>
/// Showcase complex Open AI Agent collaboration using semantic kernel.
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/Legacy_AgentDelegation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Plugins;
using Resources;

namespace Examples;
namespace Agents;

/// <summary>
/// Showcase complex Open AI Agent interactions using semantic kernel.
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/Legacy_AgentTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.SemanticKernel.Experimental.Agents;
using Resources;

namespace Examples;
namespace Agents;

// ReSharper disable once InconsistentNaming
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/Legacy_Agents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Plugins;
using Resources;

namespace Examples;
namespace Agents;

/// <summary>
/// Showcase Open AI Agent integration with semantic kernel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.SemanticKernel.Connectors.OpenAI;
using Microsoft.SemanticKernel.Experimental.Agents;

namespace Examples;
namespace Agents;

public class Legacy_ChatCompletionAgent(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/MixedChat_Agents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.SemanticKernel.Agents.OpenAI;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace Agents;
/// <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.
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/Agents/OpenAIAssistant_Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Plugins;

namespace Examples;
namespace Agents;
/// <summary>
/// Demonstrate creation of <see cref="OpenAIAssistantAgent"/> and
/// eliciting its response to three explicit user messages.
Expand Down
3 changes: 2 additions & 1 deletion dotnet/samples/Concepts/Agents/OpenAIAssistant_ChartMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
using Microsoft.SemanticKernel.Agents.OpenAI;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace Agents;

/// <summary>
/// Demonstrate using code-interpreter with <see cref="OpenAIAssistantAgent"/> to
/// produce image content displays the requested charts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
using Microsoft.SemanticKernel.Agents.OpenAI;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace Agents;

/// <summary>
/// Demonstrate using code-interpreter on <see cref="OpenAIAssistantAgent"/> .
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion dotnet/samples/Concepts/Agents/OpenAIAssistant_Retrieval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using Microsoft.SemanticKernel.Connectors.OpenAI;
using Resources;

namespace Examples;
namespace Agents;

/// <summary>
/// Demonstrate using retrieval on <see cref="OpenAIAssistantAgent"/> .
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Concepts/AudioToText/OpenAI_AudioToText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.SemanticKernel.Connectors.OpenAI;
using Resources;

namespace Examples;
namespace AudioToText;

/// <summary>
/// Represents a class that demonstrates audio processing functionality.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.SemanticKernel.Connectors.Google;
using xRetry;

namespace Examples;
namespace AutoFunctionCalling;

public sealed class Gemini_FunctionCalling(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace AutoFunctionCalling;

// This example shows how to use OpenAI's tool calling capability via the chat completions interface.
public class OpenAI_FunctionCalling(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.SemanticKernel.Connectors.OpenAI;
using xRetry;

namespace Examples;
namespace ChatCompletion;

/// <summary>
/// This example demonstrates how to use Azure OpenAI Chat Completion with data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

// The following example shows how to use Chat History with Author identity associated with each chat message.
public class ChatHistoryAuthorName(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace ChatCompletion;

public class ChatHistorySerialization(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Microsoft.SemanticKernel;

namespace Examples;
namespace ChatCompletion;

// These examples show how to use a custom HttpClient with SK connectors.
public class Connectors_CustomHttpClient(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

/// <summary>
/// This example shows how you can use Streaming with Kernel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel;
using xRetry;

namespace Examples;
namespace ChatCompletion;

public class Connectors_WithMultipleLLMs(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace ChatCompletion;

public sealed class Google_GeminiChatCompletion(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace ChatCompletion;

public sealed class Google_GeminiChatCompletionStreaming(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Connectors.Google;

namespace Examples;
namespace ChatCompletion;

/// <summary>
/// Represents an example class for Gemini Embedding Generation with volatile memory store.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Resources;

namespace Examples;
namespace ChatCompletion;

public sealed class Google_GeminiVision(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

// The following example shows how to use Semantic Kernel with OpenAI ChatGPT API
public class OpenAI_ChatCompletion(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

// The following example shows how to use Semantic Kernel with streaming Multiple Results Chat Completion.
public class OpenAI_ChatCompletionMultipleChoices(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

// The following example shows how to use Semantic Kernel with streaming Chat Completion
public class OpenAI_ChatCompletionStreaming(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

// The following example shows how to use Semantic Kernel with multiple streaming chat completion results.
public class OpenAI_ChatCompletionStreamingMultipleChoices(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;

namespace Examples;
namespace ChatCompletion;

// This example shows how to use GPT Vision model with different content types (text and image).
public class OpenAI_ChatCompletionWithVision(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Azure.Core.Pipeline;
using Microsoft.SemanticKernel;

namespace Examples;
namespace ChatCompletion;

public sealed class OpenAI_CustomAzureOpenAIClient(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;

namespace Examples;
namespace ChatCompletion;

/**
* Logit_bias is an optional parameter that modifies the likelihood of specified tokens appearing in a Completion.
Expand Down
1 change: 0 additions & 1 deletion dotnet/samples/Concepts/Concepts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<NoWarn>CS8618,IDE0009,CA1051,CA1050,CA1707,CA1054,CA2007,VSTHRD111,CS1591,RCS1110,RCS1243,CA5394,SKEXP0001,SKEXP0010,SKEXP0020,SKEXP0040,SKEXP0050,SKEXP0060,SKEXP0070,SKEXP0101,SKEXP0110</NoWarn>
<OutputType>Library</OutputType>
<UserSecretsId>5ee045b0-aea3-4f08-8d31-32d1a6f8fed0</UserSecretsId>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.SemanticKernel;

namespace Examples;
namespace DependencyInjection;

// These examples show how to use HttpClient and HttpClientFactory within SK SDK.
public class HttpClient_Registration(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel;

namespace Examples;
namespace DependencyInjection;

// These examples show how to use HttpClient and HttpClientFactory within SK SDK.
public class HttpClient_Resiliency(ITestOutputHelper output) : BaseTest(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Plugins.Core;

namespace Examples;
namespace DependencyInjection;

public class Kernel_Building(ITestOutputHelper output) : BaseTest(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel;

namespace Examples;
namespace DependencyInjection;

// The following examples show how to use SK SDK in applications using DI/IoC containers.
public class Kernel_Injecting(ITestOutputHelper output) : BaseTest(output)
Expand Down
Loading

0 comments on commit 1e94588

Please sign in to comment.