Adding Python notebook for native function examples
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.
Contribution Checklist
- [ ] 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)
- [ ] 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
- [x] I didn't break anyone :smile:
@microsoft-github-policy-service agree
@carterwilliamson please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
@microsoft-github-policy-service agree [company="{your company}"]Options:
- (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
- (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"Contributor License Agreement
@microsoft-github-policy-service agree
Thank you so much for creating this! I was just putting on our backlog the need to have better docs/notebooks for this. I'll review!
Happy to help out! This project is fascinating, I'm excited to be able to contribute.
Love it ❤️
Thank you. Yes, I'm preparing a hackathon and I was spending a lot of time figuring out how to implement native functions. Thanks for the notebook
@carterwilliamson After talking with the team, could we actually simplify the notebook to just be completely inline?
So we can remove the parts about opening an external script and writing code that you would execute inside a main function. Instead, just directly call those functions inside Jupyter! Basically, we want people to be able to do everything they need to do directly in the notebook and not have to bring up some external editor.
Let me know if that makes sense! We love the notebook and definitely want to bring this in!
@carterwilliamson After talking with the team, could we actually simplify the notebook to just be completely inline?
So we can remove the parts about opening an external script and writing code that you would execute inside a main function. Instead, just directly call those functions inside Jupyter! Basically, we want people to be able to do everything they need to do directly in the notebook and not have to bring up some external editor.
Let me know if that makes sense! We love the notebook and definitely want to bring this in!
@carterwilliamson Let me know if you're able to make the changes! Otherwise, I'd be happy to push to this branch with the updates!
@carterwilliamson Made changes directly to this PR. Kept your examples. Just cleaned up the wording and made it more inline.
@alexchaomander apologies, I went on vacation and didn't have access to github. Looks like this got completed. Any remaining updates you or the team would like to see here?
@carterwilliamson Nope! Thank you so much for this PR! Looking forward to your next one :)