Skip to content
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

Experimental python updates: memory, embeddings, native functions, chat w/ memory #37

Merged
merged 5 commits into from
Mar 8, 2023
Merged

Conversation

jjhenkel
Copy link
Contributor

@jjhenkel jjhenkel commented Mar 8, 2023

Motivation and Context

In an effort to port more of the original code over to Python, this PR adds the following:

  1. Lots of little fixes to the code (as I've read through, double-checked, and ran some more examples)
  2. The addition of our first core_skill in Python --- TextMemorySkill (inferring the delegate type is tricky here without C#'s nice reflection capabilities... probably need some way to "error" if a Skill's functions aren't fully type-annotated as that's how I figured out the right delegate type)
  3. The addition of decorators to mark up a native function (similar to the attributes in the C# version)
  4. A minimal working memory subsystem (the C# code was hard to trace, especially given that I needed to reconcile custom embeddings-code and our numpy-based impl, probably bugs to work out there)
  5. An end-to-end example of chatting w/ memory!

image

Description

At this point, I'd say we have maybe ~60/70% of the core (as it exists right now on the main branch) functionality in Python. We can define semantic functions, template prompts (that have Var/Code blocks), define native functions, work with memory/embeddings, etc. We're missing a lot of tests and things like chunking text. We're also missing everything related to the planner.

There's now some low-hanging fruit here to address for the port:

  1. We should start figuring out tests and moving many tests over
  2. We should add AzureOpenAI support (mostly just a dupe of openai support, will use the same calls to the openai package and everything, just needs to override certain params)
  3. We should add in the rest of the missing core skills
  4. We should look at loading skills from directories (haven't tried this yet, probably missing some basic things here)
  5. We should port more examples! (I have a "basic" one, a "chat" one, and now a "chat with memory")

Contribution Checklist

N/A for now, just trying to get all of the code ported.

Copy link
Contributor

@alexchaomander alexchaomander left a comment

Choose a reason for hiding this comment

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

Overall LGTM. I think it'd be great to get this into the experimental branch so that we have a fuller picture of the Python Semantic Kernel with embeddings and memory.

@dluc dluc merged commit 0586865 into microsoft:experimental-python Mar 8, 2023
Bryan-Roe added a commit to BMR-Cloud-Dev/semantic that referenced this pull request Jun 28, 2024
…t/DocumentFormat.OpenXml-3.0.2

Bump DocumentFormat.OpenXml from 3.0.1 to 3.0.2 in /dotnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants