Skip to content

Commit a7fe8e8

Browse files
authoredFeb 11, 2025
Python: Remove old references of plugin import (microsoft#10462)
### Motivation and Context We had two places in code that showed how to perform a plugin import using old code - `kernel.import_plugin...`. <!-- 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. --> ### Description Removes old old comments, replacing it with the current `kernel.add_plugin(...)`. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### 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 😄
1 parent 8f4efa5 commit a7fe8e8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
 

‎python/samples/concepts/filtering/auto_function_invoke_filters.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) Microsoft. All rights reserved.
22

33
import asyncio
4-
import os
54

65
from semantic_kernel import Kernel
76
from semantic_kernel.connectors.ai import FunctionChoiceBehavior
@@ -29,10 +28,7 @@
2928
# Note: the underlying gpt-35/gpt-4 model version needs to be at least version 0613 to support tools.
3029
kernel.add_service(OpenAIChatCompletion(service_id="chat"))
3130

32-
plugins_directory = os.path.join(__file__, "../../../../../prompt_template_samples/")
3331
# adding plugins to the kernel
34-
# the joke plugin in the FunPlugins is a semantic plugin and has the function calling disabled.
35-
# kernel.import_plugin_from_prompt_directory("chat", plugins_directory, "FunPlugin")
3632
# the math plugin is a core plugin and has the function calling enabled.
3733
kernel.add_plugin(MathPlugin(), plugin_name="math")
3834
kernel.add_plugin(TimePlugin(), plugin_name="time")

‎python/samples/getting_started/05-using-the-planner.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@
435435
" Description: EmailPlugin provides a set of functions to send emails.\n",
436436
"\n",
437437
" Usage:\n",
438-
" kernel.import_plugin_from_object(EmailPlugin(), plugin_name=\"email\")\n",
438+
" kernel.add_plugin(EmailPlugin(), plugin_name=\"email\")\n",
439439
"\n",
440440
" Examples:\n",
441441
" {{email.SendEmail}} => Sends an email with the provided subject and body.\n",
@@ -581,7 +581,7 @@
581581
"name": "python",
582582
"nbconvert_exporter": "python",
583583
"pygments_lexer": "ipython3",
584-
"version": "3.12.6"
584+
"version": "3.12.7"
585585
}
586586
},
587587
"nbformat": 4,

0 commit comments

Comments
 (0)
Please sign in to comment.