### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
### Motivation and Context
Closes#5881
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
InputVariable name should be changed from "input" to "user_input". But
in my test, Both works well.
chat_history.add_user_message(input_text) command should be after
kernel.invoke() function. Otherwise chat_history will include the
current new input_text in the prompt. It is not necessary.
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
Co-authored-by: Eduard van Valkenburg <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
This commit corrects the import paths for openai_settings_from_dot_env
and azure_openai_settings_from_dot_env functions (and some more).
Previously, these functions were incorrectly accessed directly from the
semantic_kernel module. The updated paths point correctly to
semantic_kernel.utils.settings, aligning with the package structure.
This change ensures better code maintainability and error-free imports.
### Motivation and Context
Thank you for your contribution to the semantic-kernel repo! Please help
reviewers and future users, providing the following information:
**Why is this change required?**
The change is required to correct incorrect import paths for
configuration loading functions which were previously leading to
AttributeError. This improvement ensures that the module imports
function correctly and aligns with the expected package structure.
**What problem does it solve?**
This change solves the problem of AttributeError being thrown when
attempting to access openai_settings_from_dot_env and
azure_openai_settings_from_dot_env. These functions were incorrectly
imported, causing module resolution errors in the user's environment.
**What scenario does it contribute to?**
This contributes to scenarios where developers need to integrate the
semantic-kernel package seamlessly with their projects without
encountering import errors. It facilitates easier setup and usage of the
semantic-kernel functionalities, particularly in settings involving
environmental configurations for AI services.
### Description
This update corrects the import paths for
**openai_settings_from_dot_env** and
**azure_openai_settings_from_dot_env** by specifying their correct
locations within the **semantic_kernel.utils.settings** module.
Previously, attempts to import these functions directly from the
**semantic_kernel** root module led to errors. The corrected paths
ensure these essential configuration functions are accessible,
supporting error-free configuration loading for OpenAI and Azure AI
services integration.
### Contribution Checklist
- [x] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
Co-authored-by: Konstantin Kohl <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
### Motivation and Context
Python PR merges were failing due to integration tests. Local
integration tests were hanging on running Azure text completions. It
appears text-davinci-003 was deprecated, and needed to be replaced by
gpt-35-turbo-instruct.
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
Remove references to text-davinci-003 text models as it causes tests to
hang.to hang. Updated to gpt-35-turbo-instruct, which passes. Add EastUS
AOAI deployment name var.
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Introduce logging for _Agent Framework_
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Basic diagnostics are critical.
Added a single logging sample in _Getting Started_. (Enabling logging
for all samples obscures the sample focus)
Logging Levels:
- Pre-Action ([verb]-ing): DEBUG
- Post-Action ([verb]-ed): INFORMATION (This often contains the result
of the action)
- Exception Thrown: ERROR (intuitive)
- Sensitive Data: TRACE (Tao was explicit on this / I think from working
with Toub)
Intent is that INFORMATION is for the messages we want enabled by
default for a deployed service (with agents). Whereas DEBUG/TRACE
messages are more opt-in detail for developers, as you've suggested.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
`https://openai.com/product` is failing `Check .md links` workflow.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Revise links.
https://github.com/microsoft/semantic-kernel/actions/workflows/markdown-link-check.yml
Whitespace edits peformed by VS Code
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Enhance `readme.md` associated with _Agent_ samples.
Also include _ agent sample in _Getting Started with Agents_.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- Updated readmes
- Clean-up pass on samples
- Added an OpenAI Assistant to _Getting Started_
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
We've noticed in our local testing that when working with a
KernelFunction that has no default value that later when interacting
with the generated `KernelParameterMetadata` for that function the
`DefaultValue` property is not `null`. This leads to cases where if the
provided default value for a method is an empty string (which is valid),
we can't distinguish between a case where there is no default value
provided (which is not valid).
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
This PR updates the `KernelFunctionFromMethod` class to first check if
the DefaultValue retrieved from the System.Reflection.ParameterInfo is a
[DBNull](https://learn.microsoft.com/en-us/dotnet/api/system.dbnull?view=net-8.0).
If it is, DefaultValue is set to null, otherwise the original logic is
provided and adds a unit test performing assertions for various methods
in the test Plugin class.
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
This PR contains demo application using [Azure AI Content
Safety](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/overview)
resource and [Prompt
Shields](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/quickstart-jailbreak)
service.
For text moderation and attack detection logic, Semantic Kernel Prompt
Filters are used as a demonstration, how to write functionality that
verifies prompts before sending it to LLM in a dedicated place to avoid
mixing it with business logic in applications.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
---------
Co-authored-by: Roger Barreto <[email protected]>
1. RegEx should be cased as Regex
2. The type should support being passed Regex instances, not just string
patterns, so that the consumer can control the options, use the source
generator, etc.
3. Delete duplicate test file
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Demonstrate dependency-injection with agents.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Similiar to:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/DependencyInjection/Kernel_Injecting.cs
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Introduce agent grouping/aggregator support via `AggregatorAgent` to
enable complex chat-patterns (not always flat).
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
> Tested on GPT-3.5-Turbo.
`Aggregator` allows a group of agents to participate in their own
sub-chat:
## OUTER / USER CHAT
```
# user: 'Can you provide three original birthday gift ideas. I don't want a gift that someone else will also pick.'
# assistant - Shopper: 'I'd be happy to help with that! Could you please tell me your relationship to the recipient and any specific interests they have to make the gift ideas as personalized as possible?'
# IS COMPLETE: False
# user: 'The gift is for my adult brother.'
# assistant - Shopper: 'Great, thank you for sharing that! Do you know if he has any particular interests or hobbies that could guide the gift selection?'
# IS COMPLETE: False
# user: 'He likes photography.'
# assistant - Shopper: 'Thank you for sharing that your brother enjoys photography! Here are three personalized birthday gift ideas tailored to his interest:
1. Vintage Camera Bookends
2. Photography-Themed Whiskey Decanter
3. Custom Camera Strap'
# IS COMPLETE: True
```
### INNER / AGGREGATED CHAT
```
# user - *: 'Can you provide three original birthday gift ideas. I don't want a gift that someone else will also pick.'
# assistant - PersonalShopper: 'I'd be happy to help with that! Could you please tell me your relationship to the recipient and any specific interests they have to make the gift ideas as personalized as possible?'
# assistant - Spokesperson: 'I'd be happy to help with that! Could you please tell me your relationship to the recipient and any specific interests they have to make the gift ideas as personalized as possible?'
# user - *: 'The gift is for my adult brother.'
# assistant - PersonalShopper: 'Great, thank you for sharing that! Do you know if he has any particular interests or hobbies that could guide the gift selection?
'
# assistant - Spokesperson: 'Great, thank you for sharing that! Do you know if he has any particular interests or hobbies that could guide the gift selection?'
# user - *: 'He likes photography.'
# assistant - PersonalShopper: 'Thank you for that information! Here are three personalized birthday gift ideas for your brother who enjoys photography:
1. Vintage Camera Bookends
2. Photography-Themed Whiskey Decanter
3. Custom Camera Strap'
# assistant - ShopperReviewer: 'The response provides a prompt request for additional information to tailor gift suggestions accurately, which is appropriate for ensuring the gift ideas are well-suited to the recipient. However, once the user specifies the gift recipient's interests, the response jumps straight into listing the gift ideas without acknowledging the new information provided about the recipient's interest in photography. This could make the suggested gifts seem less thoughtfully connected to the recipient's hobby.
To improve the response, it could:
- Acknowledge the provided information about the brother's interest in photography before listing the gift suggestions. This would make the response feel more personalized and considerate.
- Explain why each recommended gift particularly fits a photography enthusiast, enhancing the relevance and thoughtfulness of the suggestions.'
# assistant - PersonalShopper: 'Thank you for sharing that your brother enjoys photography! Here are three personalized birthday gift ideas tailored to his interest:
1. Vintage Camera Bookends
2. Photography-Themed Whiskey Decanter
3. Custom Camera Strap'
# assistant - ShopperReviewer: 'The response effectively specifies that it is tailored to your requirements by acknowledging your brother's interest in photography. It then lists three unique gift ideas that align well with this interest, making the suggestions personalized and thoughtfully chosen. This approach directly correlates the gifts to the recipient's hobby, potentially ensuring the gifts feel unique and special. No further critical feedback is needed as the response adequately addresses your request for original gift ideas related to photography.'
# assistant - Spokesperson: 'Thank you for sharing that your brother enjoys photography! Here are three personalized birthday gift ideas tailored to his interest:
1. Vintage Camera Bookends
2. Photography-Themed Whiskey Decanter
3. Custom Camera Strap'
```
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Result from function-calling not being captured in agent-chat history
for ChatCompletionAgent.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Updated logic to:
1. Capture mutated chat-history, in addition to the iterated messages.
2. Suppress exposing function-content as `AgentChat` interaction (while
retaining in history).
3. "Tool" role transformed to "Assistant" for OpenAI Assistant API
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
### Motivation and Context
Make samples more console friendly.
This change allows the code to be copy and pasted in a Console App,
which virtually no code changes to the core code in sample
implementations.
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
Kernel is already imported and there's no sk reference anymore since
it was removed last week in:
Python: fixing python readme
(https://github.com/microsoft/semantic-kernel/pull/5903)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
The change https://github.com/microsoft/semantic-kernel/pull/5903
imported Kernel directly so the code
no longer works as written
2. What problem does it solve?
Code sample does not run
3. What scenario does it contribute to?
sample code in README.md working
4. If it fixes an open issue, please link to the issue here.
None
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
[Step4_KernelFunctionStrategies](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/GettingStartedWithAgents/Step4_KernelFunctionStrategies.cs)
was either:
1. Failing with null selection
2. Exceeding model token limit
3. Not performing the requested task
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
A couple things at play here:
1. The selection prompt was copied from AutoGen. While it worked on
`GPT-4`, it wasn't generating a reliable result for `GPT-3.5-Turbo`
2. The agent instructions were never tuned outsidre of `GPT-4`
3. No sensible default / fall-through (can't trust model 100%)
4. 4k token limit may be too low for history evaluation. Tested with
`gpt-35-turbo-16k`
> Note: When formal support for history manipulation comes on line, we
should be able to optimize around last(n) messages.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
Resolves#5960
This pull request includes several changes to the `dotnet` directory,
mainly adding a new project called `BookingRestaurant` and updating
dependencies. The `BookingRestaurant` is a demo application for booking
restaurant tables using Microsoft Graph Bookings API. The most important
changes include adding a new project to the solution, updating package
versions, and adding new patterns to the markdown link check config.
New Project:
*
[`dotnet/SK-dotnet.sln`](diffhunk://#diff-6728f39c7d31a256668698ee869487799bf43c93dc8cc7e889befe95b0ec09e6R262):
Added a new project called `BookingRestaurant` to the solution.
[[1]](diffhunk://#diff-6728f39c7d31a256668698ee869487799bf43c93dc8cc7e889befe95b0ec09e6R262)
[[2]](diffhunk://#diff-6728f39c7d31a256668698ee869487799bf43c93dc8cc7e889befe95b0ec09e6R623-R628)
[[3]](diffhunk://#diff-6728f39c7d31a256668698ee869487799bf43c93dc8cc7e889befe95b0ec09e6R717)
*
[`dotnet/samples/Demos/BookingRestaurant/*`](diffhunk://#diff-f846bffbf2145055d4ab6e138b8e20d2ada4000292541e98d5b242c250327881R1-R74):
Added several new files for the `BookingRestaurant` project, including
`AppConfig.cs`, `Appointment.cs`, `BookingRestaurant.csproj`,
`BookingsPlugin.cs`, and `Program.cs`. These files contain the main
logic and configuration for the new project.
[[1]](diffhunk://#diff-f846bffbf2145055d4ab6e138b8e20d2ada4000292541e98d5b242c250327881R1-R74)
[[2]](diffhunk://#diff-5b3c66c05657fed5958d03e136b3c2376aaa1d9afea5d30c0653e69c92e39890R1-R24)
[[3]](diffhunk://#diff-ff4fe71831c229af576b18e123e87869077b64f9d41338f02fe583e35b1f761bR1-R30)
[[4]](diffhunk://#diff-21617b4ad8043159f5d5d0f394e839bc3b700e7bf965cd75b037fb0149e0c3cbR1-R140)
[[5]](diffhunk://#diff-624c47bcfbbff8c6156f7056d410a92b05e0a0c4038172b213903e03fa81511eR1-R128)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
'import_plugin_from_object' is removed from Kernel. Replace it's usage
with add_plugin in function docstring
### Motivation and Context
Fix docstrings of core_plugins to replace 'import_plugin_from_object'
with 'add_plugin'.
### Description
'import_plugin_from_object' is removed from Kernel. Replace it's usage
with 'add_plugin' in docstring
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] I didn't break anyone 😄
Co-authored-by: Eduard van Valkenburg <[email protected]>
## Phase 2 - Sample Restructuring
- Removal of Examples numbering
- Decomposing `KernelSyntaxExamples` into meaningful Feature base
folders within `Concepts`.
- Update current sample projects to use `sample` centric
`InternalUtilities` reducing code repetition
- Update SDK projects type to be correctly idenfified as xUnit Test
projects
- Update projects to be implicit using friendly, reducing considerably
the extra lines of code for every sample.
- Decomposing `Concepts\AgentSyntax` into `Concepts\Agents`
- Decomposing `Concepts\AgentSyntax\GettingStarted` into a new root
dedicated `GettingStartedWithAgents`
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Marked unused filter context classes as `Obsolete`.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Users of `AgentGroupChat` will likely require strategies that rely on AI
processing. Text processing alone is insufficient, but developers need
other options than calling an AI model. With this update, our strategy
story supports either.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Introducing support `SelectionStrategy` and `TerminationStrategy` that
utilize LLM processing with support for result processing.
- `KernelFunctionSelectionStrategy`
- `KernelFunctionTerminationStrategy`
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
A well justified customer request to allow `KernelArguments` to be
injected into the assistant function calling.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Defined an _opt-in_ pattern that passes the already provided
`KernelArguments` to the run (`ChatRun`).
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] 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
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Resolves: https://github.com/microsoft/semantic-kernel/issues/4896
Resolves: https://github.com/microsoft/semantic-kernel/issues/5104
Resolves: https://github.com/microsoft/semantic-kernel/issues/5476
Resolves: https://github.com/microsoft/semantic-kernel/issues/5470
Merging following PRs from feature branch to `main`:
1. https://github.com/microsoft/semantic-kernel/pull/5787
2. https://github.com/microsoft/semantic-kernel/pull/5788
3. https://github.com/microsoft/semantic-kernel/pull/5865
4. https://github.com/microsoft/semantic-kernel/pull/5900
5. https://github.com/microsoft/semantic-kernel/pull/5935
`IFunctionFilter` was renamed to `IFunctionInvocationFilter` with new
signature:
```csharp
public class MyFilter : IFunctionInvocationFilter
{
public async Task OnFunctionInvocationAsync(FunctionInvocationContext context, Func<FunctionInvocationContext, Task> next)
{
// Perform some actions before function invocation
await next(context);
// Perform some actions after function invocation
}
}
```
`IPromptFilter` was renamed to `IPromptRenderFilter` with new signature:
```csharp
public class PromptFilter: IPromptRenderFilter
{
public async Task OnPromptRenderAsync(PromptRenderContext context, Func<PromptRenderContext, Task> next)
{
// Perform some actions before prompt rendering
await next(context);
// Perform some actions after prompt rendering
}
}
```
New type of filter was added `IAutoFunctionInvocationFilter`:
```csharp
public class AutoFunctionInvocationFilter(ILogger logger) : IAutoFunctionInvocationFilter
{
private readonly ILogger _logger = logger;
public async Task OnAutoFunctionInvocationAsync(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
{
// Example: get function information
var functionName = context.Function.Name;
// Example: get chat history
var chatHistory = context.ChatHistory;
// Example: get request sequence number
this._logger.LogDebug($"Request sequence number: {context.RequestSequenceNumber}");
// Example: get function sequence number
this._logger.LogDebug($"Function sequence number: {context.FunctionSequenceNumber}");
// Calling next filter in pipeline or function itself.
// By skipping this call, next filters and function won't be invoked, and function call loop will proceed to the next function.
await next(context);
// Example: get function result
var result = context.Result;
// Example: override function result value
context.Result = new FunctionResult(context.Result, "Result from auto function invocation filter");
// Example: cancel function invocation
context.Cancel = true;
}
}
```
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Introducing FunctionCallContent and FunctionResultContent
Changed ChatRole to AuthorRole
Adapting ChatMessageContent to have 1 or more other contents within
(currently TextContent or one of the above)
Closes#5890
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Changed OpenAI classes, to remove OpenAIChatMessageContent and
AzureChatMessageContent
Changed OpenAI classes to create and parse FunctionCallContent and other
new things.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Organize samples as part of restructuring.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Added `Getting_Started` along with two functional areas:
`OpenAIAssistant` and `MixedAssistants`

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
### Motivation and Context
Cannot run KernelSyntax examples on Apple Mx series, because the
solution is configured to use X64
### Description
Change solution settings, changing "X64" to "Automatic"
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Desire to include agent projects in code-coverage reports:
- `Microsoft.SemanticKernel.Agents.Abstractions`
- `Microsoft.SemanticKernel.Agents.Core`
- `Microsoft.SemanticKernel.Agents.OpenAI`
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Maintaining coverage metrics is good.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
The
ConnectorAgnosticFunctionCallingModelClassesCanPassFunctionExceptionToConnectorAsync
integration test has been disabled because it continues to fail, even
though it was configured @with system instructions on how to handle
errors.
### Motivation and Context
In this change we are restructuring our samples in the following
categories:
| Type | Description |
| ----------------- |
--------------------------------------------------------------------------------------------------------
|
| `Getting started` | A single step-by-step tutorial to get started |
| `Concepts` | A concept by feature specific code snippets |
| `LearnResources` | Code snippets that are related to online
documentation sources like Microsoft Learn, DevBlogs and others |
| `Tutorials` | More in depth step-by-step tutorials |
| `Demos` | Demostration applications that leverage the usage of one or
many features |
## Decision Drivers and Principles
- **Easy to Search**: Well organized structure, making easy to find the
different types of samples
- **Lean namings**: Folder, Solution and Example names are as clear and
as short as possible
- **Sends a Clear Message**: Avoidance of Semantic Kernel specific
therms or jargons
- **Cross Language**: The sample structure will be similar on all
supported SK languages.
## Strategy on the current existing folders
| Current Folder | Proposal |
| ------------------------------------ |
-------------------------------------------------------------------------
|
| KernelSyntaxExamples/Getting_Started | Move into `Getting Started` |
| KernelSyntaxExamples/`Examples??_*` | Decompose into `Concepts` on
multiple conceptual subfolders |
| AgentSyntaxExamples | Decompose into `Concepts` on `Agents` specific
subfolders. |
| DocumentationExamples | Move into `LearnResources` subfolder and
rename to `MicrosoftLearn` |
| CreateChatGptPlugin | Move into `Demo` subfolder |
| HomeAutomation | Move into `Demo` subfolder |
| TelemetryExample | Move into `Demo` subfolder and rename to
`TelemetryWithAppInsights` |
| HuggingFaceImageTextExample | Move into `Demo` subfolder and rename to
`HuggingFaceImageToText` |
## Concepts - Previously `KernelSyntax` and `AgentSyntax`.
Both `KernelSyntaxExamples` and `AgentSyntaxExamples` will be
distributed into example code by features below.
```
samples/Concepts/
├── Functions/
├── Chat Completion/
├── Text Generation/
├── Text to Image/
├── Image to Text/
├── Text to Audio/
├── Audio to Text/
├── Telemetry
├── Logging
├── Dependecy Injection
├── Plugins
├── Auto Function Calling
├── Filtering
├── Memory
├── Search
├── Agents
├── Templates
├── RAG
├── Prompts
└── LocalModels/
```
### Motivation and Context
Version bump for a new release
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] 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 😄