Skip to content

.Net: Add Models collection to PromptTemplateConfig Update PromptTemplateConfig to support multiple AI models#2993

Merged
markwallace-microsoft merged 17 commits into
microsoft:mainfrom
markwallace-microsoft:users/markwallace/promptremplateconfig_models
Oct 3, 2023
Merged

.Net: Add Models collection to PromptTemplateConfig Update PromptTemplateConfig to support multiple AI models#2993
markwallace-microsoft merged 17 commits into
microsoft:mainfrom
markwallace-microsoft:users/markwallace/promptremplateconfig_models

Conversation

@markwallace-microsoft

@markwallace-microsoft markwallace-microsoft commented Sep 26, 2023

Copy link
Copy Markdown
Contributor

Contribution Checklist

Summary

This pull request updates PromptTemplateConfig to support multiple AI models, providing greater flexibility in configuring AI services for semantic functions. The Completion property has been removed and replaced with a Models collection that contains AIRequestSettings objects. The SetAIConfiguration and SetAIService methods in SemanticFunction have been updated to use the first AIRequestSettings object in the Models list. SKFunctionTests1 and KernelTests have also been updated to use the Models property of PromptTemplateConfig and to reflect these changes.

Changes

  • Added PromptTemplateConfigExtensions.cs file
  • Modified StepwisePlanner.cs file
  • Modified AIRequestSettings.cs file
  • Modified PromptTemplateConfig.cs file
  • Added unit tests to ensure proper deserialization of PromptTemplateConfig with multiple models
  • Updated SKFunctionTests1 to use Models property of PromptTemplateConfig
  • Updated KernelTests to use Models property of PromptTemplateConfig and add OpenAIRequestSettings object to Models list instead of setting it directly to Completion property
  • Updated test cases to reflect changes

Powered by Microsoft Semantic Kernel

@markwallace-microsoft markwallace-microsoft requested a review from a team as a code owner September 26, 2023 16:38
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Sep 26, 2023
@github-actions github-actions Bot changed the title Add Models collection to PromptTemplateConfig .Net: Add Models collection to PromptTemplateConfig Sep 26, 2023
@markwallace-microsoft

Copy link
Copy Markdown
Contributor Author

/sk generate-pr-description

@github-actions github-actions Bot changed the title .Net: Add Models collection to PromptTemplateConfig .Net: Add Models collection to PromptTemplateConfig Update PromptTemplateConfig to support multiple AI models Sep 26, 2023
@github-actions

Copy link
Copy Markdown
Contributor

Generate PR Description: succeeded ✅
https://github.com/microsoft/semantic-kernel/actions/runs/6315765190

@rogerbarreto rogerbarreto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggestions

Comment thread dotnet/src/Planners/Planners.Core/Extensions/PromptTemplateConfigExtensions.cs Outdated
Comment thread dotnet/src/Planners/Planners.Core/Extensions/PromptTemplateConfigExtensions.cs Outdated
Comment thread dotnet/src/SemanticKernel.Core/Functions/SemanticFunction.cs Outdated
Comment thread dotnet/src/SemanticKernel.Core/Kernel.cs Outdated
Comment thread dotnet/src/SemanticKernel.UnitTests/KernelTests.cs Outdated
Comment thread dotnet/src/SemanticKernel.Abstractions/SemanticFunctions/PromptTemplateConfig.cs Outdated
@markwallace-microsoft markwallace-microsoft force-pushed the users/markwallace/promptremplateconfig_models branch from 0f8ae26 to 91ab5c6 Compare September 27, 2023 16:48

@dmytrostruk dmytrostruk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left small renaming comments, in general looks good to me!

Comment thread dotnet/src/Functions/Functions.Semantic/SemanticFunctions/PromptTemplateConfig.cs Outdated
Comment thread dotnet/src/Functions/Functions.Semantic/SemanticFunctions/PromptTemplateConfig.cs Outdated
Comment thread dotnet/src/Planners/Planners.Core/Extensions/PromptTemplateConfigExtensions.cs Outdated
@markwallace-microsoft markwallace-microsoft added the PR: breaking change Pull requests that introduce breaking changes label Oct 3, 2023
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Oct 3, 2023
Merged via the queue into microsoft:main with commit a7566b6 Oct 3, 2023
@markwallace-microsoft markwallace-microsoft deleted the users/markwallace/promptremplateconfig_models branch October 3, 2023 17:45
SOE-YoungS pushed a commit to SOE-YoungS/semantic-kernel that referenced this pull request Nov 1, 2023
…lateConfig to support multiple AI models (microsoft#2993)

### Contribution Checklist

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

## Summary
This pull request updates PromptTemplateConfig to support multiple AI
models, providing greater flexibility in configuring AI services for
semantic functions. The Completion property has been removed and
replaced with a Models collection that contains AIRequestSettings
objects. The SetAIConfiguration and SetAIService methods in
SemanticFunction have been updated to use the first AIRequestSettings
object in the Models list. SKFunctionTests1 and KernelTests have also
been updated to use the Models property of PromptTemplateConfig and to
reflect these changes.

## Changes
- Added PromptTemplateConfigExtensions.cs file
- Modified StepwisePlanner.cs file
- Modified AIRequestSettings.cs file
- Modified PromptTemplateConfig.cs file
- Added unit tests to ensure proper deserialization of
PromptTemplateConfig with multiple models
- Updated SKFunctionTests1 to use Models property of
PromptTemplateConfig
- Updated KernelTests to use Models property of PromptTemplateConfig and
add OpenAIRequestSettings object to Models list instead of setting it
directly to Completion property
- Updated test cases to reflect changes

---
*Powered by [Microsoft Semantic
Kernel](https://github.com/microsoft/semantic-kernel)*

---------

Co-authored-by: Dmytro Struk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: breaking change Pull requests that introduce breaking changes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants