Add settings retrieval through properties file and env vars#1176
Add settings retrieval through properties file and env vars#1176milderhc wants to merge 7 commits intomicrosoft:experimental-javafrom milderhc:settings
Conversation
|
At the the Java coding point of view, it may be useful for developers can read the properties file from some options like follows.
|
|
The second point is already supported using |
|
Added some changes to support multiple client configuration (description updated). |
java/semantickernel-api/src/main/java/com/microsoft/semantickernel/util/Settings.java
Outdated
Show resolved
Hide resolved
java/semantickernel-api/src/main/java/com/microsoft/semantickernel/util/Settings.java
Outdated
Show resolved
Hide resolved
java/semantickernel-api/src/main/java/com/microsoft/semantickernel/util/Settings.java
Outdated
Show resolved
Hide resolved
java/semantickernel-api/src/main/java/com/microsoft/semantickernel/util/Settings.java
Outdated
Show resolved
Hide resolved
|
@milderhc Can you rebase and see if we can land this PR? |
|
Dear @milderhc san Thank you so much for your hard work. I much appreciate. BTW, from the Developers Point of view, For Example: |
|
Thanks! I like that option, but I would prefer it for a specific Spring settings implementation, if something like that is added later. |
Motivation and Context
Add settings retrieval through properties file and env vars
Description
Adds util.Settings to load settings values from a properties file or from the environment.
Also, the ability to have different client settings in the properties file and load them by their specific schema Id:
By calling
Settings.getAzureOpenAISettingsFromFile(CONF_PROPERTIES)the user would be able to load the Azure settings using the default schema id, as shown in the block at the top.By calling
Settings.getAzureOpenAISettingsFromFile(CONF_PROPERTIES, "myazureopenai")the user would be able to load a different Azure configuration by just adding the second block to the properties file.Contribution Checklist
dotnet format