Files
semantic-kernel/samples/plugins/CodingPlugin
Mark WallaceandDmytro Struk a7566b6654 .Net: Add Models collection to PromptTemplateConfig Update PromptTemplateConfig to support multiple AI models (#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]>
2023-10-03 17:38:52 +00:00
..