Skip to content

Python: Refactoring. Use get_function and get_plugin.#6382

Merged
eavanvalkenburg merged 4 commits intomicrosoft:mainfrom
stefan521:stefan-refactor-25-05-23
May 24, 2024
Merged

Python: Refactoring. Use get_function and get_plugin.#6382
eavanvalkenburg merged 4 commits intomicrosoft:mainfrom
stefan521:stefan-refactor-25-05-23

Conversation

@stefan521
Copy link
Contributor

Motivation and Context

Refactoring some of the code following this advice from the maintainers.

Description

Look up kernel functions and plugins with the get_function and get_plugin method. Removed the unused DEFAULT_CHAT_SYSTEM_PROMPT

Contribution Checklist

@stefan521 stefan521 requested a review from a team as a code owner May 23, 2024 19:39
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label May 23, 2024
@github-actions github-actions bot changed the title Refactoring. Use get_function and get_plugin. Python: Refactoring. Use get_function and get_plugin. May 23, 2024
@stefan521
Copy link
Contributor Author

stefan521 commented May 23, 2024 via email

@stefan521
Copy link
Contributor Author

stefan521 commented May 23, 2024 via email

@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented May 23, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL607887086% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1374 1 💤 0 ❌ 0 🔥 13.682s ⏱️

Copy link
Collaborator

@moonbox3 moonbox3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. My small nit is to use named args to make it more clear when reading:

function = kernel.get_function(plugin_name=<name>, function_name=<name>)

May just be my style preference. :)

@stefan521
Copy link
Contributor Author

LGTM. My small nit is to use named args to make it more clear when reading:

function = kernel.get_function(plugin_name=<name>, function_name=<name>)

May just be my style preference. :)

That's a good shout. I've named them.

@moonbox3 moonbox3 requested a review from eavanvalkenburg May 23, 2024 21:37
@moonbox3
Copy link
Collaborator

@stefan521 please run a Black format in the python directory to fix the lint issues.

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue May 24, 2024
Merged via the queue into microsoft:main with commit a9d7d5d May 24, 2024
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
### 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.
-->

Refactoring some of the code following [this
advice](microsoft#6371 (comment))
from the maintainers.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Look up kernel functions and plugins with the `get_function` and
`get_plugin` method. Removed the unused `DEFAULT_CHAT_SYSTEM_PROMPT`

### 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 😄

---------

Co-authored-by: Evan Mattson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants