Commit Graph
750 Commits
Author SHA1 Message Date
471ec9c19a Add Azure Dall-E (#1209)
### Motivation and Context

Implement Azure OpenAI Dall E

### Description
Implement Azure OpenAI Image Generation according to the official
[documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#image-generation)
and the examples provided by Azure OpenAI Studio, so that it can be used
in SK.

Due to the differences between the API of Azure OpenAI Dall-E and OpenAI
Dall-E, some modifications have been made to OpenAIClientBase under
CustomClient to ensure compatibility.

Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Dmytro Struk <[email protected]>
2023-06-09 15:10:28 +00:00
Lee Miller fa3eb272c0 Fix input handling and context passing in planners (#1380)
### Motivation and Context
This pull request fixes a bug in the sequential planner example and
improves the custom planner example by adding input reset and context
update steps. These changes ensure that the input and context are
consistent and up-to-date for each step of the plan execution.

### Description
- In the sequential planner example, add an input reset step after each
plan step execution. This prevents the input from accumulating and
interfering with the subsequent steps.
- In the custom planner example, update the context variables with the
input before invoking the plan. This ensures that the context query
skill can access the input as a variable and perform the appropriate
queries.
2023-06-09 14:42:36 +00:00
Lee Miller faeccf5f1e Add option to ignore identifiers by regex in typos.toml (#1383)
This commit adds a new option to the default section of the typos.toml
file, which allows users to specify a list of regular expressions that
match identifiers that should be ignored by the typos checker. This can
be useful for cases where some identifiers are intentionally spelled in
a non-standard way, or contain abbreviations or acronyms that are not
recognized by the dictionary.

One example of such a case is the Azure Graph Service, which uses the
abbreviation "ags" in some of its identifiers. To avoid false positives
from the typos checker, we can add "ags" to the extend-identifiers
section of the typos.toml file. However, this would also ignore any
other occurrences of "ags" in the codebase, which may not be desirable.

To address this issue, we can use the extend-ignore-identifiers-re
option to specify a regular expression that matches only the "ags"
identifiers that are part of the Azure Graph Service API, such as
"2021-03-01_ags". This way, we can fine-tune the typos checker to ignore
only the identifiers that we want, and still catch any other potential
spelling errors.
2023-06-09 14:27:14 +00:00
Matt Mazzola f4e92eb1de fix: Add Azure OpenAI support for python/08-native-function-inline (#1365)
### Motivation and Context

Other Semantic Kernal samples allow using both OpenAI and Azure OpenAI
by setting a different set of environment variables and toggling the
`useAzureOpenAI` bool value

### Description

Add the same snippet used in other notebooks such as
`02-running-prompts-from-file` to use Azure OpenAI to the
`08-native-function-inline`
2023-06-09 00:13:52 +00:00
Stuart Cam 5742bb1ce8 Weaviate connector (#1219)
Adds a WeaviateMemoryStore, which allows for memories to be stored in Weaviate.
2023-06-08 14:21:58 -07:00
Eric Erhardt 75d50048e2 Reduce Logging Dependencies (#1300)
SemanticKernel only uses ILogger and extension methods off of it. We
should just be depending on Microsoft.Extensions.Logging.Abstractions,
and not Microsoft.Extensions.Logging. The Logging package brings a lot
more dependencies with it.

cc @stephentoub
2023-06-08 20:48:23 +00:00
xbotter f1cb6919e5 Remove unused variables in ActionPlanner.CreatePlanAsync (#1370)
closes #1332
2023-06-08 20:24:03 +00:00
Alessandro Avila 5938531c69 Removed embeddingSpan instance, as it is not used within the GetNeare… (#1358)
Removed embeddingSpan instance in the GetNearestMatchesAsync method,
within the VolatileMemoryStore class, as it's not used in the cosine
similarity calculation.
2023-06-08 20:20:55 +00:00
Matt Mazzola d3775b06d1 style: chat-summary-webapp-react - change label for deployment form input from Model to Deployment (#1368)
### Motivation and Context

There are different sets of parameters when using OpenAI vs Azure OpenAI

#### OpenAI

1. OpenAI Key
1. Model (`text-davinci-003`)

#### Azure OpenAI
You can deploy multiple versions of the same model (`gpt-3.5-turbo`)
with different resource throughput. This is why "model" is not unique
enough. Instead of Model you specify Deployment and Endpoint

1. OpenAI Key
1. Deployment
1. Endpoint

The `samples\apps\chat-summary-webapp-react` it was using Model term
which may be misleading

### Description

- samples\apps\chat-summary-webapp-react
    - Change label for Deployment form input from Model to Deployment
2023-06-08 12:43:17 -07:00
dependabot[bot]andAdrian Bonar 1a7639a52f Bump PdfPig from 0.1.8-alpha-20230423-3898f to 0.1.8-alpha-20230529-6daa2 in /dotnet (#1267)
Bumps [PdfPig](https://github.com/UglyToad/PdfPig) from
0.1.8-alpha-20230423-3898f to 0.1.8-alpha-20230529-6daa2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/UglyToad/PdfPig/releases">PdfPig's
releases</a>.</em></p>
<blockquote>
<h2>0.1.2 Second Alpha</h2>
<p>Adds letter font details and a couple of other bugfixes to the alpha
version.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/UglyToad/PdfPig/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=PdfPig&package-manager=nuget&previous-version=0.1.8-alpha-20230423-3898f&new-version=0.1.8-alpha-20230529-6daa2)](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-06-08 18:13:30 +00:00
garethdebruyn 729d9d7576 Update Example02_Pipeline.cs (#1286)
text["LStrip"], text["RStrip"] no longer seem to be part of TextSkill
2023-06-08 17:47:22 +00:00
Lee Miller de74668637 Fixing typos (#1377)
### Motivation and Context
Fixing typos to unblock PRs.
2023-06-08 17:41:02 +00:00
Roger Barreto 3bc0967b39 IChatCompletion Multiple Results / New Interfaces (#1117)
### Motivation and Context

Add potential for IChatCompletion with multiple results per prompt.


![MultiChatResultPR](https://github.com/microsoft/semantic-kernel/assets/19890735/725ecce9-5e22-4a46-a06d-b159c68807f0)

### Description

- Adds new Interfaces/Abstractions for Chat Results: `IChatResult`,
`IChatStreamingResult`, `IChatMessage`
- Adds new `IChatCompletion` interface methods for Streaming and
Non-Streaming results
- Moves old `IChatCompletion` interface methods
`IAsyncEnumerable<string> GenerateMessageStreamAsync` and `Task<string>
GenerateMessageAsync` as extensions for retro compatibility
- Changed `ChatAsText` to use the new multiple results implementations
- Makes `ChatHistory.ChatMessage` & `ChatHistory.AuthorsRole` types
obsolete (discouraging usage of those implementation in favor of new
`IChatMessage`
- `ChatHistory` abstraction now extends from `List<IChatMessage>`
- Updates all Samples using the new interfaces. 

### Paves the way to ... (Futures)
- Remove `ChatHistory.ChatMessage` inner class
- Remove `ChatHistory.AuthorsRole` enums 
- Make `ChatHistory` an abstract class or an `IChatHistory` interface.
- Rename `ITextCompletionResult` to `ITextResult`
- Rename `ITextComplet
2023-06-08 09:29:52 -07:00
Mark Karle 4c4670acb2 Using dotenv instead of parsing keys ourselves (#1295)
### Motivation and Context

This changes our parsing of the .env file to use
[`python-dotenv`](https://pypi.org/project/python-dotenv/) which will be
more flexible.
Tested that the notebooks would still run correctly.
2023-06-07 15:53:32 -07:00
Abby Harrison 05d9e72322 Python: Sync pyproject.toml with requirements.txt (#1150)
### Motivation and Context
This PR ensures that pyproject.toml with requirements.txt are in sync.

### Description
- removed the `^` from pyproject.toml linting dependencies
- Added >= to requirements.txt
2023-06-07 22:43:03 +00:00
Abby Harrison 6cbea85fd8 Python: Add additional_metadata field to MemoryRecord and address TODOs in ChromaMemoryStore (#1323)
### Motivation and Context
Closes #1271 and addresses several TODOs in ChromaMemoryStore


### Description
- added field `additional_metadata` to `MemoryRecord` and all downstream
methods/classes (see `SemanticTextMemoryBase`, `SemanticTextMemory`,
`MemoryQueryResult`, and `ChromaMemoryStore`)
- addressed ChromaMemoryStore TODO 'what is key used for?' For chromadb,
key and id are effectively the same value, but the two fields are
differentiated for memory stores like Qdrant which require that key be a
uuid. I updated the logic so that this is more apparent. Note that this
results in no change in end-user functionality.
- Updated ChromaMemoryStore TODO 'get_async say embedding is optional
but Record constructor requires it.` MemoryRecord constructor no longer
requires an embedding. Logic is updated and a test added to show that
embedding retrieval is functionally optional.
2023-06-07 15:33:51 -07:00
Roger Barreto bc5d901cd3 Support for Multi Model Detailed Response (Max Tokens, Prompt Tokens, etc) (#1181)
### Motivation and Context

Common feature request and missing capability to acquire the actual
details from the models we are integrating.

Resolves #802
Resolves #618  
Resolves Partially #351 
Getting the results alternative to #693 

### Description

This change introduces a new Property in `object?
SKContext.LastPromptResults` which will contain a list of each result
detail for a given prompt.

The Connector namespace will also provide a Extension methods that
converts this object in the actual class that you will be using to
serialize or get the detailed information about the Model result.

Normal suggested usage 
```
var textResult = await excuseFunction.InvokeAsync("I missed the F1 final race");
```

Getting model result as json:
```
var modelResultJson = JsonSerializer.Serialize(textResult.LastPromptResults);
```

Getting model result as a traversable object (using a connector
extension):
```
var modelResultJson = textResult.GetOpenAILastPromptResult()?.Usage.TotalTokens;
```
2023-06-07 17:46:15 +00:00
SergeyMenshykhandDmytro Struk b18138e398 Http consistency: Pinecone (#1262)
### Description

This PR introduces the following changes:

1. The PineconeClient class accepts a custom HTTP client, allowing the
hosting application/client code to provide their own instances.

2. A new extension method, `WithPineconeMemoryStore`, has been added to
the `KernelBuilder` class. This method simplifies the registration of
the Pinecone memory store, aligns the registration process with other
connector registrations, and enforces the usage of an HTTP client and
retry handlers configured in the SK SDK.

3. The global static `HttpHandlers` class is removed because it goes
against the agreed approach for the SK SDK's HTTP stack that assumes the
usage of a custom HTTP client for fine-tuning instead of relying on
global static variables.

Co-authored-by: Dmytro Struk <[email protected]>
2023-06-07 07:57:46 -07:00
SergeyMenshykh fc3202adf8 Http consistency: Hugging Face (#1261)
### Description
This PR introduces the following changes:
1. The classes HuggingFaceTextCompletion and
HuggingFaceTextEmbeddingGeneration now accept a custom HTTP client,
allowing the hosting application/client code to provide their own
instances.
2. Two new extension methods, WithHuggingFaceTextCompletionService and
WithHuggingFaceTextEmbeddingGenerationService, are added to the
KernelBuilder class. These methods simplify the registration of Hugging
Face AI services, align the registration process with other connector
registration, and enforce the usage of an HTTP client and retry handlers
configured by the SK SDK.
3. Several older constructors of the classes are marked as obsolete to
prevent any potential breaking changes.
2023-06-06 21:54:28 +00:00
Shukri 8947e6845c Weaviate: Fix to be compatible with python 3.8 (#1349)
use run_in_executor instead of to_thread to run the weaviate client ops
in async because to_thread is not available in python 3.8
2023-06-06 14:49:14 -07:00
Desmond Howard 39b2b8a4b6 CopilotChat: Add Files tab (#1307)
### Motivation and Context
this PR adds a Files tab to Copilot Chat that allows users to view the
documents that have been uploaded to the Bot. in the future we will
ideally have more supported file types on this list with Word/Office
support being next on my list.

### Preview
<img width="452" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/52973358/1207541b-be73-4ee7-b488-d5027f169c77">

### Description
changes:
- adds a `MemorySource` model that represents the uploaded document
- changes view in `ChatWindow` from `ChatRoom` to the new
`ChatResourceList` depending on the selected tab
- changes `UpdateAsync()` to `UpsertAsync()` in `IStorageContext`.
previously, `CosmosDbContext` was
using upsert while the other two were updating, whereas now we upsert
across all three. this is used to prevent duplicate file upload.
2023-06-06 12:48:59 -07:00
3b0ac56d4d Add SequentialPlanner support to Copilot ChatApp (#1139)
### Motivation and Context
See issue/feature request #1137

### Description
Add SequentialPlanner support in Copilot ChatApp
---------

Co-authored-by: Teresa Hoang <[email protected]>
Co-authored-by: Harleen Thind <[email protected]>
Co-authored-by: Teresa Hoang <[email protected]>
Co-authored-by: Adrian Bonar <[email protected]>
2023-06-06 11:09:12 -07:00
dependabot[bot] 02378e3393 Bump Microsoft.NET.Test.Sdk from 17.6.0 to 17.6.1 in /dotnet (#1351)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from
17.6.0 to 17.6.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/microsoft/vstest/releases">Microsoft.NET.Test.Sdk's
releases</a>.</em></p>
<blockquote>
<h2>v17.6.1</h2>
<h3>Issues Fixed</h3>
<p>This is a tiny patch to fixup few latest issues,</p>
<ul>
<li>
<p>Fix no-suitable provider found by <a
href="https://github.com/nohwnd"><code>@​nohwnd</code></a> in <a
href="https://redirect.github.com/microsoft/vstest/pull/4474">microsoft/vstest#4474</a>
which fixes <a
href="https://redirect.github.com/microsoft/vstest/issues/4467">#4467</a></p>
<p>When .NET Portable or .NET Standard dlls are provided to the run, the
run crashes with &quot;No suitable test runtime provider was
found&quot;, which is a regression introduced in 17.6.0.
<img
src="https://user-images.githubusercontent.com/11354648/239257444-4199e185-4884-43c8-9f23-4f8181572191.png"
alt="" /></p>
</li>
<li>
<p>Fix hangdump running into crashdump by <a
href="https://github.com/nohwnd"><code>@​nohwnd</code></a> in <a
href="https://redirect.github.com/microsoft/vstest/pull/4480">microsoft/vstest#4480</a>
which fixes <a
href="https://redirect.github.com/microsoft/vstest/issues/4378">#4378</a></p>
<p>Running --blame-hang and --blame-crash at the same time, can result
in --blame-hang cancelling --blame-crash, and killing the testhost in
the process, resulting in no dumps being created. This fix waits for
--blame-crash to finish dumping the process, and then it creates hang
dump.</p>
</li>
<li>
<p>Update Nuget.Frameworks by <a
href="https://github.com/nohwnd"><code>@​nohwnd</code></a> in <a
href="https://redirect.github.com/microsoft/vstest/pull/4500">microsoft/vstest#4500</a>
which fixes <a
href="https://redirect.github.com/microsoft/vstest/issues/4409">#4409</a></p>
</li>
</ul>
<h3>Internal updates:</h3>
<ul>
<li>Update dependencies from devdiv/DevDiv/vs-code-coverage by <a
href="https://github.com/dotnet-maestro"><code>@​dotnet-maestro</code></a>
in <a
href="https://redirect.github.com/microsoft/vstest/pull/4479">microsoft/vstest#4479</a></li>
<li>Disable internal build on new pipeline by <a
href="https://github.com/nohwnd"><code>@​nohwnd</code></a> in <a
href="https://redirect.github.com/microsoft/vstest/pull/4476">microsoft/vstest#4476</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/microsoft/vstest/compare/v17.6.0...v17.6.1">https://github.com/microsoft/vstest/compare/v17.6.0...v17.6.1</a></p>
<h3>Artifacts</h3>
<ul>
<li>TestPlatform vsix: <a
href="https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/vstest/17.6/v17.6.1;/TestPlatform.vsix">17.6.1</a></li>
<li>Microsoft.TestPlatform.ObjectModel : <a
href="https://www.nuget.org/packages/Microsoft.TestPlatform.ObjectModel/17.6.1">17.6.1</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/microsoft/vstest/blob/main/docs/releases.md">Microsoft.NET.Test.Sdk's
changelog</a>.</em></p>
<blockquote>
<h2>17.6.1 and newer</h2>
<p>Please see release notes directly in the release page: <a
href="https://github.com/microsoft/vstest/releases">https://github.com/microsoft/vstest/releases</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/microsoft/vstest/commit/5121d9feaef6811adc92efb56e1cffc494c8dfb5"><code>5121d9f</code></a>
[rel/17.6] Update Nuget.Frameworks (<a
href="https://redirect.github.com/microsoft/vstest/issues/4500">#4500</a>)</li>
<li><a
href="https://github.com/microsoft/vstest/commit/00967c5d2d42e9485fe1726376ded79491a4e973"><code>00967c5</code></a>
[rel/17.6] Fix hangdump running into crashdump (<a
href="https://redirect.github.com/microsoft/vstest/issues/4480">#4480</a>)</li>
<li><a
href="https://github.com/microsoft/vstest/commit/90efc14193228735cd6849ed6641b6b5c6d9b5af"><code>90efc14</code></a>
Disable internal build on new pipeline (<a
href="https://redirect.github.com/microsoft/vstest/issues/4476">#4476</a>)</li>
<li><a
href="https://github.com/microsoft/vstest/commit/0e34e21ef919eac5904a20b8862bc273350a0c46"><code>0e34e21</code></a>
Merge branch 'rel/17.6' of <a
href="https://github.com/microsoft/vstest">https://github.com/microsoft/vstest</a>
into rel/17.6</li>
<li><a
href="https://github.com/microsoft/vstest/commit/1db7dc07ac94db3648e1aafed49d810e534f3650"><code>1db7dc0</code></a>
Bump to 17.6.1 in targets</li>
<li><a
href="https://github.com/microsoft/vstest/commit/7f3dc2208ea3cd7d3aebe91b48090b063d110a5a"><code>7f3dc22</code></a>
[rel/17.6] Update dependencies from devdiv/DevDiv/vs-code-coverage (<a
href="https://redirect.github.com/microsoft/vstest/issues/4479">#4479</a>)</li>
<li><a
href="https://github.com/microsoft/vstest/commit/a6e34a16ee0ecb4bdf010614c85d6fcc2253867e"><code>a6e34a1</code></a>
Revert &quot;Bump Microsoft.VisualStudio.Telemetry to 16.6.13&quot;</li>
<li><a
href="https://github.com/microsoft/vstest/commit/6115490c4925f60b008465205efd936756f7bd27"><code>6115490</code></a>
Bump Microsoft.VisualStudio.Telemetry to 16.6.13</li>
<li><a
href="https://github.com/microsoft/vstest/commit/68649f267286d46d05f21cdca91ae5374ac1beaa"><code>68649f2</code></a>
Re-order sources to restore signed packages</li>
<li><a
href="https://github.com/microsoft/vstest/commit/0d079b412745daad3edbdc1d4a359084525fdf13"><code>0d079b4</code></a>
Update branding to 17.6.1</li>
<li>Additional commits viewable in <a
href="https://github.com/microsoft/vstest/compare/v17.6.0...v17.6.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.NET.Test.Sdk&package-manager=nuget&previous-version=17.6.0&new-version=17.6.1)](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-06 17:46:29 +00:00
Gina Triolo 35e094868e Copilot Chat: Use MSAL active account instead of accounts[0] (#1318)
### Motivation and Context
We are currently using `accounts[0]` to access the user's MSAL account
information and retrieve tokens in the Copilot Chat frontend. This works
fine if only one account is logged in. However, if the user is signed in
with multiple accounts, this list is not guaranteed to be in the same
order each time (per MSAL documentation
[here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/accounts.md#notes:~:text=getAllAccounts()%20is%20not%20ordered%20and%20is%20not%20guaranteed%20to%20be%20in%20the%20same%20order%20across%20multiple%20calls)).
We need to ensure we are using the currently active account for
consistent behavior.

### Description
- Set the active account once the user has logged in using
`handleRedirectPromise`
- Use `instance.getActiveAccount` everywhere we need to access the
account
2023-06-06 00:00:29 +00:00
Devis LucatoandAbby Harrison 371f54b3f8 Bump SK python version from 0.2.9 to 0.3.0 (#1342)
New release and updated feature matrix

---------

Co-authored-by: Abby Harrison <[email protected]>
python-0.3.0.dev
2023-06-05 13:07:47 -07:00
Teresa Hoang f8567c6190 Adding local ToListAsync method in Copilot Chat (#1346)
### Motivation and Context
The `System.Linq.Async` package reference was removed from the core
libraries so that everyone using SK wasn't forced to use it as well.
This adds a helper `ToListAsync` method to enable async conversion of
`IAsyncEnumerable<T>` to `List<T>` object.

### Description
Was seeing the following error when using local project references, so
this is an effort to future proof any SK nuget updates

`'IAsyncEnumerable<MemoryQueryResult>' does not contain a definition for
'ToListAsync' and no accessible extension method 'ToListAsync' accepting
a first argument of type 'IAsyncEnumerable<MemoryQueryResult>' could be
found (are you missing a using directive or an assembly reference?) `
2023-06-05 12:57:27 -07:00
Govind Kamtamneni 134906aa39 Copilot Chat deployment: Add sk probe endpoint to deployment output (#1340)
### Motivation and Context
After [deploying Copilot Chat to
Azure](https://learn.microsoft.com/en-us/semantic-kernel/deploy/deploy-to-azure),
the default behavior of users is to access the [`endpoint`
url](https://github.com/microsoft/semantic-kernel/blob/main/samples/apps/copilot-chat-app/webapi/DeploymentTemplates/sk-new.bicep#LL60C1-L60C1)
from the Deployment Output. However, this URL results in 404 (since the
user has to append `/probe`) to the URI. It would be great to have that
`probe` URI as part of the Deployment output, in case users miss the
[instruction
](https://learn.microsoft.com/en-us/semantic-kernel/deploy/deploy-to-azure#verifying-the-deployment)


![image](https://github.com/microsoft/semantic-kernel/assets/18152044/dcab3052-9c1c-4330-b032-dd709987fe41)

### Description
Add `skProbe` as an output to Deployment outputs.

cc - @glahaye
2023-06-05 17:36:42 +00:00
Teresa Hoang 326d31765e Shortening plan object in chat history (#1306)
### Motivation and Context
Truncating plan object to intent only in chat history to save on token
limits.

![image](https://github.com/microsoft/semantic-kernel/assets/125500434/e8690c10-ac9e-4ae4-8506-6fd1426f1818)
2023-06-05 10:33:42 -07:00
Adrian Bonar bfe63695f0 CopilotChat: Fix frontend probe url (#1343)
Fix broken frontend probe
2023-06-05 17:23:38 +00:00
Adrian Bonar 7774251507 CopilotChat: Change health probe from /probe to /healthz (#1341)
### Motivation and Context
CopilotChat webapi should use the standard health probe to aid in
systems integration.

### Description
- Removed probe controller
- Added basic ASP.NET health check on /healthz
- Updated all READMEs
2023-06-05 09:44:51 -07:00
18cd0cd042 Add support for weaviate as a memory store (Python) (#804)
Add support for weaviate as a memory store
see #803

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-06-05 09:37:41 -07:00
Josh XTandAbby Harrison a5144ba6ac Add persist to Chroma on upsert or delete (#1292)
- Add persist to Chroma on upsert or delete
- Fixes #1289 

### Description
Added `self._client.persist()` in the `upsert_async` and
`delete_collection_async`.

Co-authored-by: Abby Harrison <[email protected]>
2023-06-05 16:17:57 +00:00
Adrian BonarandTeresa Hoang 6a270273ee CopilotChat: Remove unused /invoke API from webapi service (#1308)
### Motivation and Context
The /invoke API in webapi is no longer being used by the webapp.

### Description
- Removed the SemanticKernelController from webapp
- Removed unused `invokeSkillWithMsalToken` and
`invokeSkillWithGraphToken` from `useConnectors.ts`

---------

Co-authored-by: Teresa Hoang <[email protected]>
2023-06-03 00:07:50 +00:00
SergeyMenshykh 17e821abf9 Use new extension methods (#1310)
### Description
Updating readme, notebooks and samples to use kernel builder new .With*
extension methods for AI services registration.
2023-06-02 23:50:47 +00:00
Gil LaHaye 8ea63f4783 Add deployments elements needed for multi-user chat (#1293)
### Motivation and Context
To work properly, multi-user chat needs one more CosmoDB container
(chatparticipants) and the web service needs to have web sockets enabled
in order to accomodate SignalR.

### Description
- Add creation of chatparticipants container
- Enabled web sockets on web service
2023-06-02 23:40:19 +00:00
Teresa Hoang 2995a9c677 Enabling HTTPS with local WebApp development (#1311)
### Motivation and Context
This PR sets up the support for HTTPS should developers choose to enable
it. Some customers have production sites using HTTPS and want the option
to have a local development site that behaves like HTTPS.

### Description
- Update WebApp env.example with required variables
- Updated README with instructions on how to generate locally signed
certificate and how to update copilot config files accordingly.
- Added `https://localhost:3000` to AllowedOrigins in webapi config
files
2023-06-02 23:37:10 +00:00
Adrian Bonar e23ad19271 Make dotnet pinning global (workaround for analyzer bug in dotnet SDK 7+) (#1325)
### Motivation and Context
Applying fix globally, not just in /dotnet since /samples is in a
separate tree.
2023-06-02 23:34:29 +00:00
Adrian Bonar 253589bf40 Temporarily add global.json to pin the dotnet version to avoid dotnet-format failures (#1324)
### Motivation and Context
PRs are blocked since the dotnet SDK analyzers introduced a back-compat
issue.

### Description
Brought in a global.json file to pin the SDK version until the next
servicing release of dotnet SDK.
2023-06-02 23:16:30 +00:00
Tao Chen c23b88df7a Copilot chat: mitigate JS warning (#1319)
### Motivation and Context
There is a warning about list items not having unique keys in
PromptDetails.

![image](https://github.com/microsoft/semantic-kernel/assets/12570346/5be0659b-a76e-464e-b1a1-cb8794dfeb85)

### Description
1. Fix the warning.
2. Replace the React-northstar Input element with the built-in HTML
input element in FileUploader since the inputRef prop is deprecated.
2023-06-02 14:13:40 -07:00
Craig Presti f5be383153 Fix incorrect attribute causing the Qdrant connector to break (#1313)
### Motivation and Context
This PR fixes a regression introduced in #1075 and includes unit tests
to correctly validate that both string and integer property ids are
supported.

### Description
The changes are based on the code suggested by AwesomeYuer over in #794
- the JsonNumberHandling attribute behaved in an unexpected way and was
removed.
2023-06-02 11:29:36 -07:00
Stephen Toub df4ed8ad17 Remove System.Linq.Async dependency from SK (#1299)
We're using very little of the library and can easily achieve the same
things without it. From the core libraries like abstractions, we
shouldn't force all consumers to take the additional 1MB dependency. And
from examples, we shouldn't force anyone copying/pasting to take the
additional dependency

Also removed unnecessary InternalsVisibleTo that were also interfering
with shared source in multiple assemblies.
2023-06-02 13:27:42 +00:00
Stephen Toub 5c6a605d32 Add simple nuget.config to avoid lots of package management warnings (#1301)
Otherwise, someone with multiple package sources defined gets dozens of
warnings like the following when building the repo:
```
warning NU1507: There are 4 package sources defined in your configuration. When using central package management, please map your packa
ge sources with package source mapping (https://aka.ms/nuget-package-source-mapping) or specify a single package source. The following sources are defined: ...
```
2023-06-02 14:18:37 +01:00
Tao Chen fa67b4c872 Copilot Chat: Make message input box input persistent per chat within the UI (#1302)
### Motivation and Context
Bug: When you enter something into the message input box in Copilot Chat
but do not send it, and you switch to another chat session, the message
will appear in the other chat session's message input box.
Expected: You type a message in one of the chat sessions, the message
should only appear in the input box of that chat session. And when you
switch to another session, the input box should become empty or show
whatever is already in there previously.

### Description
1. Remove the feature that enables users to go back to the previous
message by pressing the up arrow key.
2. Fix the bug described above to enable the expected behavior.
2023-06-01 22:05:04 +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
alliscode 1a49468f53 GitHub Repo Q&A: Fixed issue that prevents choosing and saving an OpenAI completions model. (#1305)
### Motivation and Context
When using OpenAI in the GitHub Repo Q&A sample, an error occurs when a
valid chat completions model is chosen from the dropdown list.
Furthermore, selecting a text completions model passes validation but
causes a bad request error when saving.

### Description
Fixed issue by updating the model validation function to test model
selection against the chat completions endpoint rather than the text
completions endpoint.
2023-06-01 19:09:35 +00:00
Mars Wang 77e7272e74 Change the description of the comment due to no "Deployment ID" on Az… (#1290)
…ure OpenAI, should be "Deployment Name"
<img width="968" alt="Screenshot 2023-06-01 at 00 39 02"
src="https://github.com/microsoft/semantic-kernel/assets/68472667/844fddbf-77fe-463d-af90-3fee94044b02">
2023-06-01 19:04:08 +00:00
Stephen Toub aa80f3026f Upgrade System.Text.Json and Microsoft.Extensions.Logging versions to 7.0 (#1297)
Pick up bug fixes and features from these libraries in v7.
2023-06-01 09:53:53 +01:00
Shawn Callegari 94afdce199 Update nuget-package.props
Bump nuget version to 0.15
dotnet-0.15.230531.5-preview
2023-06-01 00:25:20 +01:00
Diego Colombo 69d835cab8 DuckDB as memory storage (#1074)
### 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.
-->
DuckDB is becoming a popular option for in memory OLAP storage. This pr
contributes a MemoryStorage implementation on DuckDB using both tile and
in memory setup.

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
DuckDB memory storage implementation
2023-05-31 11:28:18 -07:00
Chi Chen d095e5a222 Fix Sequential Planner prompt examples (#1254)
In the `skprompt.txt` file, the skill ` _GLOBAL_FUNCTIONS_.SendEmail`
has one input as `recipient` while the plan shows the input as
`email_address`.

### 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-05-31 18:03:15 +00:00