Commit Graph
44 Commits
Author SHA1 Message Date
dependabot[bot] 32c6441674 .Net: Bump Microsoft.Azure.Functions.Worker from 1.16.0 to 1.17.0 in /dotnet (#1936)
Bumps
[Microsoft.Azure.Functions.Worker](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.16.0 to 1.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-functions-dotnet-worker/releases">Microsoft.Azure.Functions.Worker's
releases</a>.</em></p>
<blockquote>
<h2>Microsoft.Azure.Functions.Worker 1.17.0</h2>
<h2>What's Changed</h2>
<h3>Microsoft.Azure.Functions.Worker (metapackage) 1.17.0</h3>
<ul>
<li>Nothing</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Core 1.13.0</h3>
<ul>
<li>Nothing</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Grpc 1.12.0</h3>
<ul>
<li>bumping grpc packages by <a
href="https://github.com/brettsam"><code>@​brettsam</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/1719">Azure/azure-functions-dotnet-worker#1719</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.16.0...1.17.0">https://github.com/Azure/azure-functions-dotnet-worker/compare/1.16.0...1.17.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/68cb6ca7e3c93753d76d31eaf982a7584672b28a"><code>68cb6ca</code></a>
bumping grpc packages (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1719">#1719</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/f3b49344ea3ce15a7aa7ac54db5b456dd80b7a6d"><code>f3b4934</code></a>
Reset release notes for Worker and SDK packages</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/6910409b8b3090215c4807f392820aa8c4396258"><code>6910409</code></a>
[Source Gen] Add retry options diagnostic descriptors (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1683">#1683</a>)</li>
<li>See full diff in <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.16.0...1.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Functions.Worker&package-manager=nuget&previous-version=1.16.0&new-version=1.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 05:11:25 +00:00
Shawn CallegariandGina Triolo 78804077a9 Updating dotnet samples to 17.230704.3 (#1886)
Also included:
 - Removing FileCompression project
   - no longer used
 - Merging GitHubSkill into KernelHttpServer
- rename to GitHubPlugin (...the first of many to receive such
treatment)
- this is where it's used, and it will allow us to instantiate the
github skill without passing the access token as a context variable
(this change not yet implemented).
 - Removing LoadPromptsFromCloud
- we are moving to a "plugin-first" approach - loading plugins, not raw
prompts. This approach is no longer recommended.

Resolves https://github.com/microsoft/semantic-kernel/issues/1876

---------

Co-authored-by: Gina Triolo <[email protected]>
2023-07-10 16:01:44 +00:00
dependabot[bot]andShawn Callegari e7d9d5d14c Bump Microsoft.Azure.Functions.Worker from 1.15.0 to 1.16.0 in /dotnet (#1824)
Bumps
[Microsoft.Azure.Functions.Worker](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.15.0 to 1.16.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-functions-dotnet-worker/releases">Microsoft.Azure.Functions.Worker's
releases</a>.</em></p>
<blockquote>
<h2>Microsoft.Azure.Functions.Worker 1.16.0</h2>
<h2>What's Changed</h2>
<!-- raw HTML omitted -->
<h3>Microsoft.Azure.Functions.Worker (metapackage) 1.16.0</h3>
<h3>Microsoft.Azure.Functions.Worker.Core 1.13.0</h3>
<ul>
<li>Fixed issue spawning child process while debugging due to
&quot;DOTNET_STARTUP_HOOKS&quot; always containing
&quot;Microsoft.Azure.Functions.Worker.Core&quot;. (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1539">#1539</a>)</li>
<li>Add retry options support to <code>IFunctionMetadata</code> (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1548">#1548</a>)</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Grpc 1.11.0</h3>
<ul>
<li>Add handling for retry options in worker-indexing grpc communication
path (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1548">#1548</a>)</li>
<li>Update protobuf to v1.9.0-protofile, which includes gRPC messages
for retry-options in worker-indexing scenarios. (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1545">#1545</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Azure/azure-functions-dotnet-worker/commits/1.16.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Functions.Worker&package-manager=nuget&previous-version=1.15.0&new-version=1.16.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shawn Callegari <[email protected]>
2023-07-08 03:03:10 +00:00
dependabot[bot] 4e27f32bd2 Bump Microsoft.Azure.Functions.Worker.Sdk from 1.10.0 to 1.11.0 in /dotnet (#1826)
Bumps
[Microsoft.Azure.Functions.Worker.Sdk](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.10.0 to 1.11.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-functions-dotnet-worker/releases">Microsoft.Azure.Functions.Worker.Sdk's
releases</a>.</em></p>
<blockquote>
<h2>Microsoft.Azure.Functions.Worker.Sdk 1.11.0</h2>
<h2>What's Changed</h2>
<!-- raw HTML omitted -->
<h3>Microsoft.Azure.Functions.Worker.Sdk 1.11.0 (meta package)</h3>
<ul>
<li>Update extension build project to reference
Microsoft.NET.Sdk.Functions 4.2.0</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Sdk.Generators 1.1.0-preview4</h3>
<ul>
<li>Add support for retry options (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1548">#1548</a>)</li>
<li>Bug fix for when DefaultValue is not present on an IsBatched prop
(<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1602">#1602</a>).</li>
<li>SDK changes for .NET 8.0 support (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1643">#1643</a>)</li>
</ul>
<h2>Microsoft.Azure.Functions.Worker 1.11.0-preview2</h2>
<h2>What's Changed</h2>
<ul>
<li>Adding a new worker option property to opt-in the behavior to get
empty entries in trigger payload by <a
href="https://github.com/kshyju"><code>@​kshyju</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/1091">Azure/azure-functions-dotnet-worker#1091</a></li>
</ul>
<p><em>Sample usage</em></p>
<pre><code>var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults((builder) =&gt; { }, (options) =&gt;
    {
        options.IncludeEmptyEntriesInMessagePayload = true;
    })
    .Build();
<p>host.Run();
</code></pre></p>
<ul>
<li>New overloads for <code>WriteStringAsync</code> and
<code>WriteBytesAsync</code> methods by <a
href="https://github.com/kshyju"><code>@​kshyju</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/1111">Azure/azure-functions-dotnet-worker#1111</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.11.0-preview1...1.11.0-preview2">https://github.com/Azure/azure-functions-dotnet-worker/compare/1.11.0-preview1...1.11.0-preview2</a></p>
<h2>Microsoft.Azure.Functions.Worker 1.11.0-preview1</h2>
<h2>What's Changed</h2>
<ul>
<li>Added support for surfacing user-thrown exception to App Insights
(<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/939">#939</a>)</li>
<li>Source-generated function metadata: implementation change to improve
cold-start performance (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/956">#956</a>)
<ul>
<li>This functionality requires version <code>1.8.0-preview1</code> of
<code>Microsoft.Azure.Functions.Worker.Sdk</code> or higher.</li>
</ul>
</li>
</ul>
<p>Steps for opting into the source-generation preview:</p>
<ol>
<li>Add MSBuild property
<code>&lt;FunctionsEnableWorkerIndexing&gt;true&lt;/FunctionsEnableWorkerIndexing&gt;</code>
app's <code>.csproj</code> file.</li>
<li>In <code>local.settings.json</code> add the property
<code>&quot;AzureWebJobsFeatureFlags&quot;:
&quot;EnableWorkerIndexing&quot;</code> to configure the Azure Functions
host to use worker-indexing.</li>
<li>Call the <code>IHostBuilder</code> extension,
<code>ConfigureGeneratedFunctionMetadataProvider</code> in
<code>Program.cs</code>:</li>
</ol>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/a6322a3eb70bb6df93a9b22950c7bd50f8157e97"><code>a6322a3</code></a>
Updating gRPC package version</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/bdc8f0417e86db1ad1120f0de100de990118af9a"><code>bdc8f04</code></a>
Removing preview for SDK release</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/060d97d047c8f0e0824bdc1346a24704152e9236"><code>060d97d</code></a>
Cleanup analyzer rules (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1686">#1686</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/ccb3e0c3e93ccc590c42cba9e5543fe29d9cac55"><code>ccb3e0c</code></a>
Updating Worker packages for release</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/f80b0025e755ac6e21526ec0afee7fdef0a09c4f"><code>f80b002</code></a>
Updating ASP.NET Core integration preview version</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/a79adf4b8ecd86445e1aac9154541ada264a06e2"><code>a79adf4</code></a>
Fix symbol to NET5_0_OR_GREATER (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1662">#1662</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/d3414ddd08144cf68c556a0c706468603e01cefd"><code>d3414dd</code></a>
Remove http proxy sample from FunctionApp (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1663">#1663</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/240d5ffeb25020aa54c6afeb225ff20d00de8759"><code>240d5ff</code></a>
Add SignalR test project to sln file (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1664">#1664</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/ee532e7e1764a1dbe3cd7fedfbbdfa58489da2b0"><code>ee532e7</code></a>
Update release notes.</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/ed86b21b63222f60e02901170cf857d23decc3f3"><code>ed86b21</code></a>
Setting _ToolingSuffix for V8.0 TargetFrameworkVersion</li>
<li>Additional commits viewable in <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.10.0...sdk-1.11.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Functions.Worker.Sdk&package-manager=nuget&previous-version=1.10.0&new-version=1.11.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-04 05:28:56 +00:00
dependabot[bot]andShawn Callegari 57b7f09e4b Bump Microsoft.Azure.Functions.Worker from 1.14.1 to 1.15.0 in /dotnet (#1721)
Bumps
[Microsoft.Azure.Functions.Worker](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.14.1 to 1.15.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-functions-dotnet-worker/releases">Microsoft.Azure.Functions.Worker's
releases</a>.</em></p>
<blockquote>
<h2>Microsoft.Azure.Functions.Worker 1.15.0-preview1</h2>
<h2>What's Changed</h2>
<h3>Microsoft.Azure.Functions.Worker (metapackage)</h3>
<ul>
<li>Update Microsoft.Azure.Functions.Worker.Core dependency to
1.13.0-preview1</li>
<li>Update Microsoft.Azure.Functions.Worker.Grpc dependency to
1.11.0-preview1</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Core 1.13.0-preview1</h3>
<ul>
<li>Implementation for bypass deferred binding (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1462">#1462</a>/<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1495">#1495</a>)</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Grpc 1.11.0-preview1</h3>
<ul>
<li>Implementation for bypass deferred binding (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1462">#1462</a>/<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1495">#1495</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.14.1...1.15.0-preview1">https://github.com/Azure/azure-functions-dotnet-worker/compare/1.14.1...1.15.0-preview1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Azure/azure-functions-dotnet-worker/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Functions.Worker&package-manager=nuget&previous-version=1.14.1&new-version=1.15.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shawn Callegari <[email protected]>
2023-06-29 20:12:32 +00:00
f17a0a1df8 Adding option to use private PAT token on GitHub Q&A sample (#713)
### Motivation and Context

1. Why is this change required? What problem does it solve? What
scenario does it contribute to?

Most integrations of OpenAPI and Semantic Kernel would have the
motivation to integrate it with private information or non-public data.
GitHub Q&A is an amazing sample, and be able to try it with private
repositories it is a very straightforward way to solve scenarios where
customers and users want to try it with private data.

Fixes #444 

### Description

* Added a new Input in the React App, this is a password type of input.
I decided to not include this pat token as part of the verification if
it is a different repo.
* In the GitHub skill I added the PatToken parameter using the existing
context variables pattern. I saw this as straightforward since the
PatToken may be used for other GitHub skill features.
* WebFileDownloadSkill is modified to receive any additional headers to
the request. I see that WebFileDownloadSkill could have had 3 ways to
modify the headers of the request: 1) modify the constructor and class
to receive and/or make HttpClient public, 2) Add the headers as part of
the context variables received, 3) Override the download methods
available to have one that specifically receive custom headers. I
decided to use 3 to have the minimal impact in existing code (and
tests), although I could see 2 could also be a good approach. Then the
GitHub skill detects that an authorization header is necessary, and
calls the specific overrided method.

### Pending

* Add Unit and/or integration tests.

### 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`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Adrian Bonar <[email protected]>
Co-authored-by: Harleen Thind <[email protected]>
Co-authored-by: Craig Presti <[email protected]>
Co-authored-by: Adrian Bonar <[email protected]>
2023-06-22 00:06:18 +00:00
Teresa Hoang 28181d7e55 Stabilizing Book Creator Sample: Updating sk nuget and switching to ActionPlanner (#1613)
### 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 works primarily to stabilize the Book Creator sample app by:
- Updating KernelHttpServer to use latest SK nuget version
(0.16.230615.1-preview)
- Using ActionPlanner over SequentialPlanner

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
A lot of the issues detailed in this issue resulted from using
SequentialPlanner without gpt-4:
https://github.com/microsoft/semantic-kernel/issues/1542

+ Verified that updates to KernelHttpServer doesn't break any of the
other sample apps

### 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 😄
2023-06-21 18:33:53 +00:00
dependabot[bot] 939607dc84 Bump Microsoft.SemanticKernel.Skills.MsGraph from 0.15.230531.5-preview to 0.16.230615.1-preview in /dotnet (#1561)
Bumps
[Microsoft.SemanticKernel.Skills.MsGraph](https://github.com/microsoft/semantic-kernel)
from 0.15.230531.5-preview to 0.16.230615.1-preview.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/microsoft/semantic-kernel/releases">Microsoft.SemanticKernel.Skills.MsGraph's
releases</a>.</em></p>
<blockquote>
<h2>dotnet-0.16.230615.1-preview</h2>
<h2>NuGet Packages</h2>
<p><strong>Core:</strong>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel/0.16.230615.1-preview">Microsoft.SemanticKernel.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Abstractions/0.16.230615.1-preview">Microsoft.SemanticKernel.Abstractions.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Core/0.16.230615.1-preview">Microsoft.SemanticKernel.Core.0.16.230615.1-preview</a></p>
<p><strong>Connectors.AI:</strong>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.AI.HuggingFace/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.AI.HuggingFace.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.AI.OpenAI/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.AI.OpenAI.0.16.230615.1-preview</a></p>
<p><strong>Connectors.Memory:</strong>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.DuckDB/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.DuckDB.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.Pinecone/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.Pinecone.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.Postgres/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.Postgres.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.Qdrant/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.Qdrant.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.Redis/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.Redis.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.Sqlite/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.Sqlite.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Memory.Weaviate/0.16.230615.1-preview">Microsoft.SemanticKernel.Connectors.Memory.Weaviate.0.16.230615.1-preview</a></p>
<p><strong>Planning:</strong>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Planning.ActionPlanner/0.16.230615.1-preview">Microsoft.SemanticKernel.Planning.ActionPlanner.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Planning.SequentialPlanner/0.16.230615.1-preview">Microsoft.SemanticKernel.Planning.SequentialPlanner.0.16.230615.1-preview</a></p>
<p><strong>Skills:</strong>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Skills.Document/0.16.230615.1-preview">Microsoft.SemanticKernel.Skills.Document.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Skills.Grpc/0.16.230615.1-preview">Microsoft.SemanticKernel.Skills.Grpc.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Skills.MsGraph/0.16.230615.1-preview">Microsoft.SemanticKernel.Skills.MsGraph.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Skills.OpenAPI/0.16.230615.1-preview">Microsoft.SemanticKernel.Skills.OpenAPI.0.16.230615.1-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Skills.Web/0.16.230615.1-preview">Microsoft.SemanticKernel.Skills.Web.0.16.230615.1-preview</a></p>
<h2>What's Changed</h2>
<ul>
<li>OpenAPIDocumentParser class clean-up. by <a
href="https://github.com/SergeyMenshykh"><code>@​SergeyMenshykh</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1390">microsoft/semantic-kernel#1390</a></li>
<li>Bump Microsoft.Identity.Web from 2.11.0 to 2.11.1 in /dotnet by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1430">microsoft/semantic-kernel#1430</a></li>
<li>Http consistency: Azure Cognitive Search Memory by <a
href="https://github.com/SergeyMenshykh"><code>@​SergeyMenshykh</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1426">microsoft/semantic-kernel#1426</a></li>
<li>TextCompletion Fixes + Interface simplification by <a
href="https://github.com/RogerBarreto"><code>@​RogerBarreto</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1391">microsoft/semantic-kernel#1391</a></li>
<li>Add support for overlap between paragraphs when using TextChunker to
split text by <a
href="https://github.com/MonsterCoder"><code>@​MonsterCoder</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1206">microsoft/semantic-kernel#1206</a></li>
<li>Http consistency: Weaviate by <a
href="https://github.com/SergeyMenshykh"><code>@​SergeyMenshykh</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1479">microsoft/semantic-kernel#1479</a></li>
<li>Add Grounding Skill to Samples by <a
href="https://github.com/riedgar-ms"><code>@​riedgar-ms</code></a> in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1064">microsoft/semantic-kernel#1064</a></li>
<li>SKFunction should return Task<!-- raw HTML omitted --> by <a
href="https://github.com/feiyun0112"><code>@​feiyun0112</code></a> in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1334">microsoft/semantic-kernel#1334</a></li>
<li>Add chat system prompt option for text completion by <a
href="https://github.com/lemillermicrosoft"><code>@​lemillermicrosoft</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1465">microsoft/semantic-kernel#1465</a></li>
<li>Fix day format in TimeSkill by <a
href="https://github.com/lemillermicrosoft"><code>@​lemillermicrosoft</code></a>
in <a
href="https://redirect.github.com/microsoft/semantic-kernel/pull/1466">microsoft/semantic-kernel#1466</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/microsoft/semantic-kernel/compare/dotnet-0.15.230609.2-preview...dotnet-0.16.230615.1-preview">https://github.com/microsoft/semantic-kernel/compare/dotnet-0.15.230609.2-preview...dotnet-0.16.230615.1-preview</a></p>
<h2>dotnet-0.15.230609.2-preview</h2>
<h2>NuGet Packages</h2>
<p><a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel/0.15.230609.2-preview">Microsoft.SemanticKernel.0.15.230609.2-preview</a>
<a
href="https://www.nuget.org/packages/Microsoft.SemanticKernel.Abstractions/0.15.230609.2-preview">Microsoft.SemanticKernel.Abstractions.0.15.230609.2-preview</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/7e26b07f102595ae07cfaa4267be416f34e29376"><code>7e26b07</code></a>
AzureCognitiveSearch NuGet package fixes</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/2b85ccd470b902febf2bec2a66c47761ed279b92"><code>2b85ccd</code></a>
Python: Fix windows runtime error: adapt asyncio event loop policy for
window...</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/e30229a0a572d2f429d5630b30a57a2d4cc2636b"><code>e30229a</code></a>
Fix day format in TimeSkill (<a
href="https://redirect.github.com/microsoft/semantic-kernel/issues/1466">#1466</a>)</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/fa8b8b7d280c2950bc32dc0f01270653631b15a8"><code>fa8b8b7</code></a>
Add chat system prompt option for text completion (<a
href="https://redirect.github.com/microsoft/semantic-kernel/issues/1465">#1465</a>)</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/32a11857e42c2d0dc340824760e452b5244d2245"><code>32a1185</code></a>
SKFunction should return Task&lt;string&gt; (<a
href="https://redirect.github.com/microsoft/semantic-kernel/issues/1334">#1334</a>)</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/4b68d6a1e383e98e8258f2acf440a2bddc985ba0"><code>4b68d6a</code></a>
Add Grounding Skill to Samples (<a
href="https://redirect.github.com/microsoft/semantic-kernel/issues/1064">#1064</a>)</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/87419e4f305b03b00bda4261eaf53a1ff13f4d2d"><code>87419e4</code></a>
Http consistency: Weaviate (<a
href="https://redirect.github.com/microsoft/semantic-kernel/issues/1479">#1479</a>)</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/49d79d9b4d0c05968fabe4f64b1c630d16ecbc9b"><code>49d79d9</code></a>
Add support for overlap between paragraphs when using TextChunker to
split te...</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/15fc47e536883d4c772bfaaac4f70441bc9852bb"><code>15fc47e</code></a>
LogInformation placeholder bug fix (<a
href="https://redirect.github.com/microsoft/semantic-kernel/issues/1497">#1497</a>)</li>
<li><a
href="https://github.com/microsoft/semantic-kernel/commit/bbe84e07cb6c781e1ec77ffcc026d59e1e9674a0"><code>bbe84e0</code></a>
CopilotChat: Refactor deployment scripts for reusability and
pipelines/workfl...</li>
<li>Additional commits viewable in <a
href="https://github.com/microsoft/semantic-kernel/compare/dotnet-0.15.230531.5-preview...dotnet-0.16.230615.1-preview">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.SemanticKernel.Skills.MsGraph&package-manager=nuget&previous-version=0.15.230531.5-preview&new-version=0.16.230615.1-preview)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-21 01:02:11 +00:00
Shawn Callegari a0225254d8 Update the samples/dotnet projects to SK NuGet v0.15 (#1296)
### Description
Updating samples/dotnet projects to the latest SK NuGets.
All builds are clean -- no warnings or obsolete messages.
2023-06-01 15:02:38 -07:00
Craig Presti b4a4e9cbb2 Fix KernelHttpServer regression due to change in kernel signatures (#1279)
A change to the method signature of the kernel config extensions broke
the KernelHttpServer and all sample projects that are dependent on it.

This PR remediates and adds support for chat completion endpoints
instead of text completion endpoints.
2023-05-30 22:12:08 +01:00
Shawn Callegari 9faa7e9350 DotNet Samples use NuGet packages (#1234)
### Motivation and Context
- standalone sample projects -- if you copy a project out and run it, it
should work on its own, without relative includes and references to
other files/projects from the repo
- version lock -- ensures a sample will work with the currently-released
NuGet packages, reducing confusion for those using these projects as
references
- separation of interests -- samples are written & updated independent
of the Kernel core, which will make it easier to apply a branching
strategy, or even separate the repos, as the project grows

### Description
- Sample projects get their SK packages via public nuget channel, rather
than project references.
- Excluded: KernelSyntaxExamples maintains its direct ProjectReference
to the Kernel, as it changes along with the Kernel core. In a future
change, we'll likely move this project under the /dotnet folder so that
it's closer to the (dotnet) Kernel itself.
- Sample projects no longer have relative path includes to common props
files, and are self-contained
- New Directory.Build.* files are added to the samples/dotnet folder --
these are not required for the projects, but they do apply the code
analyzers across all the sample projects, ensuring code quality in the
repo.
2023-05-26 18:36:58 -07:00
af03e00a79 Feature serviceregistry (#993)
### Motivation, Context and Description

This PR introduces several changes aimed to simplify the kernel and
enhancing its extensibility for AI services management. The changes
include the following:

1. Kernel simplification and extensibility: The code responsible for AI
services management, such as registration and resolution, has been moved
out of the Kernel and KernelConfig classes into a new class called
AIServiceProvider. This restructuring promotes the principle of Single
Responsibility, ensuring that each class has a clear and focused
purpose.

2. Hosting apps customization: With the introduction of the
AIServiceProvider, hosting applications now have the flexibility to
provide their own implementation of the provider if needed. This
promotes extensibility, allowing the hosting apps to tailor the AI
service management according to their specific requirements.

3. AI services registration improvements: A new method called
WithAiService has been added, which enables the registration of any new
AI service that is not currently supported.

4. Improved kernel builder interface: The Add* methods for AI services
registration have been moved from the KernelConfig class to the
KernelBuilder. This change aligns the interface with other KernelBilder
methods, such as WithLogger and WithMemory, creating a more cohesive and
intuitive kernel builder interface.

---------

Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
2023-05-22 15:21:48 -07:00
Shawn Callegari c0ab238f58 Azure Functions net7.0 Support (#1126)
### Description
KernelHttpServer Azure Functions project targets net6.0. Building with
net7.0 SDK succeeds, but then running it in an environment with only a
net7.0 runtime installed fails, as it requires the net6.0 runtime to
boot.

With this change, we apply the `<RollForward>LatestMajor</RollForward>`
MSBuild tag to the KernelHttpServer csproj file. This instructs the
project to target the highest version of dotnet installed (min net6.0).
2023-05-22 14:36:58 -07:00
Devis Lucato 32fbc90aa7 Fix code style and xmldocs, add Roslynator analyzer (#1030)
Add [Roslynator](https://github.com/JosefPihrt/Roslynator) and fix some
code style issues found.

`dotnet_analyzer_diagnostic.severity` is set to `none` to stop `dotnet
format` from editing a lot of files, even unrelated issues, probably
detected by other analyzers, and a lot of issues are disabled. Currently
only these are enabled:

```
dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line.
dotnet_diagnostic.RCS1037.severity = warning # Remove trailing white-space.
dotnet_diagnostic.RCS1097.severity = warning # Remove redundant 'ToString' call.
dotnet_diagnostic.RCS1138.severity = warning # Add summary to documentation comment.
dotnet_diagnostic.RCS1168.severity = warning # Parameter name 'foo' differs from base name 'bar'.
dotnet_diagnostic.RCS1175.severity = warning # Unused 'this' parameter 'operation'.
dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal.
dotnet_diagnostic.RCS1139.severity = warning # Add summary element to documentation comment.
dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause.
dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string.
dotnet_diagnostic.RCS1225.severity = warning # Make class sealed.
dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment.
```

Note: 
* There are a lot more issues to fix, for now I disabled a lot of checks
and fixed only a bunch.
* Future: enable more of `dotnet_diagnostic.RCS` currently disabled,
e.g. XMLDoc checks, to get better code docs

Other fixes:
* fix incorrect namespaces in copilot chat
* use static property for regex
* typos, missing copyright
* switch from CA1032 to RCS1194 to cover more exception ctors
2023-05-17 12:16:21 -07:00
Adrian Bonar 75f2f9d519 Update samples to use 'chat' completion models rather than text completion models (#1001)
### Motivation and Context
Chat completion models are requested and can be significantly less
expensive.

### Description
- Update KernelHttpServer to use chat completion models
- Added notes to sample READMEs
2023-05-15 18:49:04 +00:00
dependabot[bot] dac05fc26c Bump Microsoft.Azure.Functions.Worker from 1.13.0 to 1.14.1 in /dotnet (#862)
Bumps
[Microsoft.Azure.Functions.Worker](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.13.0 to 1.14.1.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 16:36:37 -07:00
dependabot[bot]andAdrian Bonar 276393cb93 Bump Microsoft.Azure.Functions.Worker.Sdk from 1.9.0 to 1.10.0 in /dotnet (#760)
Bumps
[Microsoft.Azure.Functions.Worker.Sdk](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.9.0 to 1.10.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-functions-dotnet-worker/releases">Microsoft.Azure.Functions.Worker.Sdk's
releases</a>.</em></p>
<blockquote>
<h2>Microsoft.Azure.Functions.Worker 1.10.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump gRPC dependencies to latest version (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1085">#1085</a>)</li>
</ul>
<h2>Microsoft.Azure.Functions.Worker.Sdk 1.10.0</h2>
<h2>What's Changed</h2>
<ul>
<li>[Source Gen] Cleanup by <a
href="https://github.com/satvu"><code>@​satvu</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/1453">Azure/azure-functions-dotnet-worker#1453</a></li>
<li>Add support for additional authentication scenarios. by <a
href="https://github.com/vijayrkn"><code>@​vijayrkn</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/1486">Azure/azure-functions-dotnet-worker#1486</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/sdk-1.9.0...sdk-1.10.0">https://github.com/Azure/azure-functions-dotnet-worker/compare/sdk-1.9.0...sdk-1.10.0</a></p>
<p><strong>Nuget package</strong>: <a
href="https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk/1.10.0">https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk/1.10.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/7d659ced053af41d58274ea4a36d2b5db2138750"><code>7d659ce</code></a>
Bump gRPC dependencies (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1085">#1085</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/0ed601ef86e92ac559cecd8a6b3767b75f19f202"><code>0ed601e</code></a>
Add Source Generator Analyzer Rules (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1048">#1048</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/e2df0bbbf88b5df50248c2efa2b808cf191abcd1"><code>e2df0bb</code></a>
Update release_notes.md (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1079">#1079</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/b42a2a57eb1be1e7741219f0a091e3408d30bdf5"><code>b42a2a5</code></a>
[Samples] Update extensions sample project (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1072">#1072</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/5f39de6200451d5af02cffc5efb2c6a09ed4d418"><code>5f39de6</code></a>
[Samples] Update configuration sample project (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1073">#1073</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/1f7a321d88b2f66f792f3889ba7683d83ff45b92"><code>1f7a321</code></a>
[Samples] Updated EF sample project to NET 6 &amp; V4 (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1068">#1068</a>)</li>
<li><a
href="https://github.com/Azure/azure-functions-dotnet-worker/commit/acffe91b19dd8c36e75a2ae52d2e38c6e66d6d3d"><code>acffe91</code></a>
[Samples] Updated the exception handling middleware sample to handle
multiple...</li>
<li>See full diff in <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.9.0...1.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Functions.Worker.Sdk&package-manager=nuget&previous-version=1.9.0&new-version=1.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adrian Bonar <[email protected]>
2023-05-08 16:04:49 +00:00
Adrian Bonar 0651d20b34 Roll back default language version from 11 to 10 (#799)
### Motivation and Context
C# 11 requires .NET 7+ and we would like to keep the requirement at .NET
6 for now.

- includes a minor cosmetic cleanup for the user-agent name in example
21
2023-05-04 00:57:37 +00:00
Stephen Toub 46e4440400 Fix concurrency issues and double lookups in SkillCollection (#603)
### Motivation and Context

Fix concurrency issues in SkillCollection and reduce overhead and
duplication.

### Description

If multiple threads concurrently call AddSemantic/NativeFunction, and
the skill in question didn't yet exist, both threads could try to add a
new collection for that skill. But they're doing so with the indexer,
which means one of them could overwrite the one added by the other,
which could already have progressed to store the target function into
that collection. At that point, data could be lost. By using TryAdd
instead of the indexer, we can avoid such overwrites, and by using
GetOrAdd, we can simplify the whole pattern.

Further, throughout the SkillCollection, there are places where we're
looking up into dictionaries twice, first to do a ContainsKey and then
subsequently to get the value for that key; better to just use
TryGetValue to do the lookup once.

There was also duplication between routines for semantic and native
functions, which could be collapsed with single helpers.
2023-05-03 14:54:55 -07:00
Devis Lucato e8dced1f7c Fix typos and code style (#741)
* Fix filename containing a space (`ApiKeyAuthenticationHandler .cs`)
* Fix typos
* Fix code style
* Add missing rule for local constants
* Add commented code to automate code style checks. These don't work
with .NET Standard 2.0, so we'll need some extra research.
* Fix one incorrect ILogger naming
* Add some TODOs about unused code
* Fix xmldocs
2023-05-01 17:45:35 +00:00
Devis LucatoandAdrian Bonar 57cbc93d05 API simplification: make AI service ID optional (#744)
### Motivation and Context

When configuring AI models (text completion, embeddings, chat, image
generation, etc) currently one has to pass a "service Id", ie assign a
name to the configuration. This allows apps to work with different
models providing the same features, e.g. working with OpenAI and Azure
OpenAI and HuggingFace at the same time.

In many scenarios though, there is only one AI model/service provider,
e.g. an app might be using just Open AI, and in this case service names
are unused.

Also, the kernel config API allows to remove AI models from the
configuration, a tentative feature that has never been used and can be
removed for now, and reintroduced if we find scenarios or get explicit
requests.

### Description

* Make the Service ID optional, making the AI configuration simpler
* Remove some unused API, reducing the complexity of kernel config

Co-authored-by: Adrian Bonar (HE/HIM) <[email protected]>
2023-05-01 17:33:29 +00:00
Devis Lucato 2607c14b0d Add C# simple planner (#598)
### Motivation and Context

Need for a simple planner showing how to leverage semantic functions to
implement Intent Detection pattern and turn it into a planner, selecting
a function given a goal.

The planner also allows to provide a Planning capability using less
powerful models, like GPT3 (text-davinci-002) and GPT3.5
(text-davinci-003, GPT turbo 3.5), where often the more advanced planner
can hallucinate.

Fix one bug in "WriterSkill/ShortPoem/skprompt.txt" leading to incorrect
results when the goal was missing a termination (period or new line)

### Description

* New package `Microsoft.SemanticKernel.Planning.ActionPlanner`extending
the Planning namespace. The package is automatically installed, ie it's
part of SK metapackage.
* Move SequentialPlanner into the new package
`Microsoft.SemanticKernel.Planning.SequentialPlanner` lib, part of the
metapackage
* Add new Action Planner.
* Store planner prompts to skprompt.txt, using embedded resources to
avoid files overwriting each other.
2023-04-26 20:39:41 +00:00
Stephen Toub 7a056d9743 Fix another extraneous JsonSerializerOptions instance (#602)
### Motivation and Context
JsonSerializerOptions should be cached and reused.

### Description
We already had a cached one with appropriate settings. Just needs to be
used.
2023-04-23 19:23:18 +00:00
Devis Lucato bcc19a6c19 Rename Skills and IntegrationTests folders (#596)
### Motivation and Context

Make the files a bit easier to browse in filesystem and VS, having
consistency between virtual folders and directories, and consistency
with the connectors folder.


### Description

* Rename `dotnet/src/Microsoft.Skills` to `dotnet/src/Skills`
* Rename `dotnet/src/Microsoft.IntegrationTests` to
`dotnet/src/IntegrationTests`
2023-04-21 20:45:57 -07:00
Lee Miller 77259db3e3 Remove PlannerSkill and add SequentialPlanner (#523)
### Motivation and Context
This pull request contains a series of changes that refactor and improve
the planning module and tests in the SemanticKernel project. The
planning module is responsible for creating and executing plans based on
natural language prompts and available skills. The changes aim to
simplify the code, enhance the functionality, and increase the test
coverage and quality of the planning module.

### Description
- Add a new SequentialPlanner class that uses semantic function to
generate plans from natural language prompts
- Add a new SequentialPlanParser class that parses the XML output of the
semantic function and converts it into a Plan object
- **Remove PlannerSkill**
- Rename PlannerConfig class that contains common configuration options
for planner instances, such as the maximum number of tokens, the
relevancy threshold, and the excluded or included functions
- Refactor the Plan class to make it more consistent and robust, and add
support for serialization, named outputs, and nested plans
- Add unit tests for the SequentialPlanner, SequentialPlanParser, and
Plan classes and refactor the existing planning tests to use mock
functions and skills.
- Fix a failing web skill test by skipping it due to inconsistent Bing
search results
2023-04-21 16:01:26 +00:00
Stephen Toub 11fe608069 Enable CA1852 ("Type '...' can be sealed...) (#562)
### Motivation and Context

Sealed types enables better perf. For internal/private types, there's no
downside.

### Description

Stop suppressing the analyzer rule and fix all resulting warnings.
2023-04-20 22:14:41 +00:00
Stephen Toub 9560240f7f Replace InvariantCulture{IgnoreCase} with Ordinal{IgnoreCase} (#552)
### Motivation and Context

Fix likely erroneous use of
StringComparison.InvariantCulture{IgnoreCase}.

### Description

StringComparison.InvariantCulture{IgnoreCase} is _almost_ never the
right answer (linguistic comparison rules in a culture similar to
en-US); usually Ordinal{IgnoreCase} is what's desirable, and happily is
also faster. Along the way I fixed a few things touching the code I was
updating, like some unnecessary ToUpperInvariant calls, dead methods,
and duplicate IndexOf calls.
2023-04-19 19:42:29 -07:00
Stephen Toub 99091c5358 Avoid constructing unnecessary JsonSerializerOptions (#545)
### Motivation and Context
Avoid creating new JsonSerializerOptions per operation.

### Description
They're deceptively expensive. For the default, there's no need to
specify one at all. And for other non-default options, it's best to
create a singleton and reuse it. (The cost is cheaper in .NET 7, but
there's still cost.)
2023-04-19 21:55:32 +00:00
Devis Lucato 8621c7b074 New nugets (Abstractions, Connectors.AI.OpenAI); add AAD auth, Azure ChatGPT, text+chat streaming (#420)
### Motivation and Context

New features:
* AAD auth for Azure OpenAI
* Azure ChatGPT
* Completion streaming
* Chat streaming
* log probs

### Description

* Split kernel core nuget in 3 nugets and add dependency on Azure OpenAI
SDK:
* MS.SK.Abstractions: interfaces and common classes, ideally no business
logic
  * MS.SK: SK runtime, depends on SK.Abstractions
* MS.SK.Connectors.AI.OpenAI: OpenAI/Azure OpenAI code, depends on
SK.Abstractions and Azure OpenAI SDK
* Rewrote TextCompletion, ChatCompletion, EmbeddingGeneration clients to
use Azure OpenAI SDK
* Deleted unused code. The old OpenAI client is still in use only for
DALL-E2

Note: custom retry logic doesn't work with Azure OpenAI SDK. The SDK
already retries internally, using a different approach.

Nugets:
* Microsoft.SemanticKernel.0.12.0.nupkg
* **Microsoft.SemanticKernel.Abstractions.0.12.0.nupkg**
* **Microsoft.SemanticKernel.Connectors.AI.OpenAI.0.12.0.nupkg**
* Microsoft.SemanticKernel.Connectors.Memory.Qdrant.0.12.0.nupkg
* Microsoft.SemanticKernel.Connectors.Memory.Sqlite.0.12.0.nupkg
* Microsoft.SemanticKernel.Skills.MsGraph.0.12.0.nupkg
* Microsoft.SemanticKernel.Skills.Document.0.12.0.nupkg
* Microsoft.SemanticKernel.Skills.OpenAPI.0.12.0.nupkg
* Microsoft.SemanticKernel.Skills.Web.0.12.0.nupkg
2023-04-14 12:40:05 -07:00
Roger Barreto 99ea008963 Adding Detailed Message for AIException Scenarios (#445)
### Motivation and Context

OpenAI when reaches quota limit gives a TooManyRequests Http Status
which is unclear and many times lead to think it was related to
Throttling instead of a hard quota limit error.

### Description
This change allow us to retrieve the detail of the exception regarding
what was the underlyning error from the AI Provider.

To get more details on the error if that error is AIException, you now
can get it using the `Detail` property

This change brings more clarity to the actual error when that happens
for OpenAI and AzureOpenAI completion requests.
2023-04-13 23:18:16 +00:00
Aman Sachan 9ca952fb7f added *.development.config and *.development.json to gitignore (#350)
### Description
Allows users to store secrets and other sensitive info locally and not checking it in by mistake
2023-04-07 19:38:04 +00:00
dependabot[bot]andLee Miller 8b557a1f2d Bump Microsoft.Azure.Functions.Worker.Sdk from 1.7.0 to 1.9.0 in /dotnet (#304)
Bumps
[Microsoft.Azure.Functions.Worker.Sdk](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.7.0 to 1.9.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-functions-dotnet-worker/releases">Microsoft.Azure.Functions.Worker.Sdk's
releases</a>.</em></p>
<blockquote>
<h2>Microsoft.Azure.Functions.Worker 1.9.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix GetOutputBindings method to return correct output when
OutputBindingData is not set by <a
href="https://github.com/kshyju"><code>@​kshyju</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/987">Azure/azure-functions-dotnet-worker#987</a></li>
<li>Define Retry Policy Attributes by <a
href="https://github.com/satvu"><code>@​satvu</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/977">Azure/azure-functions-dotnet-worker#977</a></li>
<li>Populating WorkerMetadata in init response by <a
href="https://github.com/fabiocav"><code>@​fabiocav</code></a> in <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/1022">Azure/azure-functions-dotnet-worker#1022</a></li>
<li>Handle InvocationCancel message and signal cancellation for
in-flight invocations by <a
href="https://github.com/liliankasem"><code>@​liliankasem</code></a> in
<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/pull/972">Azure/azure-functions-dotnet-worker#972</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/1.8.0...1.9.0">https://github.com/Azure/azure-functions-dotnet-worker/compare/1.8.0...1.9.0</a></p>
<h2>Microsoft.Azure.Functions.Worker.Sdk 1.9.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Source generated version of function metadata provider (not enabled
by default).</li>
<li>Source generated version of function executor (not enabled by
default).</li>
<li>Several bug fixes and reliability enhancements.</li>
</ul>
<h2>Microsoft.Azure.Functions.Worker.Sdk 1.9.0-preview2</h2>
<h2>What's Changed</h2>
<h3>Microsoft.Azure.Functions.Worker.Sdk 1.9.0-preview2 (meta
package)</h3>
<ul>
<li>Update Microsoft.Azure.Functions.Worker.Sdk.Generators dependency to
1.1.0-preview2</li>
</ul>
<h3>Microsoft.Azure.Functions.Worker.Sdk.Generators 1.1.0-preview2</h3>
<ul>
<li>Fix cardinality validation to include all bindings <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1402">#1402</a></li>
<li>Diagnostics Cleanup <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1393">#1393</a></li>
<li>Fixing incorrect entrypoint property value in metadata when
namespace is different than assembly name <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1385">#1385</a></li>
<li>Generate function executor code <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1309">#1309</a></li>
<li>Add AuthLevel to HttpTriggers metadata <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1319">#1319</a></li>
</ul>
<h2>Microsoft.Azure.Functions.Worker.Sdk 1.9.0-preview1</h2>
<h2>What's Changed</h2>
<ul>
<li>Use a consistent function ID via code gen <a
href="https://github.com/jviau"><code>@​jviau</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1103">#1103</a></li>
<li>Support sdk-type binding reference type <a
href="https://github.com/liliankasem"><code>@​liliankasem</code></a> <a
href="https://github.com/surgupta-msft"><code>@​surgupta-msft</code></a>
<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1107">#1107</a></li>
<li>[SourceGen] Add support for overriding binding property name <a
href="https://github.com/satvu"><code>@​satvu</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1130">#1130</a></li>
<li>[SourceGen] Handle default values in binding attributes <a
href="https://github.com/satvu"><code>@​satvu</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1131">#1131</a></li>
<li>[SourceGen] Create JSON directly instead of using anonymous type <a
href="https://github.com/satvu"><code>@​satvu</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1191">#1191</a></li>
<li>[SourceGen] Add MSBuild prop to disable source-generated function
metadata <a href="https://github.com/satvu"><code>@​satvu</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1200">#1200</a>
<ul>
<li>Property name: FunctionsMetadataSourceGen_Enabled</li>
</ul>
</li>
<li>Replacing TextWriter with raw string literals <a
href="https://github.com/fabiocav"><code>@​fabiocav</code></a> 1209</li>
<li>Updating source generator to use raw literal strings <a
href="https://github.com/fabiocav"><code>@​fabiocav</code></a> 1211</li>
<li>Avoid registering metadata loader extension when running in the
native worker <a
href="https://github.com/kshyju"><code>@​kshyju</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1258">#1258</a></li>
<li>Implement SupportsDeferredBindingAttribute <a
href="https://github.com/liliankasem"><code>@​liliankasem</code></a> <a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/1275">#1275</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/azure-functions-dotnet-worker/compare/sdk-1.8.0-preview2...sdk-1.9.0-preview1">https://github.com/Azure/azure-functions-dotnet-worker/compare/sdk-1.8.0-preview2...sdk-1.9.0-preview1</a></p>
<h2>Microsoft.Azure.Functions.Worker 1.8.0</h2>
<h3>Release notes</h3>
<ul>
<li>Added support for .NET Standard 2.0. This enables Workers built
using .NET Framework</li>
<li>Bug fix: Handle = character in cookie value (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/838">#838</a>)</li>
<li>Error handling for in-proc SDK usage inside isolated app. (<a
href="https://redirect.github.com/Azure/azure-functions-dotnet-worker/issues/824">#824</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Azure/azure-functions-dotnet-worker/commits/1.9.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Functions.Worker.Sdk&package-manager=nuget&previous-version=1.7.0&new-version=1.9.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lee Miller <[email protected]>
2023-04-07 10:23:25 -07:00
Lee Miller 358630b334 Main warning fix (#349)
### Motivation and Context
Fix warnings in main build and apply formatting fixes from R#.

### Description
Fix build warnings and R# formatting.
2023-04-06 11:52:29 -07:00
Abby Harrison 1e72692591 Memory Refactor: Simplify Memory Interfaces, Remove Unnecessary Generics, Move Vector Stores to Connectors (#308)
### Motivation and Context
Existing memory interfaces are overly complicated, leading to confusion
about how to implement a custom Memory Store.

This PR condenses `IMemoryStore` + `IEmbeddingIndex` + `IDataStore `->
**`IMemoryStore`** and eliminates the use of generics spread by the
Embedding struct. It makes the codebase much easier to read and
IMemoryStore easier to implement. As part of the effort,
SqliteMemoryStore was properly implemented (it was not previously).

Additionally, this PR moves the MemoryStore 'skills' to the connectors
namespace.

Addresses several points called out in
https://github.com/microsoft/semantic-kernel/issues/202

### Description

- `QdrantMemoryStore` was moved from Skills to Connectors. Unit tests
were added for the memory store object. Created an IQdrantVectorDbClient
interface to better enable testing of the memory store through mocks.
- Modified QdrantVectorDbClient calls to default batched calls to
reduced the amount of HTTP traffic when possible. `GetVectorById ->
GetVectorsById`, `UpsertVector -> UpsertVectors`, `DeleteVector ->
DeleteVectors`.
- Generally, for a vector store, the unique id passed by the user to
associate with a saved memory will become the indexed ID for the vector
store as well. However, Qdrant enforces a user-provided GUID or hex
string as the index key. Added a nullable key field to `MemoryRecord` to
support vector storage services that act similarly. Depending on the
backing storage, this key is not necessary to pass to subsequent calls.
`SemanticTextMemory` does not utilized this parameter. For now, this is
only for direct interaction with the `QdrantMemoryStore`. **Note**: It
is understood that Qdrant will be enabling service-side GUID generation
in the near future, significantly reducing the stress on the client to
produce unique values for every data entry.
- Eliminated the dependency on the core kernel in the connectors by
replacing `Embeddings` struct references with `IEnumerable<float>`.
- `SqliteMemoryStore` was moved from Skills to Connectors.
`SqliteMemoryStore` now properly implements `IMemoryStore` and the unit
tests were updated to reflect this fact.
- The generic `TEmbedding` was removed from all Kernel and Connector
files. **If a memory store expects a non-FP32 vector, it is currently up
to the `IMemoryStore` implementation to perform the necessary
conversions.**
- `DataEntry` is now a base class that enforces nullable Key and
Timestamp fields. It is not strictly used for anything other than
MemoryRecord. It may serve useful for connecting to data stores that are
for structures other than embeddings, or vector stores that calculate
embeddings server-side.
- Removed existing collection checks for `Upsert` calls. Depending on
the implementation, this has the potential to drastically increase HTTP
traffic or local compute resources when making batch calls. The call has
been moved to SemanticTextMemory for now to avoid additional breaking
changes, but will be addressed in a better fashion in a follow-up PR.
- Added a very simple example to `KernelSyntaxExamples `on how to create
a read-only `IMemoryStore` that imports vectors from a json string.
- Renamed `VectorDbException` -> `QdrantMemoryException`. Ensured that
these exceptions can only be thrown by the `QdrantMemoryStore` and can
accept an inner exception as a paramter.

Additional small edits:
- removed unnecessary namespace from KernelSyntaxExamples Example21 and
Example22
- Removed unused references in `RestApiOperations.cs` and
`JsonPathSkill.cs`

---------------- OUT OF SCOPE, COMING SOON ----------------
- The addition of a value string to MemoryRecord. This is very important
for metadata flexibility, but it will come in a follow-up PR.
- The ability to optionally return the vector to the user. In many
cases, the vector is not important for get/search calls, thus it makes
no sense to pass such large amounts of data around the kernel
application.
- Disambiguation of SemanticTextMemory interfaces, classes, and
constructors.
- Unit tests for QdrantVectorDbClient. Qdrant will be making breaking
changes to their API very soon. TBD whether integration tests will be
added as well.
2023-04-06 00:26:56 +00:00
Gil LaHaye cb53fde1f1 Remove unused Skill.cs file from KernelHttpServer (#307)
### Motivation and Context
Skill.cs was not used at all

### Description
Remove Skill.cs
2023-04-04 20:57:50 +00:00
Devis Lucato 215933efaa Name refactoring + move OpenAI code to Connectors namespace (#204)
### Motivation and Context

Cleaning up tech debt as per plan, last couple of months

* Moved OpenAI code to Connectors namespace
* Label => Service Id
* Backend => Service / Connector
* EmbeddingGenerator => EmbeddingGeneration / TextEmbeddingGeneration
2023-03-30 11:29:56 -07:00
Devis Lucato 5cc47771b9 Extend AI support: add ChatGPT, add DallE, allow custom/any models (#161)
### Motivation and Context

Remove hardcoded models, allow to use ChatGPT, Image generation like
DallE, any/custom Text Generation, and Text Embedding

Currently SK supports only "text completion" and "text embedding", and
only OpenAI and Azure OpenAI. One cannot use custom LLMs. If one wants
to put a proxy in front of OpenAI with a custom API, SK doesnt' support
it. "Completion" and "Embedding" are not explicitly scoped to "text",
while the implementation supports only text completion and text
embeddings. Also SK has no helpers for DallE and ChatGPT.

### Description

The PR contains the following features and improvements:

* Introduce the concept of Service Collection (without using .NET
ServiceCollection yet, because that would take more work). The service
collection can cointain 4 service types:
  * Text Completion services
  * Text Embedding generators
  * Chat Completion services
  * Image Generation services
* Add client for OpenAI ChatGPT, and example (example 17)
* Add client for OpenAI DallE, and example (example 18)
* Show how to use a custom LLM, e.g. in case of proxies or local
HuggingFace models (example 16)
* Add Secret Manager to syntax examples, to reduce the risk of leaking
secrets used to run the examples
* Add 3 new syntax examples: custom LLM, ChatGPT, DallE
2023-03-28 09:07:33 -07:00
dependabot[bot] 72ebfa244a Bump Microsoft.Azure.Functions.Worker from 1.10.1 to 1.13.0 in /dotnet (#178)
Bumps
[Microsoft.Azure.Functions.Worker](https://github.com/Azure/azure-functions-dotnet-worker)
from 1.10.1 to 1.13.0.
2023-03-27 18:48:10 -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
Devis Lucato 4250bfb8bd Add support for values params for functions (#65)
### Motivation and Context

1. When writing a prompt one might want to use the symbols `{{` and `}}`
without triggering the template engine.
2. When invoking functions, one might want to pass a value rather than a
variable, e.g. `{{ recall "my preferred browser" }}`.
3. Semantic functions might want to call other semantic functions.

### Description

This PR adds support for "values", so special syntax can be embedded,
and so that functions can be invoked with predefined values without the
need to create a temporary variable.

E.g.

```
{{ "{{" }} and {{ "}}" }} are special SK sequences.
```
```
... {{ read 'c:\documents\ai\file.txt' }} ...
```
```
... {{ "quotes' \"escaping\" example" }} ...
```
```
... {{ 'quotes\' "escaping" example' }} ...
```
```
{{ 'two special chars \\\' here' }}
```

Added missing tests for all the template language, including end to end
integration tests covering several edge cases.

Also: semantic functions can now call other semantic functions. The
previous implementation would allow semantic functions to call only
native functions.
2023-03-14 17:46:34 -07:00
Roger Barreto 9690328b9b Fixed Intermittent UnitTest error (#60)
### Motivation and Context

- Bugfix to an intermittent error happening in the Unit Tests.
- Added missing error handling logging
- Removed unused implementations
- Added 2 unit tests (instance testing)

### Description

As part of the investigation I found that there was no logging happening
when an exception was happening in the function invocation, added as
part of this bugfix, this helped to identify the real error below.

It ended up being caused by the usage of Console.Writeline within the
embedded methods that had no more reference in the context of the method
execution.

Removed the need to have Console.SetOut as well as the usage of
RedirectOutput proxy.
2023-03-13 15:03:45 -07:00
Craig Presti 8c092b33dd Bring embeddings and memory to KernelHttpServer (#51)
### Motivation and Context
This change modifies the expected headers at the KernelHttpServer and
allows future samples to leverage memory/embedding capabilities via the
KernelHttpServer.

### Description
* Introduces distinct headers for completion and embedding 
* Allows one to have completion endpoint on Azure OpenAI and embedding
endpoint on OpenAI, for example
* Updates dependent app samples to use the new header convention 

### 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 😄

<!-- Thank you for your contribution to the semantic-kernel repo! -->
2023-03-13 11:43:34 -07:00
Roger Barreto 51ed177848 Correct namespaces in KernelHttpServer, Fixed code style warnings (#36)
### 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
1. Updated sample `KernelHttpServer` project namespaces to match the
project name.
1. Small adjustments to code style warnings (naming, unused namespaces,
spacing).
2023-03-08 15:33:22 -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