-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Python: allow settings to be created directly #11468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eavanvalkenburg
merged 9 commits into
microsoft:main
from
eavanvalkenburg:settings_wo_create
Apr 11, 2025
Merged
Python: allow settings to be created directly #11468
eavanvalkenburg
merged 9 commits into
microsoft:main
from
eavanvalkenburg:settings_wo_create
Apr 11, 2025
Conversation
This file contains hidden or 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
Python Unit Test Overview
|
TaoChenOSU
approved these changes
Apr 9, 2025
moonbox3
reviewed
Apr 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from "hating having to write .create()
" what is driving the need to make this change right now?
Will there be an item to track updating the learn site with the new pattern?
c785cdc
to
8a2be7c
Compare
moonbox3
approved these changes
Apr 10, 2025
8a2be7c
to
81a6dea
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 10, 2025
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> I've always hated having to add the .create to a settings object, this removes that, you can just use the regular init, added benefit is that it has the proper fields in the docstrings for each implemented settings object! ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Adds a __new__ method to the base settings class, which takes the prefix and if supplied the env_file and encoding, then calls model_rebuild and then the init. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
297148a
to
a2ae5fc
Compare
a2ae5fc
to
19c2c4c
Compare
TaoChenOSU
approved these changes
Apr 10, 2025
moonbox3
reviewed
Apr 11, 2025
python/tests/integration/memory/memory_stores/test_azure_cog_search_memory_store.py
Show resolved
Hide resolved
moonbox3
reviewed
Apr 11, 2025
python/tests/integration/memory/memory_stores/test_azure_cog_search_memory_store.py
Show resolved
Hide resolved
moonbox3
approved these changes
Apr 11, 2025
moonbox3
reviewed
Apr 11, 2025
python/tests/integration/memory/memory_stores/test_azure_cog_search_memory_store.py
Outdated
Show resolved
Hide resolved
870cfb3
to
7981a27
Compare
moonbox3
approved these changes
Apr 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
I've always hated having to add the .create to a settings object, this removes that, you can just use the regular init, added benefit is that it has the proper fields in the docstrings for each implemented settings object!
Description
Adds a new method to the base settings class, which takes the prefix and if supplied the env_file and encoding, then calls model_rebuild and then the init.
Contribution Checklist