Skip to content

Commit

Permalink
Merge pull request #1302 from solliancenet/skm-080-appconfig-fixes
Browse files Browse the repository at this point in the history
Semantic Kernel Completions Fixes
  • Loading branch information
ciprianjichici authored Jul 30, 2024
2 parents 2b7d6f2 + eeaa31f commit ca6560c
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"display_name": null,
"description": null,
"cost_center": null,
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpoints/AzureOpenAI",
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations/AzureOpenAI",
"version": "0.0",
"deployment_name": "completions",
"model_parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"display_name": null,
"description": null,
"cost_center": null,
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpoints/AzureOpenAI",
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations/AzureOpenAI",
"version": "0.0",
"deployment_name": "embeddings",
"model_parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"max_history": 5
},
"gatekeeper": {
"use_system_setting": false,
"use_system_setting": true,
"options": []
},
"orchestration_settings": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "api-endpoint",
"name": "AzureOpenAI",
"object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpoints/AzureOpenAI",
"object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations/AzureOpenAI",
"display_name": null,
"description": null,
"cost_center": null,
Expand All @@ -13,5 +13,6 @@
"url": "${env:AZURE_OPENAI_ENDPOINT}",
"url_exceptions": [],
"timeout_seconds": 60,
"retry_strategy_name": "ExponentialBackoff"
"retry_strategy_name": "ExponentialBackoff",
"provider": "microsoft"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"display_name": null,
"description": null,
"cost_center": null,
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpoints/AzureOpenAI",
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations/AzureOpenAI",
"version": "0.0",
"deployment_name": "completions",
"model_parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"display_name": null,
"description": null,
"cost_center": null,
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpoints/AzureOpenAI",
"endpoint_object_id": "/instances/${env:FOUNDATIONALLM_INSTANCE_ID}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations/AzureOpenAI",
"version": "0.0",
"deployment_name": "embeddings",
"model_parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"max_history": 5
},
"gatekeeper": {
"use_system_setting": false,
"use_system_setting": true,
"options": []
},
"orchestration_settings": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "api-endpoint",
"name": "AzureOpenAI",
"object_id": "/instances/{{instanceId}}/providers/FoundationaLLM.Configuration/apiEndpoints/AzureOpenAI",
"object_id": "/instances/{{instanceId}}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations/AzureOpenAI",
"display_name": null,
"description": null,
"cost_center": null,
Expand All @@ -13,5 +13,6 @@
"url": "{{openAiEndpointUri}}",
"url_exceptions": [],
"timeout_seconds": 60,
"retry_strategy_name": "ExponentialBackoff"
"retry_strategy_name": "ExponentialBackoff",
"provider": "microsoft"
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ public static partial class AppConfigurationKeyFilters
/// </summary>
public const string FoundationaLLM_APIEndpoints_AuthorizationAPI =
"FoundationaLLM:APIEndpoints:AuthorizationAPI:*";


/// <summary>
/// Filter for the key used to store the Azure Application Insights connection string.
/// </summary>
public const string FoundationaLLM_APIEndpoints_CoreAPI_AppInsightsConnectionString =
"FoundationaLLM:APIEndpoints:CoreAPI:AppInsightsConnectionString";

/// <summary>
/// Filter for the configuration section used to identify the main Core API settings.
/// </summary>
Expand All @@ -88,7 +94,13 @@ public static partial class AppConfigurationKeyFilters
/// </summary>
public const string FoundationaLLM_APIEndpoints_CoreAPI_Configuration_CosmosDB =
"FoundationaLLM:APIEndpoints:CoreAPI:Configuration:CosmosDB:*";


/// <summary>
/// Filter for the configuration section used to identify the system Gatekeeper options for Core API.
/// </summary>
public const string FoundationaLLM_APIEndpoints_CoreAPI_Configuration_BypassGatekeeper =
"FoundationaLLM:APIEndpoints:CoreAPI:Configuration:BypassGatekeeper";

/// <summary>
/// Filter for the configuration section used to identify the authentication settings for the Core Worker service.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public TextEmbeddingProfile? TextEmbeddingProfile
if (_textEmbeddingProfile != null)
return _textEmbeddingProfile;

EnsureIsValid();
Validate();

if (!_hasTextEmbeddingProfile)
return null;
Expand Down Expand Up @@ -332,7 +332,7 @@ public List<IndexingProfile>? IndexingProfiles
if (_indexingProfiles != null)
return _indexingProfiles;

EnsureIsValid();
Validate();

if (!_hasIndexingProfiles)
return null;
Expand Down
5 changes: 5 additions & 0 deletions src/dotnet/CoreAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,16 @@ public static void Main(string[] args)
options.Select(AppConfigurationKeyFilters.FoundationaLLM_Instance);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_Configuration);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_Branding);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints_AuthorizationAPI);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints_CoreAPI_Configuration_CosmosDB);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints_CoreAPI_Configuration_Entra);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints_CoreAPI_AppInsightsConnectionString);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints_CoreAPI_Configuration_BypassGatekeeper);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints_OrchestrationAPI);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_Agent_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_Attachment_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_AIModel_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_Configuration_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_Events_Profiles_CoreAPI);
}));
if (builder.Environment.IsDevelopment())
Expand Down
1 change: 1 addition & 0 deletions src/dotnet/OrchestrationAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static void Main(string[] args)
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_DataSource_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_Attachment_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_AIModel_Storage);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_Prompt_Storage);

options.Select(AppConfigurationKeyFilters.FoundationaLLM_Events_Profiles_OrchestrationAPI);
}));
Expand Down
1 change: 1 addition & 0 deletions src/dotnet/SemanticKernelAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static void Main(string[] args)
options.Select(AppConfigurationKeyFilters.FoundationaLLM_Configuration);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_APIEndpoints);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_Events_Profiles_VectorizationAPI);
options.Select(AppConfigurationKeyFilters.FoundationaLLM_ResourceProviders_Configuration_Storage);
}));
if (builder.Environment.IsDevelopment())
builder.Configuration.AddJsonFile("appsettings.development.json", true, true);
Expand Down

0 comments on commit ca6560c

Please sign in to comment.