Commit Graph
2795 Commits
Author SHA1 Message Date
John Oliver 40706571fd Revert bad link 2024-05-02 16:39:13 +01:00
John Oliver 0f5c851277 Merge branch 'java-v1' into java-development 2024-05-02 16:31:46 +01:00
John Oliver 42ea30fc88 Merge remote-tracking branch 'upstream/main' into java-development 2024-05-02 16:26:32 +01:00
Mark Wallace c1d5fd4991 .Net: Split safe prompt into multiple unit tests (#6096)
### 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 😄
2024-05-02 13:57:49 +00:00
89686e3729 Python: Update 04-kernel-arguments-chat.ipynb (#5910)
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]>
2024-05-02 13:45:09 +00:00
7b194980b5 Python: Update import paths for OpenAI settings functions (#6059)
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]>
2024-05-02 13:35:16 +00:00
Evan Mattson deb813bdca Python: Remove references to text-davinci-003 text models as it causes tests to hang. (#6089)
### 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 😄
2024-05-02 12:47:17 +00:00
Chris 1bcb9ce265 .Net - Agent Logging (#6075)
### 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 😄
2024-05-02 03:08:13 +00:00
Chris ac6e03ba98 Java: Python: Docs: Fix broken link (#6092)
### 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 😄
2024-05-01 19:55:48 -07:00
Chris 75dccb3f83 .Net - Update Agent Readme (#6070)
### 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 😄
2024-05-01 20:34:45 +00:00
Kevin Pilch e51c34daa6 .Net: Fix spelling of 'Euclidean' (#6087) 2024-05-01 20:06:54 +00:00
Daniel Gonzalez 3a4cbdb829 .Net: Handle Default Values for KernelParameterMetadata Correctly (#6053)
### 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 😄
2024-05-01 18:52:43 +00:00
Dmytro StrukandRoger Barreto 861cefa05a .Net: Azure AI Content Safety and Prompt Shields demo application (#6024)
### 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]>
2024-05-01 16:37:00 +00:00
Stephen Toub 8665df3d1d .Net: Tweak RegexTerminationStrategy (#6078)
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
2024-05-01 08:35:14 +00:00
Stephen Toub 184d9b8050 .Net: Add netstandard2.0 build of Microsoft.SemanticKernel.Connectors.Onnx (#6076) 2024-05-01 04:56:51 +00:00
Roger BarretoandStephen Toub 9afa08d732 .Net BugFix Issue 6058 Changing Dictionary in Enumeration (#6067)
### Motivation and Context

Resolve #6058

---------

Co-authored-by: Stephen Toub <[email protected]>
2024-05-01 01:55:14 +00:00
Chris c27fa87f3a .Net - Agent DI Sample (#6055)
### 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 😄
2024-04-30 19:56:10 +00:00
Chris eb915c153b .Net - Agent Aggregator / Complex Chat (#6029)
### 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 😄
2024-04-30 19:44:13 +00:00
Chris 2119695f23 .Net - Agents Fix: Capture Function-Calling Content (ChatCompletionAgent) (#6046)
### 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 😄
2024-04-30 17:21:06 +00:00
GitHub 8d158e5c43 [maven-release-plugin] prepare for next development iteration 2024-04-30 14:13:17 +01:00
GitHub c31fad1c8f [maven-release-plugin] prepare release java-1.0.2 2024-04-30 14:13:16 +01:00
John Oliver 7c03920b1f Java: Fix null warnings (#6060)
### 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 😄
2024-04-30 14:09:13 +01:00
Roger Barreto f66a30bbd9 .Net Samples Restructure - Phase 4 (#6057)
### 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.
2024-04-30 11:34:44 +00:00
Mark Wallace 312c96cd7d .Net: Baseline 1.10.0 (#6045)
### 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 😄
2024-04-30 10:37:33 +00:00
Dmytro Struk 6223c7aebe .Net: Moved BookingRestaurant project to Demos folder in solution (#6056)
### 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.
-->

I noticed that `BookingRestaurant` project is located in `Demos` folder
in file system:

![image](https://github.com/microsoft/semantic-kernel/assets/13853051/9c3b6303-a442-402c-80b8-8e20bf9372bc)

But not in solution:

![image](https://github.com/microsoft/semantic-kernel/assets/13853051/11b71c00-fe69-49b6-ac6e-1c0c1cb6dd5c)

This PR moves `BookingRestaurant` project to `Demos` folder in solution:

![image](https://github.com/microsoft/semantic-kernel/assets/13853051/e079d1d9-63e5-4642-b396-fbabe7806261)

### 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 😄
2024-04-30 08:29:06 +00:00
Rob Clevenger ea25f6232d Python: Fix typo in line to instantiate Kernel. (#6020)
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 😄
2024-04-30 07:59:34 +00:00
Roger Barreto 1e94588c06 .Net Samples Restructure - Phase 3 (#6043)
### Motivation and Context

Resolves #5949

- Fixed Bug in Visual Studio not running Tests using Test Explorer
- Update Readme.md + Added GettingStartedWithAgents ReadMe.
- Filtering Examples Split
- Added Namespaces for better organization of the Test Explorer View.

![image](https://github.com/microsoft/semantic-kernel/assets/19890735/2a81aafd-4de9-4143-ad53-7104ac22e5f3)
dotnet-1.10.0-nightly-240430.1
2024-04-29 21:00:38 +00:00
Chris 80aa777103 .Net: Agents - Getting Started Step4 Improvement: Cross Model (#6044)
### 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 😄
2024-04-29 20:40:53 +00:00
Roger Barreto 7b4785496a .Net Restaurant Bookings Demo (#5988)
### 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)
2024-04-29 20:18:23 +00:00
Mark Wallace 32b3bc3071 .Net: Version 1.10.0 (#6031)
### 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 😄
dotnet-1.10.0
2024-04-29 17:45:01 +00:00
Aditya NageshandEduard van Valkenburg 8fd1f6a22e Python: Replace 'import_plugin_from_object' with 'add_plugin' (#6025)
'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]>
2024-04-29 17:30:59 +00:00
Roger Barreto c545c7d774 .Net Samples Restructuring - Phase 2 (#6005)
## 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`
2024-04-29 15:49:27 +00:00
Dmytro Struk 1c77ad2e58 .Net: Deprecated unused filter context classes (#6017)
### 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 😄
dotnet-1.9.0-nightly-240429.1
2024-04-27 16:00:26 +00:00
Chris 4af7dfcb45 .Net - Agents KernelFunction Strategies (#5895)
### 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 😄
2024-04-26 17:08:29 +00:00
Chris 0296329886 .Net - Enhance _OLD_ Agents Package onFunction Calling Arguments (#6006)
### 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 😄
2024-04-25 18:37:30 +00:00
Dmytro Struk d0de9a0153 .Net: New API for Filters (#5936)
### 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 😄
2024-04-25 14:59:30 +00:00
Mark Wallace 2440223513 .Net: Baseline 1.9.0 (#6002)
### 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 😄
2024-04-25 13:29:49 +00:00
Eduard van Valkenburg 65e94b3454 Python: updated Chat Message Content with Function Call and Result Content (#5946)
### 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 😄
2024-04-25 12:35:59 +00:00
Chris e0be61601d .Net - Agent Samples Restructure (#5987)
### 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`


![image](https://github.com/microsoft/semantic-kernel/assets/66376200/3bb9be12-5a54-4406-a175-2529a1fdbcf5)

### 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 😄
dotnet-1.9.0-nightly-240425.1
2024-04-24 21:18:47 +00:00
Devis Lucato 5ba79ee3b4 .Net: Use automatic platform detection for unit tests (#5996)
### 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"
2024-04-24 19:25:00 +00:00
373083b7d8 .Net: Azure CosmosDB Mongo vCore Memory Store Integration (#5228)
## Motivation and Context (Why the change? What's the scenario?)
I have added Azure Cosmos DB Mongo vCore as Memory to be used by
customers using Kernel Memory and Cosmos DB for their LLM applications.


[https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/vector-search](url)

---------

Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: Dmytro Struk <[email protected]>
Co-authored-by: Eduard van Valkenburg <[email protected]>
2024-04-24 16:57:19 +00:00
Chris f82034bedc .Net - Add Coverage for Agent Projects (#5982)
### 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 😄
2024-04-24 16:43:37 +00:00
SergeyMenshykh 849ae32307 .Net: Flaky integration test disabled. (#5992)
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.
2024-04-24 12:32:28 +00:00
Roger Barreto 1a48974233 .Net Samples Restructuring - Phase 1 (#5888)
### 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/
```
2024-04-24 12:27:43 +00:00
Mark Wallace de0e566005 .Net: Version 1.9.0 (#5991)
### 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 😄
dotnet-1.9.0
2024-04-24 12:54:56 +01:00
John Oliver 33d8e2b613 Java: Ensure xml is unescaped before sending to LLM (#5984)
### 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 😄
2024-04-24 12:42:48 +01:00
John Oliver f12d8c8667 Java: Add example of adding headers to OpenAPI requests (#5980)
### 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 😄
2024-04-24 12:04:58 +01:00
Mark WallaceandDaniel Gonzalez a2abc0ea13 .Net: Support XML Tags in Chat Prompts (#5866)
### Motivation and Context

See
[ADR](https://github.com/microsoft/semantic-kernel/pull/5866/files?short_path=7baf347#diff-7baf34730c3b1a98278bac7036172bd99f82a8f8484e696c42e0a15042200ecb)

Closes #5699 

### Description

To revert to the old (less safe) behavior you can create a
`KernelPromptTemplateFactory` and set `AllowUnsafeContent = true` and
then all prompt templates will trusted all inserted content. This
approach is not recommended unless you are sure that inserted content
comes from a trusted source.

Here is an example:

```csharp
private async Task ExampleTrustedTemplateAsync(Kernel kernel)
    {
        KernelFunction trustedMessageFunction = KernelFunctionFactory.CreateFromMethod(() => "<message role=\"system\">You are a helpful assistant who knows all about cities in the USA</message>", "TrustedMessageFunction");
        KernelFunction trustedContentFunction = KernelFunctionFactory.CreateFromMethod(() => "<text>What is Seattle?</text>", "TrustedContentFunction");
        kernel.ImportPluginFromFunctions("TrustedPlugin", [trustedMessageFunction, trustedContentFunction]);

        var chatPrompt = @"
            {{TrustedPlugin.TrustedMessageFunction}}
            <message role=""user"">{{$input}}</message>
            <message role=""user"">{{TrustedPlugin.TrustedContentFunction}}</message>
        ";
        var promptConfig = new PromptTemplateConfig(chatPrompt);
        var kernelArguments = new KernelArguments()
        {
            ["input"] = "<text>What is Washington?</text>",
        };
        var factory = new KernelPromptTemplateFactory() { AllowUnsafeContent = true };
        var function = KernelFunctionFactory.CreateFromPrompt(promptConfig, factory);
        WriteLine(await RenderPromptAsync(promptConfig, kernel, kernelArguments, factory));
        WriteLine(await kernel.InvokeAsync(function, kernelArguments));
    }
```

### 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: Daniel Gonzalez <[email protected]>
2024-04-24 10:57:02 +00:00
John Oliver c418266ae3 Java: Fix required tool call being requested multiple times (#5962)
### 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 😄
2024-04-24 11:41:23 +01:00
Eduard van Valkenburg 7d2ac133bc Python: move Hugging Face tests to integration (#5983)
### 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.
-->
Even though the completion itself does not callout, loading the model is
a HTTP call, hence moving the Hugging Face tests to Integration tests.

Plus small fix to make them run.

### 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 😄
2024-04-24 07:25:43 +00:00