### Motivation and Context
The python notebooks are pinned to 0.2.7.dev0 while the latest pip
package for python is 0.3.1.dev0. This PR updates the notebooks to pull
the 0.3.1.dev0 and adds 2 new notebooks demonstrating new features added
to SK between these versions.
### Description
- All notebooks depend on semantic-kernel==0.3.1.dev0
- Added a notebook demonstrating streaming completion responses
- Added a notebook demonstrating multiple responses per prompt
(including streaming them)
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
---------
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Shawn Callegari <[email protected]>
### 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.
-->
### Description
I have added a new notebook to show how to bring search functionality in
SK
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
---------
Co-authored-by: newton.mallick <[email protected]>
Co-authored-by: Gina Triolo <[email protected]>
### Motivation and Context
This introduces functions related to groundedness checking, based on
learnings from the Aether Central team. The skills are showcased in both
an Python notebook and a .NET sample.
---------
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
### Motivation and Context
This is addressing issue#1455
https://github.com/microsoft/semantic-kernel/issues/1455
### Description
In the second cell, I added the missing reference to Azure Text
Completion.
In the _Context Variables_ section, I updated the first cell to include
an option to run using Azure OpenAI (was missed previously). This
follows the same format as used in other cells.
### Motivation and Context
When working through the notebooks, I had the feeling that printing the
chat history at the end, makes it much clearer how it actually looks
like after a bunch of chats. I would like to see this added for
everyone.
### Description
Printing the chat history in the Notebooks at the end of the _Planner_
section
### Motivation and Context
1. Why is this change required?
To show users how to use the WeaviateMemoryStore memory store
2. What problem does it solve?
Users don't know how to config and use the WeaviateMemoryStore memory
store
3. What scenario does it contribute to?
Users want to learn how to config and use the WeaviateMemoryStore memory
store
4. If it fixes an open issue, please link to the issue here.
NA
### Description
Add a notebook to show users how to config and use the
WeaviateMemoryStore memory store in a few examples.
---------
Co-authored-by: Dan Dascalescu <[email protected]>
### Motivation and Context
Many people run into the issue of wanting to use ChatCompletion models
like gpt-35-turbo or gpt4 for building Semantic Skills but aren't aware
that they need to update the API to do so. This adds some examples in
the Jupyter notebooks to illustrate the concept.
### Motivation and Context
Other Semantic Kernal samples allow using both OpenAI and Azure OpenAI
by setting a different set of environment variables and toggling the
`useAzureOpenAI` bool value
### Description
Add the same snippet used in other notebooks such as
`02-running-prompts-from-file` to use Azure OpenAI to the
`08-native-function-inline`
### Motivation and Context
This PR is intended to give some functioning examples to help users get
started with python native functions.
Currently, there are no examples or very limited examples. When I was
playing around with this tool I ended up using some of the integration
tests as examples to help get started. Hopefully, this will help the
next user with the lessons learned.
### Description
This adds a jupyter notebook that walks users through using native
functions alongside semantic functions to build a simple story writing
app. This notebook also shows how to use ContextVariables and run a
semantic function from within a native function.
Co-authored-by: Carter Williamson <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Alex Chao <[email protected]>
### Motivation and Context
* Removing the requirements.txt and just pinning each notebook to a pip
package that should work.
Doing this allows users to run notebooks without error even if the code
in the core repo updates.
When a new pip package is released, we will bump the version number in
each notebook.
* Fix usage of context variables. Apps should avoid using anonymous
context variables and prefer using the context, to retain access to the
kernel internals during the orchestration.
---------
Co-authored-by: Alex Chao <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
### Motivation and Context
KernelConfig isn't needed as it's less pythonic and is not used
independently from Kernel. This moves all its methods and members into
Kernel.
### Description
- Removed KernelConfig
- Put KernelConfig's methods and variables into Kernel
- Ran unit and end-to-end tests
- Did not run notebooks because they are out of date with the current
repo.
---------
Co-authored-by: Shawn Callegari <[email protected]>
### Motivation and Context
The release of Python SK from 0.2.4 -> 0.2.6 significantly increased the
size of the pip package. The dependencies causing this are not core to
the kernel, so this PR establishes a pattern for SK connector
dependencies (ex: Hugging Face, memory storage)
### Description
- Added a poetry group called hugging_face - this is the same name as
the connectors namespace in the code.
- Added dependency installs to the Hugging Face sample notebook.
- removed Hugging Face dependencies from requirements.txt.
- Added import errors for torch, transformers, and sentence-transformers
in the hugging_face connector classes.
- Added command `--with hugging_face` to integration test setup.
### Motivation and Context
Many users and customers have expressed interest in having planning
capabilities in Python. This PR seeks to provide a basic version of the
planner so that people can learn and play around with the concepts and
can be comfortable with implementing their own versions.
A Jupyter notebook is included.
### Description
Most of the logic of the plan can be found under the `PROMPT` in
`basic_planner.py`.
There is a known limitation that this currently doesn't explicit parse
out arguments that are defined in the semantic function prompts, so when
creating the [AVAILABLE FUNCTIONS] string, it just uses the name of the
function and the description.
The execution of the plan also happens from start to finish. There is
currently no support for piecewise execution.
---------
Co-authored-by: Alex Chao <[email protected]>
Co-authored-by: Alex Chao <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Mark Karle <[email protected]>
### Motivation and Context
This PR adds a notebook to the python samples demonstrating how to use
SK with hugging face models.
### Description
- add notebook 07-hugging-face-for-skills.ipynb
### Motivation and Context
New release version 0.2.6
Fix bug in 0.2.5.dev0 pip package
Update notebooks to the latest pip package (0.2.6)
### Description of Changes
- fixed a param name error in the creation of a reference memory_record
- renamed text_service -> text_completion_service (consistency with .NET)
- renamed text_embedding_service -> text_embedding_generation_service
(consistency with .NET)
- Updated notebooks accordingly
- bumped pip versions to 0.2.6.dev0
### Motivation and Context
New Python API changes the signature for invoke_async.
This aligns it and makes it clearer that the context passed into
invoke_async are context variables.
This fixes the current issue where the chat function will just repeat
back the user input instead of actually chatting
---------
Co-authored-by: Abby Harrison <[email protected]>
### Motivation and Context
1. Why is this change required? **Although it does not affect the main
logic, it is still recommended to make corrections.**
2. What problem does it solve? **use i += 1 instead of ++i, because
Python didn't support ++i**
### Motivation and Context
This PR is a consistency update between the Python and .NET Semantic
Kernels.
**This PR does not contain any feature enhancements or improvements!**
### Description
- Replace terminology 'backend' with 'service'
- Move semantic_kernel.ai (semantic_kernel/ai) to
semantic_kernel.connectors.ai (semantic_kernel/connectors/ai)
### Motivation and Context
It is confusing to have multiple skfunction invoke_* calls. This PR
combines invoke and invoke_with_vars to enable calls with the input
pattern: with SKContext, or with SKContextVariables.
### Description
- Removed `sk_function` methods `invoke_with_vars` and
`invoke_with_vars_async`
- Added the following optional paramters to `sk_function` methods
`invoke_` and `invoke_async`: `variables` and `memory`
- Added log warnings for when an both SKContext and variables/memory are
passed to `invoke` methods - this design ensures that the SDContext and
it's associated variables and memory are prioritized
- Updated tests and notebooks where applicable
### Motivation and Context
To make the Python SK more pythonic, combined all kernel.run_* methods
into a single method with optional parameters.
### Description
- Removed `kernel.run_on_vars_async()`
- Removed `kernel.run_on_str_async()`
- Added `SKContext`, `ContextVariables`, and string params to
`kernel.run_async()`
- Moved `run_on_vars_async()` logic to `run_async()` method
- Arranged method params so that required params come before optional
params.
- Updated tests and notebooks where applicable.
### Motivation and Context
This PR makes creating a kernel instance more pythonic. The builder
pattern is removed and the kernel is constructed using Kernel(...).
Work originally started with #137
### Description
- Removed kernel_builder.py.
- Instance creation pattern `kernel = sk.create_kernel() -> kernel =
sk.Kernel()`
- For notebook 6, there is no need to create a separate kernel for the
GitHub files. Changed to use a separate collection.
Co-authored-by: Devis Lucato <[email protected]>
* Add python getting started notebook
* Fix notebooks usage of Azure text completion
* Fix bug with skills definition
* Update READMEs
* New release version 0.2.2
READMEs and examples are out of date and showing incorrect code. There
are also a few bugs in the SKFunction blocking simpler syntax.
Extend SKFunction to allow synchronous calls and have simpler syntax
when async is not required.
* Update homepage README, moving all Python examples under python/README
* Make SKFunction callable as per v0
* Fix bugs in SKFunction
* Fix examples using realistic code
* Allow to use functions synchronously
### Motivation and Context
The `python-preview` branch is under active development and many
docs/tests/examples are getting a bit out of sync. There are also a few
small cleanup chores/refactors to make _usage_ easier (e.g., to make
examples cleaner). I've grouped these small fixes (plus a few bug fixes)
into this "cleanup" PR.
### Description
This PR does the following:
1. Updates the out-of-date example in `README.md`
2. Fixes all 5 of the notebooks we support right now (1,2,3,4, and 6;
notebook 5 is planner, I've blanked out most of the code there so we
don't confuse people, especially as the planner API is changing)
3. Fixes a bug w/ `stop_sequences` in `(Azure)OpenAITextCompletion`
4. Fixes a bug introduced in our upgrades to the embeddings cosine-sim
check (we should add more thorough tests here)
5. Cleans up tests
6. Ensures end-to-end tests are all runnable
7. Fixes up the `kernel_extensions` to work more naturally (so that end
users can use them directly on the `kernel` object and get good
type-hinting)
### Motivation and Context
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
`SemanticTextMemory.save_reference_async` do nothing for its storage.
2. What problem does it solve? `save_reference_async` will work
appropriately
3. What scenario does it contribute to? embeddings
4. If it fixes an open issue, please link to the issue here.
https://github.com/microsoft/semantic-kernel/issues/165
### Description
I add missing codes with references of
`SemanticTextMemory.save_information_async` and C# version of
`SemanticTextMemory.save_reference_async`