Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ee40c30
Refactoring configuration
adrianwyatt Apr 21, 2023
d736a88
Refactoring configuration
adrianwyatt Apr 21, 2023
0b9dd6b
Rename SK Chatbot to Copilot
adrianwyatt Apr 21, 2023
2f88e28
Refactoring configuration
adrianwyatt Apr 21, 2023
541861e
Refactoring configuration
adrianwyatt Apr 21, 2023
84f4257
Merge remote-tracking branch 'origin/main' into options
adrianwyatt Apr 21, 2023
4296818
Fix build break
adrianwyatt Apr 21, 2023
d80788b
Fix markdown link to importdocument readme
adrianwyatt Apr 21, 2023
d0e213f
Merge branch 'main' into options
dluc Apr 22, 2023
d9c95ba
Update samples/apps/copilot-chat-app/webapi/Config/AuthorizationOptio…
adrianwyatt Apr 22, 2023
7c2ec61
Update samples/apps/copilot-chat-app/webapi/Config/AzureSpeechOptions.cs
adrianwyatt Apr 22, 2023
a2789f0
Minor changes from PR feedback
adrianwyatt Apr 22, 2023
4e6956d
Merge branch 'options' of https://github.com/adrianwyatt/semantic-ker…
adrianwyatt Apr 22, 2023
cdcb39f
Merge remote-tracking branch 'origin/main' into options
adrianwyatt Apr 22, 2023
2c6a9e8
Updated pattern for configuration validation.
adrianwyatt Apr 23, 2023
6facae4
dotnet format
adrianwyatt Apr 23, 2023
a7c4054
Merge branch 'main' into options
adrianwyatt Apr 23, 2023
2504df4
Remove warning from launchsettings URL override
adrianwyatt Apr 23, 2023
5da4ddd
Merge branch 'main' into options
adrianwyatt Apr 24, 2023
064abe2
dotnet format
adrianwyatt Apr 24, 2023
59a60e3
Merge branch 'main' into options
adrianwyatt Apr 24, 2023
88f9dcf
Merge branch 'options' of https://github.com/adrianwyatt/semantic-ker…
adrianwyatt Apr 24, 2023
77c2079
Merge branch 'main' into options
adrianwyatt Apr 24, 2023
2cf5516
Merge remote-tracking branch 'origin/main' into options
adrianwyatt Apr 24, 2023
1abf58a
Update samples/apps/copilot-chat-app/webapi/Config/ChatStoreOptions.cs
adrianwyatt Apr 24, 2023
017793e
Update samples/apps/copilot-chat-app/webapi/Config/ChatStoreOptions.cs
adrianwyatt Apr 24, 2023
28b04c4
Minor updates from pr comments
adrianwyatt Apr 24, 2023
6217c18
Merge branch 'options' of https://github.com/adrianwyatt/semantic-ker…
adrianwyatt Apr 24, 2023
b54e3cf
Merge branch 'main' into options
adrianwyatt Apr 24, 2023
1c24cdd
Merge remote-tracking branch 'origin/main' into options
adrianwyatt Apr 24, 2023
02c579c
build break
adrianwyatt Apr 24, 2023
234e4c1
Merge remote-tracking branch 'origin/main' into options
adrianwyatt Apr 24, 2023
fe7214d
Updates from PR comments
adrianwyatt Apr 25, 2023
5880d2e
Merge branch 'main' into options
adrianwyatt Apr 25, 2023
4cce6a8
Updates from PR comments
adrianwyatt Apr 25, 2023
f49147e
Fixes from merge
adrianwyatt Apr 25, 2023
a315c12
Merge branch 'main' into options
adrianwyatt Apr 25, 2023
6bb6c30
dotnet format
adrianwyatt Apr 25, 2023
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
2 changes: 1 addition & 1 deletion samples/apps/copilot-chat-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ the complete list of current models supporting chat completions.

## Additional resources

1. [Import Document Application](./importdocument/README.md): Ingest a document to memory.
1. [Import Document Application](./importdocument/README.md): Import a document to the memory store.
45 changes: 0 additions & 45 deletions samples/apps/copilot-chat-app/webapi/Config/AIServiceConfig.cs

This file was deleted.

53 changes: 53 additions & 0 deletions samples/apps/copilot-chat-app/webapi/Config/AIServiceOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Microsoft. All rights reserved.

using System.ComponentModel.DataAnnotations;

namespace SemanticKernel.Service.Config;

/// <summary>
/// Configuration options for AI services, such as Azure OpenAI and OpenAI.
/// </summary>
public sealed class AIServiceOptions
{
public const string CompletionPropertyName = "Completion";
public const string EmbeddingPropertyName = "Embedding";

public enum AIServiceType
Comment thread
adrianwyatt marked this conversation as resolved.
{
AzureOpenAI,
OpenAI
}

/// <summary>
/// Label used for referencing the AI service in Semantic Kernel.
/// </summary>
[Required, NotEmptyOrWhitespace]
public string Label { get; set; } = string.Empty;

/// <summary>
/// Type of AI service.
/// </summary>
[Required]
public AIServiceType AIService { get; set; } = AIServiceType.AzureOpenAI;

/// <summary>
/// Azure OpenAI deployment name or OpenAI model name.
/// </summary>
[Required, NotEmptyOrWhitespace]
public string DeploymentOrModelId { get; set; } = string.Empty;

/// <summary>
/// (Azure OpenAI only) Azure OpenAI endpoint.
/// </summary>
[RequiredOnPropertyValue(nameof(AIService), AIServiceType.AzureOpenAI)]
[NotEmptyOrWhitespace]
public string Endpoint { get; set; } = string.Empty;

/// <summary>
/// Key to access the AI service.
/// </summary>
[Required, NotEmptyOrWhitespace]
public string Key { get; set; } = string.Empty;

// TODO support OpenAI's orgID
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) Microsoft. All rights reserved.

using System.ComponentModel.DataAnnotations;
using Microsoft.Identity.Web;

namespace SemanticKernel.Service.Config;

/// <summary>
/// Configuration options for authorizing to the service.
/// </summary>
public class AuthorizationOptions
{
public const string PropertyName = "Authorization";

public enum AuthorizationType
{
None,
ApiKey,
AzureAd
}

/// <summary>
/// Type of authorization.
/// </summary>
public AuthorizationType Type { get; set; } = AuthorizationType.None;

/// <summary>
/// When <see cref="Type"/> is <see cref="AuthorizationType.ApiKey"/>, this is the API key to use.
/// </summary>
[Required, NotEmptyOrWhitespace]
public string ApiKey { get; set; } = string.Empty;

/// <summary>
/// When <see cref="Type"/> is <see cref="AuthorizationType.AzureAd"/>, these are the Azure AD options to use.
/// </summary>
[RequiredOnPropertyValue(nameof(Type), AuthorizationType.AzureAd)]
public AzureAdOptions? AzureAd { get; set; }

/// <summary>
/// Configuration options for Azure Active Directory (AAD) authorization.
/// </summary>
public class AzureAdOptions
{
/// <summary>
/// AAD instance url, i.e., https://login.microsoftonline.com/
/// </summary>
[Required, NotEmptyOrWhitespace]
public string Instance { get; set; } = string.Empty;

/// <summary>
/// Tenant (directory) ID
/// </summary>
[Required, NotEmptyOrWhitespace]
public string TenantId { get; set; } = string.Empty;

/// <summary>
/// Application (client) ID
/// </summary>
[Required, NotEmptyOrWhitespace]
public string ClientId { get; set; } = string.Empty;

/// <summary>
/// Required scopes.
/// </summary>
[Required]
public string? Scopes { get; set; } = string.Empty;
}
}
20 changes: 0 additions & 20 deletions samples/apps/copilot-chat-app/webapi/Config/AzureSpeechConfig.cs

This file was deleted.

25 changes: 25 additions & 0 deletions samples/apps/copilot-chat-app/webapi/Config/AzureSpeechOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft. All rights reserved.

using System.ComponentModel.DataAnnotations;

namespace SemanticKernel.Service.Config;

/// <summary>
/// Configuration options for Azure speech recognition.
/// </summary>
public sealed class AzureSpeechOptions
{
public const string PropertyName = "AzureSpeech";

/// <summary>
/// Location of the Azure speech service to use (e.g. "South Central US")
/// </summary>
[Required, NotEmptyOrWhitespace]
public string? Region { get; set; } = string.Empty;

/// <summary>
/// Key to access the Azure speech service.
/// </summary>
[Required, NotEmptyOrWhitespace]
public string Key { get; set; } = string.Empty;
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
// Copyright (c) Microsoft. All rights reserved.

using System.ComponentModel.DataAnnotations;

namespace SemanticKernel.Service.Config;

/// <summary>
/// Configuration settings for the bot file schema that is supported by this application.
/// Configuration options for the bot file schema that is supported by this application.
/// </summary>
public class BotSchemaConfig
public class BotSchemaOptions
{
public const string PropertyName = "BotSchema";

/// <summary>
/// The name of the schema.
/// </summary>
[Required, NotEmptyOrWhitespace]
public string Name { get; set; } = string.Empty;

/// <summary>
/// The version of the schema.
/// </summary>
public int Version { get; set; } = -1;
[Range(0, int.MaxValue)]
public int Version { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// Copyright (c) Microsoft. All rights reserved.

using static SemanticKernel.Service.Config.AuthorizationOptions;

namespace SemanticKernel.Service.Config;

/// <summary>
/// Configuration settings for the chat store.
/// </summary>
public class ChatStoreConfig
public class ChatStoreOptions
{
public const string PropertyName = "ChatStore";

/// <summary>
/// The type of chat store to use.
/// </summary>
Expand Down Expand Up @@ -36,10 +40,12 @@ public enum ChatStoreType
/// <summary>
/// Gets or sets the configuration for the file system chat store.
/// </summary>
public FileSystemConfig? Filesystem { get; set; }
[RequiredOnPropertyValue(nameof(Type), ChatStoreType.Filesystem)]
public FileSystemOptions? Filesystem { get; set; }

/// <summary>
/// Gets or sets the configuration for the Azure CosmosDB chat store.
/// </summary>
public CosmosConfig? Cosmos { get; set; }
[RequiredOnPropertyValue(nameof(Type), ChatStoreType.Cosmos)]
public CosmosOptions? Cosmos { get; set; }
}
Loading