Skip to content

Commit

Permalink
Update docs and namespaces, remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
dluc committed Jul 27, 2023
1 parent 306febe commit 6a8f4e9
Show file tree
Hide file tree
Showing 77 changed files with 159 additions and 178 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ The code leverages the default data ingestion pipeline:

## Import memory using Semantic Memory Web Service

Depending on the configuration, the code above can run locally, inside your
process, or remotely through a service.
Depending on the configuration, the code above can run all the memory encoding
**locally inside your process, or remotely through an asynchronous service.**

If you're importing small files, and need only C# or Python, and can block
the process during the import, local execution can be fine.
the process during the import, local-in-process execution can be fine.

However, if you are in one of these scenarios:

Expand All @@ -62,12 +62,12 @@ However, if you are in one of these scenarios:

then you can deploy Semantic Memory as a service, plugging in the
default handlers or your custom Python/TypeScript/Java/etc. handlers,
leveraging the asynchronous queues automatically available.
and leveraging the asynchronous non-blocking memory encoding process.
[Here](server/combinedservices-dotnet/README.md) you can find a complete set
of instruction about
[how to run the Semantic Memory service](server/combinedservices-dotnet/README.md).

[Here](server/combinedservices-dotnet/README.md) you can find a complete set of instruction
about [how to run the Semantic Memory service](server/combinedservices-dotnet/README.md).

To quickly get up and running, use the following commands.
If you want to give the service a quick test, use the following commands.

```bash
cd server/combinedservices-dotnet
Expand All @@ -80,9 +80,11 @@ dotnet run setup
ASPNETCORE_ENVIRONMENT=Development dotnet run
```

To import files using Semantic Memory **web service**, simply use `SemanticMemoryWebClient`:
To import files using Semantic Memory **web service**, use `SemanticMemoryWebClient`:

```csharp
#reference clients/MemoryWebClient.csproj

var memory = new MemoryWebClient("http://127.0.0.1:9001"); // <== URL where the web service is running
await memory.ImportFileAsync("file1.docx",
Expand Down
16 changes: 8 additions & 8 deletions clients/dotnet/MemoryPipelineClient/MemoryPipelineClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders;
using Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
using Microsoft.SemanticKernel.SemanticMemory.Core.Diagnostics;
using Microsoft.SemanticKernel.SemanticMemory.Core.Handlers;
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticKernel.SemanticMemory.Core20;

namespace Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryPipelineClient;
using Microsoft.SemanticMemory.Core.AppBuilders;
using Microsoft.SemanticMemory.Core.Configuration;
using Microsoft.SemanticMemory.Core.Diagnostics;
using Microsoft.SemanticMemory.Core.Handlers;
using Microsoft.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticMemory.Core20;

namespace Microsoft.SemanticMemory.PipelineClient;

public class MemoryPipelineClient : ISemanticMemoryClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryPipelineClient</AssemblyName>
<RootNamespace>Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryPipelineClient</RootNamespace>
<AssemblyName>Microsoft.SemanticMemory.PipelineClient</AssemblyName>
<RootNamespace>Microsoft.SemanticMemory.PipelineClient</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions clients/dotnet/MemoryWebClient/MemoryWebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.SemanticKernel.SemanticMemory.Core20;
using Microsoft.SemanticMemory.Core20;

namespace Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryWebClient;
namespace Microsoft.SemanticMemory.WebClient;

public class MemoryWebClient : ISemanticMemoryClient
{
Expand Down
4 changes: 2 additions & 2 deletions clients/dotnet/MemoryWebClient/MemoryWebClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryWebClient</AssemblyName>
<RootNamespace>Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryWebClient</RootNamespace>
<AssemblyName>Microsoft.SemanticMemory.WebClient</AssemblyName>
<RootNamespace>Microsoft.SemanticMemory.WebClient</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.SemanticKernel.SemanticMemory.Core20;
using Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryPipelineClient;
using Microsoft.SemanticMemory.Core20;
using Microsoft.SemanticMemory.PipelineClient;

public static class Example1_ImportWithMemoryPipelineClient
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.SemanticKernel.SemanticMemory.Core20;
using Microsoft.SemanticKernel.SemanticMemory.SemanticMemoryWebClient;
using Microsoft.SemanticMemory.Core20;
using Microsoft.SemanticMemory.WebClient;

public static class Example2_ImportWithMemoryWebClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders;
using Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
using Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
using Microsoft.SemanticKernel.SemanticMemory.Core.Handlers;
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticMemory.Core.AppBuilders;
using Microsoft.SemanticMemory.Core.Configuration;
using Microsoft.SemanticMemory.Core.ContentStorage;
using Microsoft.SemanticMemory.Core.Handlers;
using Microsoft.SemanticMemory.Core.Pipeline;

public static class Example3_CustomInProcessPipeline
{
Expand Down
4 changes: 2 additions & 2 deletions clients/samples/TextExtractionFromDocsExamples/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.SemanticKernel.Services.DataFormats.Office;
using Microsoft.SemanticKernel.Services.DataFormats.Pdf;
using Microsoft.SemanticMemory.DataFormats.Office;
using Microsoft.SemanticMemory.DataFormats.Pdf;

// MS Word example
Console.WriteLine("===============================");
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core.NetStandard20/Core.NetStandard20.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.SemanticKernel.SemanticMemory.Core20</AssemblyName>
<RootNamespace>Microsoft.SemanticKernel.SemanticMemory.Core20</RootNamespace>
<AssemblyName>Microsoft.SemanticMemory.Core20</AssemblyName>
<RootNamespace>Microsoft.SemanticMemory.Core20</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core.NetStandard20/ISemanticMemoryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// ReSharper disable CommentTypo

namespace Microsoft.SemanticKernel.SemanticMemory.Core20;
namespace Microsoft.SemanticMemory.Core20;

public interface ISemanticMemoryClient
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core.NetStandard20/ImportFileOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Collections.Generic;
using System.Globalization;

namespace Microsoft.SemanticKernel.SemanticMemory.Core20;
namespace Microsoft.SemanticMemory.Core20;

public class ImportFileOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using System;

namespace Microsoft.SemanticKernel.SemanticMemory.Core20;
namespace Microsoft.SemanticMemory.Core20;

public class SemanticMemoryWebException : Exception
{
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/AppBuilders/AppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
using Microsoft.SemanticMemory.Core.Configuration;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders;
namespace Microsoft.SemanticMemory.Core.AppBuilders;

public static class AppBuilder
{
Expand Down
10 changes: 5 additions & 5 deletions lib/dotnet/Core/AppBuilders/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
using Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline.Queue;
using Microsoft.SemanticMemory.Core.Configuration;
using Microsoft.SemanticMemory.Core.ContentStorage;
using Microsoft.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticMemory.Core.Pipeline.Queue;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders;
namespace Microsoft.SemanticMemory.Core.AppBuilders;

#pragma warning disable CA1724 // The name conflicts with MSExtensions
public static class DependencyInjection
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/AppBuilders/HandlerAsAHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticMemory.Core.Pipeline;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders;
namespace Microsoft.SemanticMemory.Core.AppBuilders;

/// <summary>
/// Wrapper of handler classes, allowing to run handlers as services hosted by IHost
Expand Down
6 changes: 3 additions & 3 deletions lib/dotnet/Core/AppBuilders/HostedHandlersBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticMemory.Core.Configuration;
using Microsoft.SemanticMemory.Core.Pipeline;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders;
namespace Microsoft.SemanticMemory.Core.AppBuilders;

public static class HostedHandlersBuilder
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class AzureCognitiveSearchConfig
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/AzureOpenAIConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

/// <summary>
/// Azure OpenAI settings.
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/ConfigurationException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using System;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class ConfigurationException : Exception
{
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/Configuration/ContentStorageConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
using Microsoft.SemanticMemory.Core.ContentStorage;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class ContentStorageConfig
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/EmbeddingGenerationConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

/// <summary>
/// Configuration settings for the embedding generators
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/OpenAIConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

/// <summary>
/// OpenAI settings.
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/Configuration/OrchestrationConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline;
using Microsoft.SemanticMemory.Core.Pipeline;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class OrchestrationConfig
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/QdrantConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class QdrantConfig
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/SKMemoryConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class SKMemoryConfig
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/Configuration/VectorStorageConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.Configuration;
namespace Microsoft.SemanticMemory.Core.Configuration;

public class VectorStorageConfig
{
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/ContentStorage/AzureBlob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
using Azure.Storage.Blobs.Specialized;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.SemanticKernel.SemanticMemory.Core.Diagnostics;
using Microsoft.SemanticMemory.Core.Diagnostics;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
namespace Microsoft.SemanticMemory.Core.ContentStorage;

public class AzureBlob : IContentStorage
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/ContentStorage/AzureBlobConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
namespace Microsoft.SemanticMemory.Core.ContentStorage;

public class AzureBlobConfig
{
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/ContentStorage/FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.SemanticKernel.SemanticMemory.Core.Diagnostics;
using Microsoft.SemanticMemory.Core.Diagnostics;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
namespace Microsoft.SemanticMemory.Core.ContentStorage;

public class FileSystem : IContentStorage
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/ContentStorage/FileSystemConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
namespace Microsoft.SemanticMemory.Core.ContentStorage;

public class FileSystemConfig
{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotnet/Core/ContentStorage/IContentStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.SemanticKernel.SemanticMemory.Core.ContentStorage;
namespace Microsoft.SemanticMemory.Core.ContentStorage;

public interface IContentStorage
{
Expand Down
4 changes: 2 additions & 2 deletions lib/dotnet/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>Microsoft.SemanticKernel.SemanticMemory.Core</AssemblyName>
<RootNamespace>Microsoft.SemanticKernel.SemanticMemory.Core</RootNamespace>
<AssemblyName>Microsoft.SemanticMemory.Core</AssemblyName>
<RootNamespace>Microsoft.SemanticMemory.Core</RootNamespace>
<NoWarn>CA1711,CA1724,CA1308</NoWarn>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 6a8f4e9

Please sign in to comment.