### Motivation and Context
Resolves#1421 by specifying .NET 7.0 SDK as feature for dev container
to install.
Co-authored-by: Craig Presti <[email protected]>
### Motivation and Context
Updating all sample apps to suggest `gpt-3.5-turbo` as an example since
we no longer use text completion models in the samples.
### Motivation and Context
Two attributes in the chat history item needed for testing purposes were accidentally removed.
### Description
Add the attributes back.
### Motivation and Context
Replacing flake8 and isort with ruff in the pre-commit hook.
Adding "I" to ruff rules so that it checks for import errors.
Co-authored-by: Abby Harrison <[email protected]>
### Motivation and Context
### Description
Add command to PRs to properly format Java code.
This PR is a copy of #1304 but `experimental-java` branch is not capable
of creating this workflow.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
---------
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
### 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.
-->
gives users the ability to drag files into the textbox for upload.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- adds additional styling to the `textarea` in `ChatInput` when a file
is being dragged over the element
- uses the existing `importDocument` handler to import the dropped file
> there is a slight lag from when the file is dropped vs when the upload
starts that seems to be a result of when the browser calls `onDrop` for
the `textarea`
### Preview

### 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 😄
---------
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Teresa Hoang <[email protected]>
Co-authored-by: Harleen Thind <[email protected]>
Bumps [torch](https://github.com/pytorch/pytorch) from 2.0.0 to 2.0.1.
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [transformers](https://github.com/huggingface/transformers) from 4.18.0 to 4.30.0.
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
### Motivation and Context
When working through the notebooks, I had the feeling that printing the
chat history at the end, makes it much clearer how it actually looks
like after a bunch of chats. I would like to see this added for
everyone.
### Description
Printing the chat history in the Notebooks at the end of the _Planner_
section
### Description and Motivation
The OpenAPIDocumentParser class has been updated to make it
kernel-agnostic and enable easy reuse in other components where the
conversion functionality may not be needed or may be different.
**Disclaimer**: The conversion logic has not been changed, and the
purpose of this pull request is solely to relocate the conversion logic
from the parser class and not to enhance the logic itself.
### Motivation and Context
This PR enables user to edit a plan before approving or rejecting it:
- User can edit any of the input value fields
- User can delete step(s) (If SequentialPlanner is enabled). Deletion is
disabled when there is only one step.
When plan is returned to the Kernel, the chat message will be updated in
the history repository to reflect the new plan state.
### Description
This PR also contains optimizations for methods handling user actions on
proposed plan and plan schema changes to enable the above.
Chat History will also now reflect any actions the user took on the
plan.
Input Edit Mode:
<img width="665" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/125500434/31b7a5b5-9ca0-432a-bde1-3141e0e8e76f">
Editing Action Plan (inputs only):

Editing SequentialPlanner (inputs and deleting step):

Added 'NoOp' Plan state, where proposedPlan becomes unactionable if app
state changes before user approves or rejects the plan. Potential
reasons for unstable state: required plug-in no longer enabled, access
permissions changed, etc.

> Note: there's some hallucinations with SequentialPlanner, but planner
default is Action. SequentialPlanner stabilizations will continue in
another PR
### Motivation and Context
Fix#1404
### Description
Remove `using` from the code example and add some comments to
`ConnectionMultiplexer` to prevent exceptions due to some accidental
usage.
### Motivation and Context
The addition of the field `additional metadata` to `MemoryRecord` was
not propagated to the weaviate integration tests. This PR ensures that
the fields are properly filled and aligned.
### Description
- Added an entry for `"additional info"` to the memory record test
fixtures for weaviate.
This commit updates the .github/_typos.toml file to add some ignore
rules for jupyter and msbuild files. These rules prevent false positives
from cell id strings and package version numbers that are not actual
typos. The commit also reorganizes the file to use type-specific
sections instead of a default section.
### Motivation and Context
1. Why is this change required?
To show users how to use the WeaviateMemoryStore memory store
2. What problem does it solve?
Users don't know how to config and use the WeaviateMemoryStore memory
store
3. What scenario does it contribute to?
Users want to learn how to config and use the WeaviateMemoryStore memory
store
4. If it fixes an open issue, please link to the issue here.
NA
### Description
Add a notebook to show users how to config and use the
WeaviateMemoryStore memory store in a few examples.
---------
Co-authored-by: Dan Dascalescu <[email protected]>
### Motivation and Context
#1212
### Description
Fixed a bug in the process of checking native function.
---------
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
### Motivation and Context
To take advantage of APIs offered by most LLMs and to be in sync with
.NET SK, this PR introduces the ability to generate multiple text
completions or chat completions from a single prompt.

### Description
- Return type hint for `complete_async` and `complete_chat_async`
changed from `str -> Union[str, List[str]]`. The use of `Union` is the
proper way to indicate multiple return types prior to Python 3.10+. 3.10
supports the use of the `|` symbol, but since the Python SK is supported
on 3.8 and 3.9, I did not adopt the newer standard.
- `complete_async`, `complete_stream_async`, `complete_chat_async`, and
`complete_chat_stream_async` now support settings field
`number_of_responses` greater than 1. Previously only a value of 1 was
supported.
- **Note: hf_text_completion does not support streaming multiple
responses due to a limitation of TextIteratorStreamer. This feature
requires the ability to parse distinct responses from
TextIteratorStreamer.**
- Fixed a bug where `complete_async` was streaming single responses as
1D arrays, content now is simply a string.
### Example Usage
#### Setup
```
kernel = sk.Kernel()
# Configure OpenAI service
api_key, org_id = sk.openai_settings_from_dot_env()
oai_text_service = OpenAITextCompletion("text-davinci-003", api_key, org_id)
oai_chat_service = OpenAIChatCompletion("gpt-3.5-turbo", api_key, org_id)
# Configure Hugging Face service
hf_text_service = HuggingFaceTextCompletion("gpt2", task="text-generation")
# Configure Prompt
prompt = "what is the purpose of a rubber duck?"
# Configure Request Settings
text_request_settings_multi = CompleteRequestSettings(
max_tokens=100,
temperature=0.7,
top_p=1,
frequency_penalty=0.5,
presence_penalty=0.8,
number_of_responses=4
)
chat_request_settings_multi = ChatRequestSettings(
max_tokens=100,
temperature=0.7,
top_p=1,
frequency_penalty=0.5,
presence_penalty=0.8,
number_of_responses=4
)
```
#### Text Completion (Standard)
```
texts = await oai_text_service.complete_async(prompt, text_request_settings_multi)
i = 0
for text in texts:
print("Option " + str(i) + ": " + text)
i += 1
```
#### Streaming Text Completion
```
multi_stream = oai_text_service.complete_stream_async(prompt, text_request_settings_multi)
texts = [''] * text_request_settings_multi.number_of_responses
async for text in multi_stream:
i = 0
os.system('cls' if os.name == 'nt' else 'clear') # clear the screen for a better experience
print("PROMPT: " + prompt)
for option in text:
texts[i] = texts[i] + option
print("{0}: {1}".format(i, texts[i]))
i += 1
```
#### Chat Completion (Standard)
```
texts = await oai_chat_service.complete_chat_async([("user",prompt)], chat_request_settings_multi)
i = 0
for text in texts:
print("Option " + str(i) + ": " + text)
i += 1
```
#### Streaming Chat Completion
```
multi_stream = oai_chat_service.complete_chat_stream_async([("user",prompt)], chat_request_settings_multi)
texts = [''] * chat_request_settings_multi.number_of_responses
async for text in multi_stream:
i = 0
os.system('cls' if os.name == 'nt' else 'clear') # clear the screen for a better experience
print("PROMPT: " + prompt)
for option in text:
texts[i] = texts[i] + option
print("{0}: {1}".format(i, texts[i]))
i += 1
```
#### HuggingFace Standard Completion
```
texts = await hf_text_service.complete_async(prompt, request_settings_multi)
i = 0
for text in texts:
print("-----------------------------------")
print("Option " + str(i) + ": " + text)
i += 1
```
### Motivation and Context
Many people run into the issue of wanting to use ChatCompletion models
like gpt-35-turbo or gpt4 for building Semantic Skills but aren't aware
that they need to update the API to do so. This adds some examples in
the Jupyter notebooks to illustrate the concept.
### Motivation and Context
Minor fix to the notebook text to fix discrepancy between XML and JSON.
### Description
It's just a small inconsistency that I noticed in the notebooks.
Presumably the notebook used to output XML plans, but the notebook now
outputs JSON plans, so the text should be updated to reflect that.
### Motivation and Context
We need a pipeline and tests to gate PRs coming into Copilot Chat.
### Description
1. Add a simple end to end test that simulates log in and sending a
message to the bot. Will add more tests in the future.
2. Add a new GitHub action that will run against PRs that modify the
Copilot sample app.
3. Fix a bug where the BackendProbe component doesn't automatically
retry.
Note: need to add a couple new GitHub secrets for the action to pass.
### Motivation and Context
Now when uploading a file in the chat a card will be shown indicating a
success rather than the alert banner at the top.
### Description
- adds `type` to the `ChatMessage` model
- updates `ChatHistory` to render the new `ChatHistoryFileItem` or the
existing `ChatHistoryItem` based on the `type` of the message
- updates `ChatSkill` to not generate a bot response if the message
`type` is `ChatMessageType.Document`
### Preview

### Description
This PR brings the following changes:
- The Qdrant-related classes, namely QdrantMemoryStore and
QdrantVectorDbClient, have extended support for various creation methods
based on Qdrant endpoint, HttpClient, or both.
- The KernelBuilder class has new extension methods called
"WithQdrantMemoryStore" that simplify the registration of the Qdrant
memory store. These methods align the registration process with other
connector registrations, enforce the use of a HttpClient with the
preconfigured retry handler, and allow the hosting application to
provide a custom HttpClient if needed.
- Minor bug fix.
### Motivation and Context
Redis supports cosine similarity search by the
[RediSearch](https://redis.io/docs/stack/search) module.
### Description
Add a new Semantic Memory Connector leveraging Redis with RediSearch
module. Update the syntax example to demonstrate how it is used.
Co-authored-by: Dmytro Struk <[email protected]>
### 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]>
### 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.
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.
### 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`