Skip to content

Python: Upgrade PromptTemplateEngine (bring back to parity w/ C# version) - #200

Merged
Devis Lucato (dluc) merged 37 commits into
microsoft:python-previewfrom
jjhenkel:python-preview
Apr 1, 2023
Merged

Devis Lucato (dluc) merged 37 commits into
microsoft:python-previewfrom
jjhenkel:python-preview

Conversation

@jjhenkel

Copy link
Copy Markdown

Motivation and Context

The C# Semantic Kernel has recently undergone an upgrade to its PromptTemplateEngine. This brings Python back in line with the semantics of Prompt Templates in C#.

Description

Here, unlike the original port, I've tried to make things more pythonic/idiomatic (instead of trying to directly mirror the C# codebase). I've also brought over the corresponding unit tests (and added some of my own as I was building/validating).

Contribution Checklist

Jordan Henkel and others added 30 commits March 24, 2023 09:07
Needed continue, not break. Add option to grab deployment name from .env
With a bit of refactoring, we can avoid duplicating too much code here;
to add an Azure* model variant, we just subclass the OpenAI* version
This is an attempt to add support for ChatGPT APIs in Python;
Trying to keep changes as minimal as possible here
Need to tie these new models into the rest of the kernel
(and one more utility func)
@jjhenkel

Copy link
Copy Markdown
Author

image

@dluc
Devis Lucato (dluc) self-requested a review March 29, 2023 01:59
@dluc Devis Lucato (dluc) self-assigned this Mar 29, 2023

@dluc Devis Lucato (dluc) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome work, I'll spend some time checking for parity and correctness, first glance looks good. I hope all those tests were useful with porting the parsing logic.

@dluc
Devis Lucato (dluc) merged commit 2ebc5ab into microsoft:python-preview Apr 1, 2023
Devis Lucato (dluc) pushed a commit that referenced this pull request Apr 12, 2023
…rsion) (#200)

### Motivation and Context

The C# Semantic Kernel has recently undergone an upgrade to its
`PromptTemplateEngine`. This brings Python back in line with the
semantics of Prompt Templates in C#.

### Description

Here, unlike the original port, I've tried to make things more
pythonic/idiomatic (instead of trying to directly mirror the C#
codebase). I've also brought over the corresponding unit tests (and
added some of my own as I was building/validating).
Devis Lucato (dluc) pushed a commit that referenced this pull request Apr 13, 2023
…rsion) (#200)

### Motivation and Context

The C# Semantic Kernel has recently undergone an upgrade to its
`PromptTemplateEngine`. This brings Python back in line with the
semantics of Prompt Templates in C#.

### Description

Here, unlike the original port, I've tried to make things more
pythonic/idiomatic (instead of trying to directly mirror the C#
codebase). I've also brought over the corresponding unit tests (and
added some of my own as I was building/validating).
Devis Lucato (dluc) pushed a commit that referenced this pull request Apr 13, 2023
…rsion) (#200)

### Motivation and Context

The C# Semantic Kernel has recently undergone an upgrade to its
`PromptTemplateEngine`. This brings Python back in line with the
semantics of Prompt Templates in C#.

### Description

Here, unlike the original port, I've tried to make things more
pythonic/idiomatic (instead of trying to directly mirror the C#
codebase). I've also brought over the corresponding unit tests (and
added some of my own as I was building/validating).
Desmond Howard (dehoward) pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
…rsion) (microsoft#200)

### Motivation and Context

The C# Semantic Kernel has recently undergone an upgrade to its
`PromptTemplateEngine`. This brings Python back in line with the
semantics of Prompt Templates in C#.

### Description

Here, unlike the original port, I've tried to make things more
pythonic/idiomatic (instead of trying to directly mirror the C#
codebase). I've also brought over the corresponding unit tests (and
added some of my own as I was building/validating).
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.

3 participants