Commit Graph
39 Commits
Author SHA1 Message Date
Ben Thomasandalliscode 02da6c47d7 Updating recommended extensions list. (#13645)
### Description

Updating recommended extensions.

### 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: alliscode <[email protected]>
2026-03-10 22:03:43 +00:00
d2e6e3c4f1 Removing Java related extensions and settings. (#11290)
Removing unused extensions and VS Code settings.

### 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: Ben Thomas <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
2025-07-18 12:01:57 +00:00
Musale Martin 04f5fbbc5a .Net: Add Calendar write for Copilot Agent Plugin Calendar (#10622)
### Motivation and Context
Add support for creating calendar events on Copilot Plugin Agents

<!-- 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
Add support for creating calendar events on Copilot Plugin Agents

<!-- 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 😄
2025-03-03 16:50:11 +00:00
Ben ThomasandBen Thomas 656159e492 .Net: Processes with Dapr - Improving Demo with README (#9360)
### Description

This PR adds the following:
- A README file for the Processes with Dapr demo application to help
explain how to run it and understand what is happening.
- Cleans up naming of things within the demo and adds Console output to
help follow execution of the process.
- Improves tasks and launch config in VS Code and adds the Dapr
extension as a recommended extension.

### 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: Ben Thomas <[email protected]>
2024-10-21 20:20:47 +00:00
Ben ThomasandBen Thomas 22757e17c4 .Net: Dapr Runtime for Processes (#9299)
### Description

This PR adds the Dapr runtime for Processes. The runtime is very similar
in concept to the local runtime with a few changes to accommodate the
single threaded remote actors.

A new Demo has also been added called `ProcessWithDapr` that shows a
asp.net core service with Dapr configured. The sample has a single API
that triggers a simple process to run within Dapr. This sample is still
very basic and more work is needed to demonstrate all the patterns that
can be used with Processes.

### 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: Ben Thomas <[email protected]>
2024-10-17 16:29:17 +00:00
8b4a1495fc .Net Processes: Updated to process abstractions and core builders in preparation for Dapr runtime (#9285)
### Description

This PR is the first in a series that will enable the Dapr runtime for
Processes. This change makes adjustments to the abstractions and core
builder that are mainly focused on supporting the DataContract
serialization used for Dapr actor remoted function calling.

### 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: Ben Thomas <[email protected]>
Co-authored-by: Chris <[email protected]>
2024-10-16 18:13:05 +00:00
Eduard van Valkenburg f90538b9c0 Python: switch to uv (#8320)
### 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.
-->
Switches from poetry to uv
much faster and easier lock management
easier maintenance of pyproject.toml

fixes: #6584
fixes: #8326

### 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
- [ ] I didn't break anyone 😄
2024-08-26 13:34:29 +02:00
Mark Wallace e389adae7e .Net: Update Concepts README for new Prompt samples (#6173)
### Motivation and Context

Closes #6166 

### 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-09 19:14:15 +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
Mark Wallace 6c42d69672 Update deprecated property values (#5482)
### 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-03-15 10:50:22 +00:00
Roger Barreto 4cd2675422 .Net HuggingFace Image to Text Sample Windows Forms Application (#5484)
### Motivation and Context

Adds a simple sample windows forms application to the `dotnet/samples`
folder for guidance on how to use `ImageToText` services.

### 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-03-15 10:47:18 +00:00
Evan MattsonandEvan Mattson 15f13b285d Python: allow default_headers configuration and users to pass in custom AzureOpenAI/OpenAI clients. (#3903)
### Motivation and Context

Currently, users in Python have no ability to configure default_headers
for the AzureOpenAI/OpenAI clients we use. Additionally, if a user wants
to set up their own AzureOpenAI/OpenAI client, this isn't possible. This
PR addresses #2895.

<!-- 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

Allow users to set default_headers for Chat/Text/Embedding Completion
classes for both OpenAI and AzureOpenAI. Additionally, allow users to
pass in a customer OpenAI/AzureOpenAI client, if desired. Update tests
accordingly.

<!-- 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: Evan Mattson <[email protected]>
2023-12-05 17:05:13 +00:00
Matthew BolañosandMark Wallace d2ddddeb94 .Net: Add experimental attributes to packages (#3709)
### Motivation and Context

Adding the experimental attribute to packages and classes in the .NET
SDK of Semantic Kernel to mark things that won't be ready be v1.0.0 of
Semantic Kernel.

### Contribution Checklist
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Mark Wallace <[email protected]>
2023-12-01 17:14:05 +00:00
Ben ThomasandBen Thomas 2a9f9274dc .Net: Deleting all deprecated samples. (#3260)
### 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: Ben Thomas <[email protected]>
2023-11-07 18:09:26 +00:00
Lee Miller 5b95f799f4 .Net: Handle exceptions when creating plan from XML (#2832)
Fixes #2831

This commit adds a try-catch block to handle SKException when
converting planResultString to a Plan object using the
ToPlanFromXml method. It provides a more informative error message
including the goal and relevant functions in case of failure.

### 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 😄
2023-09-14 22:35:54 +00:00
Lee MillerandDmytro Struk a5eb8207c4 .Net: [dev] Improve KernelSyntaxExamples ability to filter examples. (#2764)
### Motivation and Context

Make it easier to run individual examples in the KernelSyntaxExamples
project.

### Description
This commit combines the updates to launch.json, tasks.json, and
Program.cs to allow passing arguments to the main method and running
examples based on the provided filter. The list of examples in
Program.cs has also been updated to include new examples and ensure
proper execution. These changes make it easier to run specific examples
without having to run all of them and improve the organization and
readability of the 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 😄

---------

Co-authored-by: Dmytro Struk <[email protected]>
2023-09-12 14:54:09 +00:00
Lee MillerandDmytro Struk e298e2b75c Python: Add setup for contributing-python and tests for Semantic-Kernel-Python (#2536)
Add setup tasks for contributing-python and tests for
Semantic-Kernel-Python. The setup tasks install poetry and python
packages. The tests include unit tests, integration tests, and all tests
for Semantic-Kernel-Python.

### 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: Dmytro Struk <[email protected]>
2023-08-31 16:30:56 +00:00
Ben ThomasandBen Thomas 362e44831b Copilot Chat: Removing copilot-chat-app from semantic-kernel repo as it has moved t… (#2282)
Removing copilot-chat-app from semantic-kernel repo.

### Motivation and Context

The semantic-kernel copilot-chat-app sample has moved to [its own
repository](https://github.com/microsoft/chat-copilot).

### Description

Removed all files related to the copilot-chat-app sample and replaced
them with a README linking to the new repository.

### 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: Ben Thomas <[email protected]>
2023-08-02 21:41:56 +00:00
484b39d144 Python: Add sequential planner to python (#1916)
### 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.
-->
fixes #1915 

### 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 SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Shawn Callegari <[email protected]>
2023-07-28 00:08:31 +00:00
Abby HarrisonandShawn Callegari 5e4e0edfaa Python: Plan Object Model (#1907)
### Motivation and Context
This PR ports the plan object model found in the .NET SK to Python. This
fundamentally changes the concept of a planner from a `semantic skill`
to a unique type of `SKFunction`. With this model, we can begin
implementing sequential planner and offer much better plan
customization.

**Notes:**
- This PR does not implement plan serialization/deserialization to/from
JSON. There is a huge existing effort to make the Python SK completely
Pydantic enabled, which will bring serialization and deserialization
capability with it.
- This PR does not include ports of `Action Planner` and `Sequential
Planner` to the Plan Object Model (POM). Following PRs will address
this.
- I also added some missing copywrite headers. A future PR will add
headers to any still missing them.
- added a VSCode launch configuration to run the current file with
pytest
- closes #1486 


### Description
- Added file called `plan.py` which is a python port of the Plan.cs file
found in the .NET SK. Note that it does not contain serialization logic
at this time.
- Added new kernel error `FunctionInvokeError` - mirrors the error list
of the .NET SK
- Added tests for Plan creation
- Added tests for Plan execution - both sync and async


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Shawn Callegari <[email protected]>
2023-07-15 01:34:19 +00:00
Shawn Callegari 7dfa2278b4 Adding dotnet.defaultSolution to .vscode settings (#1887) 2023-07-07 16:16:49 +00:00
Desmond Howard cd5120fa18 Copilot Chat: Fix ESLint violations + enable linter during build (#1710)
### 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.
-->
fix the ESLint violations in CopilotChat and enable the linter to run
during `yarn start`/`yarn build`.

**lint errors going forward will fail the build** and will need to be
corrected before a PR can merge.
we have already configured the linter to auto-fix on save in VSCode and
for other IDEs the `yarn lint:fix` script can be used.

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- `.node-pr.yml`: removed unneeded directory filter since `samples/apps`
no longer contains a `yarn.lock`.
- `.vscode/settings.json`: updated to point to the `eslintConfig` in the
`package.json` rather than the shared JS file. this is required so that
the plugins are resolved correctly by the extension.
- `.eslintrc.js`:
  - removed deprecated `@typescript-eslint` rules.
  - removed plugins already resolved from create-react-app.
- removed `standard-with-typescript` extended config in favor of more
widely used configs.
- `webapp/package.json`: 
- pinned TS version to `5.0.4`, the latest version below `5.1.0`. this
is a dependency requirement of `@typescript-eslint` and otherwise the
linter will not work.
- re-added `eslintConfig` that now extends from the `../../eslintrc.js`.
this is required so that the plugins are resolved correctly by ESLint.
- `samples/apps/package.json`: 
- deleted since there are now no shared dependencies that need to be
downloaded.
  - similarly, the `yarn.lock` file was removed as well. 
- all of the plugins/configs used in `.eslintrc.js` are already included
in the [create-react-app
config](https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js)
which we extend.
- **all other files**: fixed **379** errors and **42** warnings.

### Preview
#### During build
<img width="258" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/52973358/94a42909-7cb6-48a7-8d5f-6f55a15d6025">

#### In VSCode w/ ESLint extension installed
<img width="253" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/52973358/182604ab-6228-49f6-8983-4ef902e7e945">

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [X] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
- [X] Bugbash to double check nothing is broken (not yet but before
merging)
2023-06-30 19:19:11 +00:00
Shawn Callegariandname f8a8d884ff Moving KernelSyntaxExamples into the dotnet/ folder (#1616)
"KernelSyntaxExamples" is the only outstanding project under /samples
that still uses project references to access the kernel libraries.

This change consolidates all the building, linked dotnet SDK code in
SK-dotnet.sln into a single top-level folder. This will simplify build
jobs, automatic code owner assignment, and other dev ops tasks.

Coming next: other projects in samples will get removed from the
dotnet/SK-dotnet.sln solution, and a new solution with dedicated builds
created for the /samples folder.

TBD:
- Language-specific code "samples" will move into a similar subfolder
for each language.
- The current "/samples" folder (at the root) will likely become
something like "apps", with the demo apps promoted to the top-level
folder for better discoverability.
- notebooks may also move to this folder in the future.

Co-authored-by: name <email>
2023-06-21 01:37:54 +00:00
Bruno Borges 7298677834 VS Code settings for Java (#1552) 2023-06-21 00:57:22 +00:00
Bruno Borges 8d84dcca82 Recommended extensions for Java (#1438) 2023-06-13 10:04:21 -07:00
Lee MillerandLee Miller 35cb1bf76a Copilot Chat Tasks - Rename CopilotChatApi to CopilotChatWebApi (#1205)
This commit renames the CopilotChatApi project and related files to
CopilotChatWebApi, to avoid confusion with the CopilotChatApp project
and to follow the naming convention of other webapi projects in the
solution. It also updates the launch and task configurations in VSCode
to reflect the new name.

Co-authored-by: Lee Miller <[email protected]>
2023-05-25 14:01:28 -07:00
Lee Miller 5731030dec Add VS Code tasks for CopilotChat project (#832)
This commit adds three tasks to the .vscode/tasks.json file for
building, running, and watching the CopilotChatApi project. These tasks
allow developers to easily launch and debug the WebApi service using VS
Code. The commit also updates the README.md file with instructions on
how to use the VS Code tasks. Additionally, the commit fixes some minor
formatting issues in the README.md file.
2023-05-12 20:32:18 +00:00
Lee Miller 2df5e5dc7f 🧪Add results-directory option to dotnet test tasks (#812)
This commit adds the --results-directory option to the dotnet test tasks
in the .vscode/tasks.json file. This option specifies the directory
where the test results and code coverage reports are stored. By setting
this option, the test tasks can avoid cluttering the default TestResults
folder in the solution root. The commit also adds a new test task that
runs all the tests in the dotnet folder with code coverage enabled.
2023-05-04 19:59:55 +00:00
Lee Miller 56ea209535 Updates and tests for plan serialization and deserialization (#620)
### Motivation and Context
The change improves the serialization and deserialization of Plan
objects.

### Description
Allows deserialization of Plans without a context. Adds unit tests for
the Plan and ContextVariables classes, which cover various scenarios and
edge cases of serializing and deserializing plans and context variables.

Details:
- Updates the custom converter for the ContextVariables class, which
serializes and deserializes the key-value pairs as an array of objects,
instead of a dictionary. This improves the efficiency and readability of
the JSON format.
- Add a new file PlanSerializationTests.cs to the
SemanticKernel.UnitTests project, which contains unit tests for the Plan
class. The tests verify that a plan can be serialized and deserialized
correctly, and that the plan state is updated correctly after each step
execution. The tests also check for invalid JSON strings.
- Add a new file ContextVariablesConverterTests.cs to the
SemanticKernel.UnitTests project, which contains unit tests for the
ContextVariablesConverter class. The tests verify that the converter can
correctly serialize and deserialize context variables to and from JSON,
and handle null, empty, and invalid inputs.
2023-04-26 15:04:26 -07:00
Lee Miller 0bf374f2a8 Update tasks.json to use IntegrationTests.csproj (#646)
### Motivation and Context
Fix the VSCode tasks for integration tests.

### Description
This commit changes the tasks.json file to use the
IntegrationTests.csproj file instead of the
SemanticKernel.IntegrationTests.csproj file. This is because the
SemanticKernel project has been renamed to IntegrationTests, and the
tasks.json file needs to reflect this change. This affects the test
coverage task, which runs the integration tests and generates a lcov
report. The commit also updates the cwd option to point to the new
project folder.
2023-04-25 20:46:12 +01:00
Mark Wallace 2ffda1a6f7 Add Semantic Kernel as recommended extension (#524)
### Motivation and Context
Adding the Semantic Kernel Tools as a recommended extension to our
repository at Shannon's request.

### Description
When you open this repository in VS Code you will see this prompt
2023-04-19 17:32:47 +00:00
Shawn Callegari 40891424a8 Plan object execution capabilities (#389)
### Motivation and Context
This is the next PR in improving Planning capabilities in the Kernel. It
builds upon previous
https://github.com/microsoft/semantic-kernel/pull/255 to enable
execution of plans and improves the ability to create plans.

### Description
- Rename the Plan class to SKPlan and add support for invoking functions
as part of the plan execution.
- Add a new class for executing plans, and remove the unused PlanRunner
class.
- Add unit and integration tests for the planning functionality and a
test email skill.
- Fix some minor issues and add documentation and comments to the
planning classes and tests.
- Update the VS Code tasks and editor config files to improve the
development experience.
2023-04-12 14:31:58 -07:00
Lee Miller 3a4d497c48 Integrate use of embeddings to determine related skills returned from FunctionView (#67)
### Motivation and Context

This pull request introduces several changes to the planner skill, which
is a core skill that allows users to create and execute plans based on
semantic queries. The motivation and context for these changes are as
follows:

- The changes improve the functionality and usability of the planner
skill by adding several parameters and options to the planner skill
functions, such as relevancy threshold, max functions, excluded
functions, excluded skills, and included functions. These parameters
allow users to customize the filtering and selection of registered
functions based on their goals and preferences.
- The changes enable the planner skill to filter the available functions
based on a semantic query and the relevance score from the memory
provider. This allows users to specify a natural language query that
matches their intent and get the most relevant functions to execute.
This feature enhances the planner skill's ability to generate and
execute plans that are relevant, efficient, and customizable for
different goals and scenarios.
- The changes improve the user experience of the kernel syntax examples
by adding more semantic skills and demonstrating how to use the planner
skill to create a plan for a complex task.

These changes do not fix any open issues, but they are related to the
ongoing development and improvement of the planner skill and the kernel
framework. They also improve the test coverage and code quality of the
planner skill, which is a key feature of the semantic kernel framework.
2023-03-23 19:29:19 -07:00
b89c0faf6c Sample 4: Using memory and embeddings with GitHub (#94) (#96)
### Motivation and Context
This sample continues in the spirit of prior samples in the samples/apps
folder with a goal of teaching developers how the concepts of memory and
embeddings can be integrated.

### Description
This sample includes a frontend app that allows the developer to enter
the address of a publicly available Github repository, which is
downloaded to the temp directory of the machine hosting the
KernelHttpService sample application (can be the same machine).

Once downloaded the developer is able to have a conversation with the
repository and see the impact of the relevance slider on the responses.

---------

Co-authored-by: Craig Presti <[email protected]>
Co-authored-by: teresaqhoang <[email protected]>
Co-authored-by: markwallace-microsoft <[email protected]>
Co-authored-by: Tao Chen <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Adrian Bonar <[email protected]>
2023-03-21 19:28:27 -07:00
Lee Miller b766b75eca Add HTTP retry logic and cancellation support for OpenAI services (#58)
### Motivation and Context

This set of code changes is required to improve the performance and
usability of the OpenAI completion backend by refactoring the kernel
retry mechanism and adding a new http retry delegating handler.
Specifically, it addresses the following problems:

1. The existing retry mechanism for kernel requests was using a custom
interface that made it difficult to customize and maintain the retry
logic. By refactoring it to use a delegating handler factory, we can
simplify the configuration of semantic skills and improve the
consistency and flexibility of the retry logic.

2. The existing retry handler did not take advantage of the Retry-After
value from the response headers to determine the backoff duration, which
can improve the efficiency and reliability of the requests. By adding a
new handler that does this, we can reduce the number of unnecessary
retries and improve the response times for the requests.

### Description

#### Kernel 
- Added a new abstraction for creating HTTP retry handlers, the
`IDelegatingHandlerFactory` interface, which allows using the built-in
`HttpClient` retry logic and injecting custom retry policies.
- Added a new class `DefaultHttpRetryHandlerFactory` that implements a
configurable retry policy based on the `KernelConfig.HttpRetryConfig`
settings. This factory is used by default when creating a kernel, unless
a different factory is specified.
- Added a new class `NullHttpRetryHandlerFactory` that creates a no-op
retry handler, useful for testing or disabling retries.
- Added support for cancellation tokens and retry handlers in the OpenAI
services classes, such as `AzureTextCompletion`, `AzureTextEmbeddings`,
and `OpenAITextCompletion`. This allows the callers to cancel the
requests and handle transient failures more gracefully.
- Added unit tests for the `DefaultHttpRetryHandler` class, which is
responsible for handling HTTP retries. The tests cover various scenarios
such as retrying on different status codes, retrying on different
exception types, and respecting the retry configuration parameters.
- Removed the unused `IRetryMechanism` and `PassThroughWithoutRetry`
classes, and the `Example08_RetryMechanism.cs` file.
- Refactored the `KernelConfig` class to expose the `HttpRetryConfig`
and the `HttpHandlerFactory` properties.
- Refactored the `Kernel` class to use the `HttpHandlerFactory` instead
of the `RetryMechanism` for invoking the pipeline functions.
- Updated the `KernelBuilder` sample to show how to use a custom retry
handler factory.
- Updated the documentation and the code style accordingly.

#### Kernel-Syntax-Examples
This pull request adds two new classes to the Reliability namespace that
implement different retry policies for HTTP requests. The first class,
`RetryThreeTimesWithBackoff`, retries a request three times with an
exponential backoff if it encounters a 429 (Too Many Requests) or 401
(Unauthorized) status code. The second class,
`RetryThreeTimesWithRetryAfterBackoff`, also retries three times, but
uses the value of the Retry-After header to determine the backoff
duration. Both classes use Polly to implement the retry logic and log
the outcome of each attempt using the ILogger interface.

The pull request also modifies the `ConsoleLogger` class to filter out
log messages from the System namespace with a level lower than Warning.
This is to reduce the noise from the HttpClient and DelegatingHandler
classes.
This pull request introduces several improvements and features related
to the HTTP retry logic and the OpenAI services. The main changes are:
2023-03-14 15:58:05 -07:00
Lee Miller 81b9c6c6bc Update VSCode launch and task settings and add code coverage option (#46)
Quality of life changes for development in the repository using VSCode.

- Fixes the program and cwd paths in the launch.json file for the
KernelSyntaxExamples project
- Adds comments and clarifies the arguments for the R# check and cleanup
tasks in the tasks.json file
- Adds a new task to run the Semantic-Kernel tests with code coverage
enabled and output the results in lcov format
- Removes some trailing whitespace in the Directory.Packages.props file
2023-03-09 15:54:41 -08:00
Craig Presti c5105af125 Rename SemanticKernelFunction to KernelHttpServer (#25)
### Motivation and Context
The Semantic Kernel naming convention of Skills and Functions can cause
confusion with the naming of the Azure Function sample project.

### Description
This PR renames the api-azure-function folder and
SemanticKernelFunction.csproj file to `KernelHttpServer`. All references
have been updated to point to the new folder.
2023-03-07 01:11:14 -08:00
Lee Miller 8195acd594 Add retry mechanism and cancellation token support for kernel execution and update samples (#9)
### Motivation and Context
This PR adds a retry mechanism for kernel execution, to handle cases
where the AI service might throw an exception or return an error. It
also adds a cancellation token parameter to the retry mechanism, to
allow callers to cancel the operation if needed. Additionally, it
updates the samples to use the new features and fixes some paths in the
tasks.json file.
<!--
1. Why are these changes required?
These changes are required to improve the robustness and usability of
the kernel execution, by providing a way to handle errors and abort the
operation if necessary.
2. What problems do they solve?
They solve the problems of having to handle errors manually, and having
to wait for the operation to finish even if the caller no longer needs
the result.
3. What scenarios do they contribute to?
They contribute to scenarios where the caller may encounter errors or
timeouts from the AI service, or may want to cancel the operation due to
user input or other reasons.
4. If they fix an open issue, please link to the issue here.
N/A
-->


### Description
The main change in this PR is the addition of a new interface,
IRetryMechanism, which defines a method for executing an action with
retry logic and a cancellation token. The Kernel class now uses an
instance of this interface to execute the kernel functions, wrapping the
invocation in a try-catch block and using the logger to log any errors.
The default implementation of IRetryMechanism is
PassThroughWithoutRetry, which simply executes the action without any
retry logic or cancellation support. However, users can provide their
own implementations of IRetryMechanism to customize the retry behavior,
such as the RetryThreeTimes and RetryThreeTimesWithBackoff classes in
the samples.

The PR also updates the samples to use the new retry mechanism and
cancellation token, by passing an instance of IRetryMechanism and a
CancellationToken to the Kernel.Builder method. The samples demonstrate
how to use different retry strategies for different scenarios, such as
throttling or transient errors, and how to cancel the operation if
needed. Additionally, the PR fixes some paths in the tasks.json file,
which were pointing to the wrong folder for the kernel syntax examples
project.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [X] The code builds clean without any errors or warnings
- [X] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [X] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄

### Up Next
These changes are to get the repo back to a previous state. Things will
change here as we look to make the RetryMechanism more generic, enabling
users to configure timeouts, headers, etc. Additonally, there is desire
to make this configurable per function rather than per kernel instance.

<!-- Thank you for your contribution to the semantic-kernel repo! -->
2023-03-01 10:32:49 -08:00
Devis Lucato 89fe9a9ce3 First commit, let the journey begin! 2023-02-24 16:38:23 -08:00