-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65f8502
commit 4fd40d7
Showing
25 changed files
with
528 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
296 changes: 296 additions & 0 deletions
296
src/dotnet/Common/Constants/Configuration/AppConfigurationKeyFilters.cs
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/dotnet/Common/Constants/Configuration/AppConfigurationKeyFilters.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<#@ template debug="false" hostspecific="true" language="C#" #> | ||
<#@ assembly name="System.Core" #> | ||
<#@ import namespace="System.IO" #> | ||
<#@ assembly name="System.Text.Json" #> | ||
<#@ import namespace="System.Collections.Generic" #> | ||
<#@ assembly name="System.Memory" #> | ||
<#@ import namespace="System.Text.Json" #> | ||
<#@ import namespace="System.Text.Json.Nodes" #> | ||
<#@ output extension=".cs" #> | ||
<# | ||
string inputFileName = this.Host.ResolvePath($"../Data/AppConfiguration.json"); | ||
string inputContent = File.ReadAllText(inputFileName); | ||
var jsonObjects = JsonNode.Parse(inputContent)!; | ||
Func<JsonNode, string> getName = n => n.GetValue<string>().Replace(":", "_"); | ||
#> | ||
namespace FoundationaLLM.Common.Constants.Configuration | ||
{ | ||
/// <summary> | ||
/// Defines all configuration section filters used to select subsets of configuration settings. | ||
/// </summary> | ||
public static partial class AppConfigurationKeyFilters | ||
{<# | ||
foreach (var jsonObject in jsonObjects.AsArray()) | ||
{ | ||
var configurationSection = jsonObject["configuration_section"]; | ||
if (configurationSection != null) | ||
{ | ||
var description = configurationSection["description"].GetValue<string>(); | ||
description = "Filter for the " | ||
+ Char.ToLowerInvariant(description[0]) + description.Substring(1); | ||
#> | ||
|
||
/// <summary> | ||
/// <#=description#> | ||
/// </summary> | ||
public const string FoundationaLLM_<#=getName(jsonObject["namespace"])#> = | ||
"FoundationaLLM:<#=jsonObject["namespace"]#>:*"; | ||
<# | ||
} | ||
} | ||
#> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 0 additions & 146 deletions
146
src/dotnet/Common/Constants/Configuration/AppConfigurationKeysOld.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
src/dotnet/Common/Constants/Configuration/DependencyInjectionKeysOld.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.