Commit Graph
203 Commits
Author SHA1 Message Date
4b2b93d8b0 Python: Update .env with weaviate (#2148)
Included weaviate env variables

---------

Co-authored-by: Dmytro Struk <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
2023-08-25 23:06:36 +00:00
Sneha a311422a52 Python: Include token_selection_biases in PromptTemplateConfig (#2565)
### 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.
-->

`token_selection_biases` was missing from constructors in
`PromptTemplateConfig` and `CompleteRequestSettings`

Closes #2564 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Added `token_selection_biases` into the config template and defaults to
an empty dictionary

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
2023-08-24 21:20:53 +00:00
Karol ŻakandAbby Harrison 601c9de124 Python: Add HF model and pipeline kwargs to allow model loading customization (#2547)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

I was trying to use this library to load and use [HF Falcon
model](https://huggingface.co/tiiuae/falcon-7b-instruct). Unfortunately
in order to make it work I needed to pass in some additional arguments
such as `torch_dtype`, `cache_dir` or `tokenizer`. It was not possible
with current implementation so I decided to add `model_kwargs` and
`pipeline_kwargs` to the `HuggingFaceTextCompletion` class init function
so now, with the changes I introduced I can successfully load any
`falcon` models by using this code:
```python
import semantic_kernel as sk
import semantic_kernel.connectors.ai.hugging_face as sk_hf
import torch
from transformers import AutoTokenizer


cache_dir = "/mnt/tmp"
model_name = "tiiuae/falcon-7b-instruct"

tokenizer = AutoTokenizer.from_pretrained(
    pretrained_model_name_or_path=model_name,
    cache_dir=cache_dir,
    trust_remote_code=True)

hf_model = sk_hf.HuggingFaceTextCompletion(
    model_name,
    task="text-generation",
    model_kwargs={
        "cache_dir": cache_dir,
        "torch_dtype": torch.bfloat16
    },
    pipeline_kwargs={
        "tokenizer": tokenizer,
        "trust_remote_code": True,
        "device": 0,
    }
)
```

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

The changes I introduced add `model_kwargs` and `pipeline_kwargs` to
`HuggingFaceTextCompletion` class so that these arguments are then
passed to the underlying `transformers.pipeline()` function and thus
allow more customization options.

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-24 18:24:12 +00:00
Abby HarrisonandLee Miller 052fb2ea96 Python: Integration tests 'needs' path filter job (#2557)
### Motivation and Context

PRs #2533 and #2555 updated the integration tests to trigger off of
python changes only, but did not actually have the resulting jobs
require the path filtering. This means that the tests never run.

### Description
Add path-filter job as a requirement for subsequent jobs.

### Contribution Checklist

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

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

---------

Co-authored-by: Lee Miller <[email protected]>
2023-08-24 16:41:15 +00:00
f251e654ec Python: Enable serialization for sk/orchestration (#2369)
SKFunction has been excluded for now.

Handles issues arising due to many circular imports Update
DelegateInference to handle some cases where annotation is given as a
string to avoid circular imports like in FileIOSkill.

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Mark Karle <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
2023-08-24 16:05:39 +00:00
Devis Lucato 13930691e7 Update pyproject.toml 2023-08-23 17:01:11 -07:00
e78242c887 Python : Adding Sample for Azure Cognitive Search Memory (#2510)
### Motivation and Context

This PR resolves
https://github.com/microsoft/semantic-kernel/issues/2493

### Description
The ACS implementation is different from VoltalileMemoryStore and we
don't have any samples for Azure Cognitive Search Memory Store. I want
to add Python Sample for using AzureCognitiveSearchMemoryStore with
OpenAI embeddings.

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
2023-08-23 23:53:20 +00:00
4e72b9d6ca Python: add restore method to chat_prompt_template (#2495)
### 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.
-->
In order to add ways to save and restore a running conversation this
adds a restore method and a property to the ChatPromptTemplate class.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Add messages property which provides a view to the role,
message.template tuple
2. Add restore classmethod that takes the same input as a regular init,
but adds a list of tuples, it then loops through that list and adds each
message.

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
2023-08-23 23:52:56 +00:00
Julio Carlos Menendez b228346936 Python: Add missing parameter logger on inheriting classes and makes it optional (#2537)
### Motivation and Context
Makes the `logger` parameter optional in
`TextCompletionClientBase.complete_async`,
`TextCompletionClientBase.complete_stream_async`,
`ChatCompletionClientBase.complete_chat_async`, and
`ChatCompletionClientBase.complete_chat_stream_async` to match the
current usage across the project where it's not passed.
It also adds that `logger` optional parameter to the inheriting classes
where needed to match the base class method signatures.

Resolves #2509

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
2023-08-23 23:48:12 +00:00
3881a3137f Python: Adding USearch memory connector (#2358)
### Motivation and Context

The integration of [USearch](https://github.com/unum-cloud/usearch) as a
memory connector to Semantic Kernel (SK).

### Description
     
The USearch `Index` does not natively have the ability to store
different collections, and it only stores embeddings without other
attributes like `MemoryRecord`.

The `USearchMemoryStore` class encapsulates these capabilities. It uses
the USearch `Index` to store a collection of embeddings under unique
IDs, with original collection names mapped to those IDs. Other
`MemoryRecord ` attributes are stored in a `pyarrow.Table`, which is
mapped to each collection.

It's important to note the current behavior when a user removes a record
or upserts a new one with an existing ID: the old row is not removed
from the `pyarrow.Table`. This is done for performance reasons but could
lead to the table growing in size.

By default, `USearchMemoryStore` operates as an in-memory store. To
enable persistence, you must set the persist mode with calling
appropriate `__init__ `, supplying a path to the directory for the
persist files. For each collection, two files will be created:
`{collection_name}.usearch` and `{collection_name}.parquet`. Changes
will only be dumped to the disk when `close_async` is called. Due to the
interface provided by the base class `MemoryStoreBase`, this happens
implicitly when using a context manager, or it may be called explicitly.

Since collection names are used to store files on disk, all names are
converted to lowercase.

To ensure efficient use of memory, you should call `close_async`.
---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
2023-08-23 16:18:36 -07:00
4bc5ff716d Python: provide methods to register single native function to the kernel (#2390)
### 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.
-->
solve #2321 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
2023-08-23 22:59:08 +00:00
Aditya GudimellaandAbby Harrison 9a1609cbac Python: Added Snoop as a development dependency (#2457)
### Motivation and Context

Add snoop as a dev dependency for easier debugging of tests.

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

Co-authored-by: Abby Harrison <[email protected]>
2023-08-23 21:12:04 +00:00
05afd29ef6 Python: add stepwise planner (#2223)
### 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.
-->
implement stepwise planner #2221

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-23 19:12:52 +00:00
0a477b198c Python: Update examples and notebooks to stop using text-davinci-003 (#2359)
### Motivation and Context

text-davinci-003 is being retired by Azure OpenAI and is no longer
supported for new deployments

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

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

Update examples and notebooks to use gpt-35-turbo / gpt-3.5-turbo
instead

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

Signed-off-by: karthikmurali60 <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Gil LaHaye <[email protected]>
2023-08-23 17:24:56 +00:00
Lee Miller 9a5f2d6a5a Python: Update fake skill and planner test (#2535)
Fix failing integration tests introduced in #2474 (May be filing follow
up issue on that)

- Update WriterSkillFake to include a context parameter for the end
marker
- Update test_sequential_planner to use the new end marker parameter in
WriterSkillFake

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
2023-08-23 16:08:08 +00:00
98d2d9fa2e Python: ACS should use Hnsw for vector indexing (#2534)
### Motivation and Context

This PR builds on https://github.com/microsoft/semantic-kernel/pull/2435
- the previous PR updates azure-search to the latest package , where it
is recommended to use HnswVectorSearchAlgorithmConfiguration. The
previous implementation appears to be in a semi-deprecated state.

This new flow is the publicly recommended use for ACS according to
https://github.com/Azure/cognitive-search-vector-pr/tree/main/demo-python/code.

### Description
- update `azure-search-documents` dependency from `11.4.0b6 -> 11.4.0b8`
- index configuration changed from `VectorSearchAlgorithmConfiguration
-> HnswVectorSearchAlgorithmConfiguration`
- update `search_client.search()` call in `get_nearest_matches()` to be
consistent with the new index api

### Contribution Checklist

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

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

---------

Co-authored-by: Kinfey <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Kinfey <[email protected]>
2023-08-22 23:56:49 +00:00
Abby Harrison f0ab0fbd40 Python: Revert "Python: Update Azure Cognitive Search Class Change VectorSearchAlgorithmConfi…" (#2531)
Reverts microsoft/semantic-kernel#2435

This PR caused a breaking change to the ACS memory store's
get_nearest_matches method
2023-08-22 19:49:09 +00:00
59cbbdb2af Python: Add Google PaLM connector with chat completion and text embedding (#2258)
### Motivation and Context

Implementation of Google PaLM connector with chat completion, text
embedding and three example files to demonstrate their functionality.
Closes #2098
I also opened a PR for text completion #2076

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.

-->

### Description
**What's new:**
1. Implemented Google Palm connector with chat completion and text
embedding
2. Added 3 example files to `python/samples/kernel-syntax-examples`
3. The example files show PaLM chat in action with skills, memory, and
just with user messages. The memory example uses PaLM embedding as well
5. Added integration tests to test chat with skills and embedding with
kernel.memory functions
6. Added unit tests to verify successful class initialization and
correct behavior from class functions
  
**There are some important differences between google palm chat and open
ai chat:**

1. PaLM has two functions for chatting, `chat` and `reply`. The chat
function in google's genai library starts a new conversation, and reply
continues the conversation. Reply is an attribute of the response object
returned by chat. So an instance of the `GooglePalmChatCompletion` class
needs a way to determine which function to use, which is why I
introduced a private attribute to store the response object. See
https://developers.generativeai.google/api/python/google/generativeai/types/ChatResponse
2. PaLM does not use system messages. Instead, the chat function takes a
parameter called context. It serves the same purpose, to prime the
assistant with certain behaviors and information. So when the user
passes a system message to `complete_chat_async`, it is passed to `chat`
as the context parameter.
3. Semantic memory works with the chat service as long as the user
creates a chat prompt template. The prompt containing the memory needs
to be added to the chat prompt template as a system message. See
`python\samples\kernel-syntax-examples\google_palm_chat_with_memory.py`
for more details. If the only purpose of `complete_async` in
`GooglePalmChatCompletion` is to send memories + user messages to the
chat service as a text prompt, then `complete_async` is not fulfilling
its intended purpose. A possible solution would be to send the text
prompt as a request to the text service within `complete_async`.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

Currently no warnings, there was 1 warning when first installing genai
with `poetry add google.generativeai==v0.1.0rc2` from within poetry
shell: "The locked version 0.1.0rc2 for google-generativeai is a yanked
version. Reason for being yanked: Release is marked as supporting Py3.8,
but in practice it requires 3.9". We would need to require later
versions of python to fix it.

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-21 23:56:44 +00:00
dependabot[bot] b24045e324 Python: Bump ruff from 0.0.283 to 0.0.285 in /python (#2521)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.283 to 0.0.285.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/releases">ruff's
releases</a>.</em></p>
<blockquote>
<h2>v0.0.285</h2>
<h2>What's Changed</h2>
<h3>New rules</h3>
<ul>
<li>[<code>flake8-pytest-style</code>] Implement
<code>pytest-unittest-raises-assertion</code> (<code>PT027</code>) by <a
href="https://github.com/harupy"><code>@​harupy</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6554">astral-sh/ruff#6554</a></li>
<li>[<code>flake8-pytest-style</code>] Implement
<code>pytest-duplicate-parametrize-test-cases</code>
(<code>PT014</code>) by <a
href="https://github.com/harupy"><code>@​harupy</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6598">astral-sh/ruff#6598</a></li>
<li>[<code>flake8-tidy-imports</code>] Implement
<code>banned-module-level-imports</code> (<code>TID253</code>) by <a
href="https://github.com/durumu"><code>@​durumu</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6378">astral-sh/ruff#6378</a></li>
<li>[<code>pylint</code>] Implement <code>bad-dunder-name</code>
(<code>W3201</code>) (in the Ruff nursery) by <a
href="https://github.com/LaBatata101"><code>@​LaBatata101</code></a> in
<a
href="https://redirect.github.com/astral-sh/ruff/pull/6486">astral-sh/ruff#6486</a></li>
<li>[<code>pylint</code>] Implement <code>subprocess-run-check</code>
(<code>W1510</code>) by <a
href="https://github.com/tjkuson"><code>@​tjkuson</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6487">astral-sh/ruff#6487</a></li>
<li>[<code>ruff</code>] Implement <code>quadratic-list-summation</code>
(<code>RUF017</code>) by <a
href="https://github.com/evanrittenhouse"><code>@​evanrittenhouse</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6489">astral-sh/ruff#6489</a></li>
</ul>
<h3>Rule changes</h3>
<ul>
<li>[<code>flake8-bugbear</code>] Add autofix for <code>B006</code> by
<a href="https://github.com/qdegraaf"><code>@​qdegraaf</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6131">astral-sh/ruff#6131</a></li>
<li>[<code>flake8-pyi</code>] Avoid applying <code>PYI055</code> to
runtime-evaluated annotations by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6457">astral-sh/ruff#6457</a></li>
<li>[<code>flake8-self</code>] Allow <code>os._exit</code> accesses in
<code>SLF001</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6490">astral-sh/ruff#6490</a></li>
<li>[<code>perflint</code>] Ignore <code>PERF203</code> if
<code>try</code> contains loop control flow statements by <a
href="https://github.com/evanrittenhouse"><code>@​evanrittenhouse</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6536">astral-sh/ruff#6536</a></li>
<li>[<code>pylint</code>] Check for invalid format type specifiers in
nested replacements for <code>PLE1300</code> by <a
href="https://github.com/zanieb"><code>@​zanieb</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6616">astral-sh/ruff#6616</a></li>
<li>[<code>tryceratops</code>] Omit <code>NotImplementedError</code>
from <code>TRY003</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6568">astral-sh/ruff#6568</a></li>
</ul>
<h3>Settings</h3>
<ul>
<li>Respect <code>.ipynb</code> and <code>.pyi</code> sources when
linting from stdin by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6628">astral-sh/ruff#6628</a></li>
<li>Support glob patterns for <code>raises_require_match_for</code> and
<code>raises_require_match_for</code> by <a
href="https://github.com/harupy"><code>@​harupy</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6635">astral-sh/ruff#6635</a></li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Make <code>lambda-assignment</code> fix always-manual in class
bodies by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6626">astral-sh/ruff#6626</a></li>
<li>Fix counting of message arguments when msg is provided as a keyword
by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6456">astral-sh/ruff#6456</a></li>
<li>Add container types to <code>E721</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6469">astral-sh/ruff#6469</a></li>
<li>Respect scoping rules when identifying builtins by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6468">astral-sh/ruff#6468</a></li>
<li>Respect tab width in line-length heuristic by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6491">astral-sh/ruff#6491</a></li>
<li>Respect dummy-variable-rgx for unused bound exceptions by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6492">astral-sh/ruff#6492</a></li>
<li>Fix detection of top-level imports with newlines in
<code>E402</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6526">astral-sh/ruff#6526</a></li>
<li>Allow if-expression with dual string arms in
<code>invalid-envvar-value</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6538">astral-sh/ruff#6538</a></li>
<li>Add deprecated unittest assertions to PT009 by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6572">astral-sh/ruff#6572</a></li>
<li>Avoid unused argument rules when functions call
<code>locals()</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6578">astral-sh/ruff#6578</a></li>
<li>Allow top-level <code>await</code> in Jupyter notebooks by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6607">astral-sh/ruff#6607</a></li>
<li>Don't detect <code>pandas#values</code> for stores, deletes, or
class accesses by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6631">astral-sh/ruff#6631</a></li>
<li>Avoid removing parentheses in <code>E712</code> fix by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6575">astral-sh/ruff#6575</a></li>
<li>Skip whitespace between comments at start of file e.g. for
<code>I002</code> by <a
href="https://github.com/durumu"><code>@​durumu</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6523">astral-sh/ruff#6523</a></li>
<li>Add support for nested replacements inside format specifications
e.g. for <code>PLE1300</code> by <a
href="https://github.com/zanieb"><code>@​zanieb</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6616">astral-sh/ruff#6616</a></li>
</ul>
<h3>Playground</h3>
<ul>
<li>Shared playground links now use short URLs by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6383">astral-sh/ruff#6383</a></li>
<li>Fix possible JSON parse error on playground load by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6519">astral-sh/ruff#6519</a></li>
<li>Fix unreachable panic in playground by <a
href="https://github.com/MichaReiser"><code>@​MichaReiser</code></a> in
<a
href="https://redirect.github.com/astral-sh/ruff/pull/6623">astral-sh/ruff#6623</a></li>
</ul>
<h3>Performance</h3>
<ul>
<li>Improve tokenizer performance for ASCII only identifiers by <a
href="https://github.com/MichaReiser"><code>@​MichaReiser</code></a> in
<a
href="https://redirect.github.com/astral-sh/ruff/pull/6609">astral-sh/ruff#6609</a></li>
</ul>
<h2>New Contributors</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md">ruff's
changelog</a>.</em></p>
<blockquote>
<h1>Breaking Changes</h1>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/astral-sh/ruff/commit/5892c691ea6389dcf53b2212bae7a3acd61ca15f"><code>5892c69</code></a>
Bump version to 0.0.285 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6660">#6660</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/82e0a97b34ad506d3762b531cded138b4119cbc5"><code>82e0a97</code></a>
Clarify behavior of <code>PLW3201</code> (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6657">#6657</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/a8d7bbae6f8a1e6d425179895528a7e2127ab092"><code>a8d7bba</code></a>
Remove experimental label from Jupyter docs (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6655">#6655</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/1050142a5822db09888042da641c5b2fe6ab3aae"><code>1050142</code></a>
Expand expressions to include parentheses in E712 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6575">#6575</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/db1c5565083fe16b3e2c8892a39412e464b320a1"><code>db1c556</code></a>
Implement <code>Ranged</code> on more structs (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6639">#6639</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/a70807e1e12e6ebac461d54e25247df81655a4e1"><code>a70807e</code></a>
Expand <code>NamedExpr</code> range to include full range of
parenthesized value (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6632">#6632</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d9bb51dee4d455bbc18c1ebe6e8c2913790e5b0e"><code>d9bb51d</code></a>
ci(deps): bump cloudflare/wrangler-action from 3.0.0 to 3.0.2 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6565">#6565</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d0f2a8e424a7914357d892b3d2ec327735d309d5"><code>d0f2a8e</code></a>
Add support for nested replacements inside format specifications (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6616">#6616</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/1334232168972f340e515463afe57ec9867eb678"><code>1334232</code></a>
Introduce <code>ExpressionRef</code> (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6637">#6637</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/fa7442da2f2d43b65107e41994bbce7ac624faee"><code>fa7442d</code></a>
Support <code>fmt: skip</code> on compound statements (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6593">#6593</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/astral-sh/ruff/compare/v0.0.283...v0.0.285">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ruff&package-manager=pip&previous-version=0.0.283&new-version=0.0.285)](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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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-08-21 22:54:12 +00:00
JoowonandAbby Harrison e42f7fabe8 Python fix native function default parameter (#2474)
### 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.
-->
solve #2473  and add unit test to prevent this from happening again. 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-21 22:54:02 +00:00
4b47a783be Python: Update 03-semantic-function-inline.ipynb (#2425)
### Motivation and Context

Example notebook has some params error when I learn from it, so I fix
this simple params error.

### Description

Fix AzureChatCompletion params error, Azure OpenAI Service should pass
DEPLOY_NAME, but not MODEL_NAME

### Contribution Checklist

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

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

Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-21 22:41:49 +00:00
KinfeyandLee Miller 8a7e84ccbc Python: Update Azure Cognitive Search Class Change VectorSearchAlgorithmConfi… (#2435)
…guration to HnswVectorSearchAlgorithmConfiguration

### 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?
  
Azure Cognitive Search SDK Change VectorSearchAlgorithmConfiguration to
HwsnVectorSearchAlgorithmConfiguration
  
  2. What problem does it solve?
  
ImportError: cannot import name 'VectorSearchAlgorithmConfiguration'
from 'azure.search.documents.indexes.models'
  
  3. What scenario does it contribute to?

Python SDK Vector DB Change

  5. If it fixes an open issue, please link to the issue here.
  

https://github.com/Azure/cognitive-search-vector-pr/blob/main/demo-python/code/azure-search-vector-python-sample.ipynb

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Lee Miller <[email protected]>
2023-08-21 15:37:54 +00:00
8502b129ff Python: added num_records parameter to text memory skill (#2236)
### 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.
-->
The `text_memory_skill` in the core skills was setup to only return 1
record, while the underlying memories all have support for multiple, so
I added a parameter to the recall function to use that.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Added parameter, passed that on to the memory call.
### Contribution Checklist

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

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

---------

Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-17 21:57:32 +00:00
b029e50b6d Python: Add Google PaLM connector with text completion and example file (#2076)
### 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.
-->
Implementation of Google PaLM connector with text completion and an
example file to demonstrate its functionality.
Closes #1979

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

1. Implemented Google Palm connector with text completion 
2. Added example file to ```python/samples/kernel-syntax-examples```
3. Added integration tests with different inputs to kernel.run_async
4. Added unit tests to ensure successful initialization of the class and
successful API calls
5. 3 optional arguments (top_k, safety_settings, client) for
google.generativeai.generate_text were not included. See more
information about the function and its arguments:
https://developers.generativeai.google/api/python/google/generativeai/generate_text

I also opened a PR for text embedding and chat completion #2258

### Contribution Checklist

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

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

Currently no warnings, there was 1 warning when first installing genai
with `poetry add google.generativeai==v0.1.0rc2` from within poetry
shell: "The locked version 0.1.0rc2 for google-generativeai is a yanked
version. Reason for being yanked: Release is marked as supporting Py3.8,
but in practice it requires 3.9". We would need to require later
versions of python to fix it.

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-17 21:56:26 +00:00
11f010be54 Python: Better Integration Test Reporting (#2420)
### Motivation and Context

Only run integration tests in the merge queue, as a schedule, or
manually dispatched. Also only report the workflow status once instead
of for each individual job.

### Description
Workflow:
https://github.com/microsoft/semantic-kernel/actions/runs/5881608721/job/15954117883

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Dmytro Struk <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
2023-08-16 22:23:48 +00:00
Devis Lucato c1ad8dce0b Update pyproject.toml 2023-08-10 14:33:07 -07:00
Abby HarrisonandAbby Harrison b9c77f45e7 Python: Fix parameter propagation bug in Plan Object Model (#2388)
### Motivation and Context

Initially called out and fixed by @joowon-dm-snu in
https://github.com/microsoft/semantic-kernel/pull/2223

This PR closes
[#2094](https://github.com/microsoft/semantic-kernel/issues/2094)

There was a bug in the Plan Object Model that propagates the name of the
step parameter to the next step. It should be propagating the
parameter's value


### Description
In addition to making the code change to fix the bug, also added a unit
test that covers the changed code.

Below image shows the before and after of the test with the fix. 


![image](https://github.com/microsoft/semantic-kernel/assets/54643756/7217f42a-a2ac-4491-a709-bea9be7328e3)

### Contribution Checklist

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

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

Co-authored-by: Abby Harrison <[email protected]>
2023-08-10 00:30:34 +00:00
dependabot[bot] 274c4fd410 Python: Bump azure-identity from 1.13.0 to 1.14.0 in /python (#2384)
Bumps [azure-identity](https://github.com/Azure/azure-sdk-for-python)
from 1.13.0 to 1.14.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-sdk-for-python/releases">azure-identity's
releases</a>.</em></p>
<blockquote>
<h2>azure-identity_1.14.0</h2>
<h2>1.14.0 (2023-08-08)</h2>
<h3>Features Added</h3>
<ul>
<li>Continuous Access Evaluation (CAE) is now configurable per-request
by setting the <code>enable_cae</code> keyword argument to
<code>True</code> in <code>get_token</code>. This applies to user
credentials and service principal credentials. (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/pull/30777">#30777</a>)</li>
</ul>
<h3>Breaking Changes</h3>
<ul>
<li>CP1 client capabilities for CAE is no longer always-on by default
for user credentials. This capability will now be configured as-needed
in each <code>get_token</code> request by each SDK. (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/pull/30777">#30777</a>)
<ul>
<li>Suffixes are now appended to persistent cache names to indicate
whether CAE or non-CAE tokens are stored in the cache. This is to
prevent CAE and non-CAE tokens from being mixed/overwritten in the same
cache. This could potentially cause issues if you are trying to share
the same cache between applications that are using different versions of
the Azure Identity library as each application would be reading from a
different cache file.</li>
<li>Since CAE is no longer always enabled for user-credentials, the
<code>AZURE_IDENTITY_DISABLE_CP1</code> environment variable is no
longer supported.</li>
</ul>
</li>
</ul>
<h3>Bugs Fixed</h3>
<ul>
<li>Credential types correctly implement <code>azure-core</code>'s
<code>TokenCredential</code> protocol. (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/25175">#25175</a>)</li>
</ul>
<h2>azure-identity_1.14.0b2</h2>
<h2>1.14.0b2 (2023-07-11)</h2>
<h3>Features Added</h3>
<ul>
<li>Added <code>workload_identity_tenant_id</code> support in
<code>DefaultAzureCredential</code>.</li>
</ul>
<h2>azure-identity_1.14.0b1</h2>
<h2>1.14.0b1 (2023-06-06)</h2>
<h3>Features Added</h3>
<ul>
<li>Continue attempt next credential when finding an expired token from
cached token credential in DefaultAzureCredential. (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/pull/30441">#30441</a>)</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>VisualStudioCodeCredential prints an informative error message when
used (as it is currently broken) (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/pull/30385">#30385</a>)</li>
<li>Removed dependency on <code>six</code>. (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/pull/30613">#30613</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/85d3fb50ccc16d6ce8171a0e045a754838749080"><code>85d3fb5</code></a>
update release date (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31501">#31501</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/3a6c7f48c92b5d590aa7ab16ee0c04358a7b0ec1"><code>3a6c7f4</code></a>
Identity changelog (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31454">#31454</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/0464b2a853763434fffed730af097411b1681cb8"><code>0464b2a</code></a>
[Identity] Correctly implement TokenCredential protocols (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31047">#31047</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/e7a9aed09339ebe57741059a99cca5f023a95f94"><code>e7a9aed</code></a>
Add a type in identity (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31431">#31431</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/72214111a9db39fe13402ffefe78c2d026032ad0"><code>7221411</code></a>
disable beta features (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31385">#31385</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/f6d7789694e813d23ba8e3b903f1cf4a9d59c8c2"><code>f6d7789</code></a>
[Identity] Enable CAE toggle per token request (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/30777">#30777</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/9f1bf3a83f4f3b7592e8af03dc9681aae121dc01"><code>9f1bf3a</code></a>
Identity not use is chained (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31328">#31328</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/e8d95188c45a99773d346a90f465f38d47145a6b"><code>e8d9518</code></a>
[Identity] Enable black formatting in CI (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31315">#31315</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/6ed3e1541cc7e24d4ab9a57bd1438d35ab0e82b8"><code>6ed3e15</code></a>
make is_chained internal only (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31296">#31296</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/57146235c1c597b56fb56e8796eec7aa62fcc51e"><code>5714623</code></a>
Identity new msal (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31267">#31267</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/Azure/azure-sdk-for-python/compare/azure-identity_1.13.0...azure-identity_1.14.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=azure-identity&package-manager=pip&previous-version=1.13.0&new-version=1.14.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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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-08-09 18:06:09 +00:00
dependabot[bot] 65593a2b33 Python: Bump azure-core from 1.28.0 to 1.29.0 in /python (#2382)
Bumps [azure-core](https://github.com/Azure/azure-sdk-for-python) from
1.28.0 to 1.29.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-sdk-for-python/releases">azure-core's
releases</a>.</em></p>
<blockquote>
<h2>azure-core_1.29.0</h2>
<h2>1.29.0 (2023-08-03)</h2>
<h3>Features Added</h3>
<ul>
<li>A keyword argument <code>enable_cae</code> was added to the
<code>get_token</code> method of the <code>TokenCredential</code>
protocol. <a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31012">#31012</a></li>
<li><code>BearerTokenCredentialPolicy</code> and
<code>AsyncBearerTokenCredentialPolicy</code> now accept
<code>enable_cae</code> keyword arguments in their constructors. This is
used in determining if <a
href="https://learn.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation">Continuous
Access Evaluation (CAE)</a> should be enabled for each
<code>get_token</code> request. <a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31012">#31012</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/c4c18a7b427633c0519016d762dc141ae743e41b"><code>c4c18a7</code></a>
Type Complete config and settings (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31422">#31422</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/d0e378e4bbcede2aab113b71bb5340eebd776d4f"><code>d0e378e</code></a>
Azure-Core Exceptions: Type Complete (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31056">#31056</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/8d94f35aa1d7eda334f47e57e365cf41cbc17886"><code>8d94f35</code></a>
Skip publishing docs.ms for track 1 package (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31437">#31437</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/128a8c85e71c0000a1de8faab06356d4a6fba2df"><code>128a8c8</code></a>
Update changelog (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31452">#31452</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/8b1513b44be265bfe68dbf3ee54ca9313bd8e16d"><code>8b1513b</code></a>
Address arch review feedback (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31436">#31436</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/7764d2cb6646b5c611df24d15798555638096603"><code>7764d2c</code></a>
rename HTTPResponseType_co to HTTPResponseType (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31356">#31356</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/93c031758e3e98ca89b35185911262d6f16a0c1b"><code>93c0317</code></a>
[Core Experimental] Fix HTTPX Sample and Bug Fix (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31370">#31370</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/630864674a734f6a61f62827599ef6e94570eca1"><code>6308646</code></a>
update version and changelog (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31374">#31374</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/4d7b89809c9f20110271f927cda6623eacdab946"><code>4d7b898</code></a>
cleanup unwanted kwargs for transport (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31347">#31347</a>)</li>
<li><a
href="https://github.com/Azure/azure-sdk-for-python/commit/a5b7fb5a9e8789acf5dfa00affa3e48d50a84019"><code>a5b7fb5</code></a>
Increment tracing plugin changelogs (<a
href="https://redirect.github.com/Azure/azure-sdk-for-python/issues/31107">#31107</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/Azure/azure-sdk-for-python/compare/azure-core_1.28.0...azure-core_1.29.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=azure-core&package-manager=pip&previous-version=1.28.0&new-version=1.29.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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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-08-09 18:05:32 +00:00
dependabot[bot] f3fc31b8ef Python: Bump ruff from 0.0.282 to 0.0.283 in /python (#2381)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.282 to 0.0.283.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/releases">ruff's
releases</a>.</em></p>
<blockquote>
<h2>v0.0.283</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>Breaking Changes</h3>
<ul>
<li>Assume Python 3.8 instead of 3.10 for target version by <a
href="https://github.com/zanieb"><code>@​zanieb</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6397">astral-sh/ruff#6397</a></li>
</ul>
<h3>Rules</h3>
<ul>
<li>[<code>flake8-pyi</code>] <code>PYI019</code>: Detects if a type
variable is used instead of <code>Self</code> in return annotations by
<a href="https://github.com/qdegraaf"><code>@​qdegraaf</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6204">astral-sh/ruff#6204</a></li>
<li>[<code>flake8-pyi</code>] <code>PYI051</code>: Detects unions of
<code>Literal</code> types by <a
href="https://github.com/LaBatata101"><code>@​LaBatata101</code></a> in
<a
href="https://redirect.github.com/astral-sh/ruff/pull/6215">astral-sh/ruff#6215</a></li>
<li>[<code>flake8-pyi</code>] <code>PYI055</code>: Detects unions of
<code>type</code>s by <a
href="https://github.com/LaBatata101"><code>@​LaBatata101</code></a> in
<a
href="https://redirect.github.com/astral-sh/ruff/pull/6316">astral-sh/ruff#6316</a></li>
<li>[<code>pylint</code>] <code>E1300</code>: Detects invalid string
format characters by <a
href="https://github.com/silvanocerza"><code>@​silvanocerza</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6171">astral-sh/ruff#6171</a></li>
<li>[<code>pyupgrade</code>] <code>UP040</code>: Upgrades type alias
annotations to use PEP-695 syntax by <a
href="https://github.com/zanieb"><code>@​zanieb</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6289">astral-sh/ruff#6289</a></li>
</ul>
<h3>Rule Changes</h3>
<ul>
<li>[<code>flake8-boolean-trap</code>] <code>FBT003</code>: Add
<code>is_</code> and <code>is_not</code> to excluded functions by <a
href="https://github.com/zanieb"><code>@​zanieb</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6307">astral-sh/ruff#6307</a></li>
<li>[<code>flake8-logging-format</code>] Allow capitalized names for
logger candidate heuristic match by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6356">astral-sh/ruff#6356</a></li>
<li>[<code>flake8-pyi</code>] Applicable rules are now checked non-stub
code by <a href="https://github.com/andersk"><code>@​andersk</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6297">astral-sh/ruff#6297</a>
<ul>
<li><code>PYI013</code>: <a
href="https://beta.ruff.rs/docs/rules/ellipsis-in-non-empty-class-body"><code>ellipsis-in-non-empty-class-body</code></a></li>
<li><code>PYI016</code>: <a
href="https://beta.ruff.rs/docs/rules/duplicate-union-member"><code>duplicate-union-member</code></a></li>
<li><code>PYI018</code>: <a
href="https://beta.ruff.rs/docs/rules/unused-private-type-var"><code>unused-private-type-var</code></a></li>
<li><code>PYI019</code>: <a
href="https://beta.ruff.rs/docs/rules/custom-type-var-return-type"><code>custom-type-var-return-type</code></a></li>
<li><code>PYI024</code>: <a
href="https://beta.ruff.rs/docs/rules/collections-named-tuple"><code>collections-named-tuple</code></a></li>
<li><code>PYI025</code>: <a
href="https://beta.ruff.rs/docs/rules/unaliased-collections-abc-set-import"><code>unaliased-collections-abc-set-import</code></a></li>
<li><code>PYI030</code>: <a
href="https://beta.ruff.rs/docs/rules/unnecessary-literal-union"><code>unnecessary-literal-union</code></a></li>
<li><code>PYI032</code>: <a
href="https://beta.ruff.rs/docs/rules/any-eq-ne-annotation"><code>any-eq-ne-annotation</code></a></li>
<li><code>PYI034</code>: <a
href="https://beta.ruff.rs/docs/rules/non-self-return-type"><code>non-self-return-type</code></a></li>
<li><code>PYI036</code>: <a
href="https://beta.ruff.rs/docs/rules/bad-exit-annotation"><code>bad-exit-annotation</code></a></li>
<li><code>PYI041</code>: <a
href="https://beta.ruff.rs/docs/rules/redundant-numeric-union"><code>redundant-numeric-union</code></a></li>
<li><code>PYI042</code>: <a
href="https://beta.ruff.rs/docs/rules/snake-case-type-alias"><code>snake-case-type-alias</code></a></li>
<li><code>PYI043</code>: <a
href="https://beta.ruff.rs/docs/rules/t-suffixed-type-alias"><code>t-suffixed-type-alias</code></a></li>
<li><code>PYI045</code>: <a
href="https://beta.ruff.rs/docs/rules/iter-method-return-iterable"><code>iter-method-return-iterable</code></a></li>
<li><code>PYI046</code>: <a
href="https://beta.ruff.rs/docs/rules/unused-private-protocol"><code>unused-private-protocol</code></a></li>
<li><code>PYI047</code>: <a
href="https://beta.ruff.rs/docs/rules/unused-private-type-alias"><code>unused-private-type-alias</code></a></li>
<li><code>PYI049</code>: <a
href="https://beta.ruff.rs/docs/rules/unused-private-typed-dict"><code>unused-private-typed-dict</code></a></li>
<li><code>PYI050</code>: <a
href="https://beta.ruff.rs/docs/rules/no-return-argument-annotation-in-stub"><code>no-return-argument-annotation-in-stub</code></a>
(Python ≥ 3.11)</li>
<li><code>PYI051</code>: <a
href="https://beta.ruff.rs/docs/rules/redundant-literal-union"><code>redundant-literal-union</code></a></li>
<li><code>PYI056</code>: <a
href="https://beta.ruff.rs/docs/rules/unsupported-method-call-on-all"><code>unsupported-method-call-on-all</code></a></li>
</ul>
</li>
<li>[<code>flake8-pyi</code>] <code>PYI027</code> is being replaced by
<code>PYI022</code> / <code>UP035</code> by <a
href="https://github.com/LaBatata101"><code>@​LaBatata101</code></a> in
<a
href="https://redirect.github.com/astral-sh/ruff/pull/6354">astral-sh/ruff#6354</a></li>
<li>[<code>pydocstyle</code>] <code>D103</code>: Don't require
docstrings in <code>.pyi</code> files by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6239">astral-sh/ruff#6239</a></li>
<li>[<code>pydocstyle</code>] <code>D203</code>: Ignore same-line
docstrings for lines-before and lines-after rules by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6344">astral-sh/ruff#6344</a></li>
<li>[<code>pylint</code>] <code>PLE0605</code>: Allow generic tuple and
list calls in <code>__all__</code> by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6247">astral-sh/ruff#6247</a></li>
<li>[<code>pylint</code>] <code>PLR0124</code>: Add detection of
comparisons with built-in calls by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6324">astral-sh/ruff#6324</a></li>
<li>[<code>pyupgrade</code>] <code>UP032</code>: Add support for
<code>await</code> expressions in f-strings by <a
href="https://github.com/harupy"><code>@​harupy</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6304">astral-sh/ruff#6304</a></li>
<li>[<code>pyupgrade</code>] <code>UP032</code>: Add support for
implicitly concatenated strings by <a
href="https://github.com/harupy"><code>@​harupy</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6263">astral-sh/ruff#6263</a></li>
<li>[<code>pyupgrade</code>] <code>UP032</code>: Add support for
repeated format fields by <a
href="https://github.com/harupy"><code>@​harupy</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6266">astral-sh/ruff#6266</a></li>
<li>[<code>ruff</code>] <code>RUF012</code>: Permit
<code>ClassVar</code> and <code>Final</code> without subscript by <a
href="https://github.com/bluetech"><code>@​bluetech</code></a> in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6273">astral-sh/ruff#6273</a></li>
</ul>
<h3>Bug Fixes</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md">ruff's
changelog</a>.</em></p>
<blockquote>
<h2>0.0.283</h2>
<h3>The target Python version now defaults to 3.8 instead of 3.10 (<a
href="https://redirect.github.com/astral-sh/ruff/pull/6397">#6397</a>)</h3>
<p>Previously, when a target Python version was not specified, Ruff
would use a default of Python 3.10. However, it is safer to default to
an <em>older</em> Python version to avoid assuming the availability of
new features. We now default to the oldest supported Python version
which is currently Python 3.8.</p>
<p>(We still support Python 3.7 but since <a
href="https://devguide.python.org/versions/#unsupported-versions">it has
reached EOL</a> we've decided not to make it the default here.)</p>
<h2>0.0.277</h2>
<h3><code>.ipynb_checkpoints</code>, <code>.pyenv</code>,
<code>.pytest_cache</code>, and <code>.vscode</code> are now excluded by
default (<a
href="https://redirect.github.com/astral-sh/ruff/pull/5513">#5513</a>)</h3>
<p>Ruff maintains a list of default exclusions, which now consists of
the following patterns:</p>
<ul>
<li><code>.bzr</code></li>
<li><code>.direnv</code></li>
<li><code>.eggs</code></li>
<li><code>.git</code></li>
<li><code>.git-rewrite</code></li>
<li><code>.hg</code></li>
<li><code>.ipynb_checkpoints</code></li>
<li><code>.mypy_cache</code></li>
<li><code>.nox</code></li>
<li><code>.pants.d</code></li>
<li><code>.pyenv</code></li>
<li><code>.pytest_cache</code></li>
<li><code>.pytype</code></li>
<li><code>.ruff_cache</code></li>
<li><code>.svn</code></li>
<li><code>.tox</code></li>
<li><code>.venv</code></li>
<li><code>.vscode</code></li>
<li><code>__pypackages__</code></li>
<li><code>_build</code></li>
<li><code>buck-out</code></li>
<li><code>build</code></li>
<li><code>dist</code></li>
<li><code>node_modules</code></li>
<li><code>venv</code></li>
</ul>
<p>Previously, the <code>.ipynb_checkpoints</code>, <code>.pyenv</code>,
<code>.pytest_cache</code>, and <code>.vscode</code> directories were
not
excluded by default. This change brings Ruff's default exclusions in
line with other tools like
Black.</p>
<h2>0.0.276</h2>
<h3>The <code>keep-runtime-typing</code> setting has been reinstated (<a
href="https://redirect.github.com/astral-sh/ruff/pull/5470">#5470</a>)</h3>
<p>The <code>keep-runtime-typing</code> setting has been reinstated with
revised semantics. This setting was
removed in <a
href="https://redirect.github.com/astral-sh/ruff/pull/4427">#4427</a>,
as it was equivalent to ignoring</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/astral-sh/ruff/commit/fe9590f39f4d41deb1d4ed7c655cff0bcb02bdc4"><code>fe9590f</code></a>
Bump version number to 0.0.283 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6407">#6407</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/e769c74899a744eb773b80da9f3a18dbc42e072b"><code>e769c74</code></a>
Check .git in formatter progress checkouts for build (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6387">#6387</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d815a25b11d8abe0151628fd84282ed48d823750"><code>d815a25</code></a>
Update <code>StmtMatch</code> formatting snapshots (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6427">#6427</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/001aa486df8566aaf74f7f601684321f9ef2d53b"><code>001aa48</code></a>
Add formatting for <code>StmtMatch</code> (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6286">#6286</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/87984e9ac7387204c49703d9dcf50237b5a33d89"><code>87984e9</code></a>
Expand parents whenever open-parenthesis comments are present (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6389">#6389</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/6aefe71c565b402c8045ea74b09331be4f69bafb"><code>6aefe71</code></a>
Fix name of rule in example of <code>extend-per-file-ignores</code> in
options.rs (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6417">#6417</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/90ba40c23c4a179637da81f5a38f50b2f4b4951c"><code>90ba40c</code></a>
Fix zulip unstable formatting with end-of-line comments (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6386">#6386</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/2bd345358f14a21ecf52b5514d6b5dbe3e8cbca0"><code>2bd3453</code></a>
Simplify <code>parenthesized</code> formatting (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6419">#6419</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/289d1e85bfc11b1c8137cb9c88da9386d1cc6491"><code>289d1e8</code></a>
Manually parenthesize tuple expr in <code>B014</code> autofix (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6415">#6415</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/6df5ab40987cba7bb5681c2445caaf83ebcfbf7d"><code>6df5ab4</code></a>
Remove duplicate line from project structure docs (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6408">#6408</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/astral-sh/ruff/compare/v0.0.282...v0.0.283">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ruff&package-manager=pip&previous-version=0.0.282&new-version=0.0.283)](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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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-08-09 18:04:24 +00:00
Matthew Bolaños 54ee340ca2 Python: Move notebooks into language folders (#2368)
### Motivation and Context
In an effort to move all samples to their respective language folder,
I've moved all of the notebooks to the correct language folder.


### Contribution Checklist

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2023-08-09 14:29:56 +00:00
Aditya Gudimella 3ce874bea3 Python: [BugFix] ReadOnlySkillCollection is not a Generic (#2364)
All (unit) tests are passing.

### Motivation and Context

This change reduces the number of user facing changes and aligns the
type of
ReadOnlySkillCollection with the usage in SK. There is only one type of
`SkillCollection` in SK, so it doesn't make sense to make
`ReadOnlySkillCollection`
a generic. If, in the future, another SkillCollection type is added,
then we might
want to change this to a generic type.

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
2023-08-08 20:22:23 +00:00
Devis Lucato fb8fc57da8 Update pyproject.toml 2023-08-08 09:50:00 -07:00
138080abb7 Python: Add init file to connectors submodule (#2350)
### Motivation and Context
Microsoft docs autogeneration will not recognize connectors as a
submodule of semantic_kernel unless it has an __init__.py file

### Description

Adds an empty __init__.py file to semantic_kernel/connectors/ - will not
affect module imports for this package but will ensure that connectors
is correctly picked up as a semantic_kernel submodule.

### Contribution Checklist

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

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

---------

Co-authored-by: Dmytro Struk <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-08 15:43:41 +00:00
dependabot[bot] 3417609746 Python: Bump ipykernel from 6.25.0 to 6.25.1 in /python (#2344)
Bumps [ipykernel](https://github.com/ipython/ipykernel) from 6.25.0 to
6.25.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ipython/ipykernel/releases">ipykernel's
releases</a>.</em></p>
<blockquote>
<h2>v6.25.1</h2>
<h2>6.25.1</h2>
<p>(<a
href="https://github.com/ipython/ipykernel/compare/v6.25.0...18e54f31725d6645dd71a8749c9e1eb28281f804">Full
Changelog</a>)</p>
<h3>Bugs fixed</h3>
<ul>
<li>Modifying debugger to return the same breakpoints in 'debugInfo'
response as 'setBreakpoints' <a
href="https://redirect.github.com/ipython/ipykernel/pull/1140">#1140</a>
(<a
href="https://github.com/vaishnavi17"><code>@​vaishnavi17</code></a>)</li>
</ul>
<h3>Maintenance and upkeep improvements</h3>
<h3>Contributors to this release</h3>
<p>(<a
href="https://github.com/ipython/ipykernel/graphs/contributors?from=2023-07-25&amp;to=2023-08-07&amp;type=c">GitHub
contributors page for this release</a>)</p>
<p><a
href="https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Apre-commit-ci+updated%3A2023-07-25..2023-08-07&amp;type=Issues"><code>@​pre-commit-ci</code></a>
| <a
href="https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Avaishnavi17+updated%3A2023-07-25..2023-08-07&amp;type=Issues"><code>@​vaishnavi17</code></a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ipython/ipykernel/blob/main/CHANGELOG.md">ipykernel's
changelog</a>.</em></p>
<blockquote>
<h2>6.25.1</h2>
<p>(<a
href="https://github.com/ipython/ipykernel/compare/v6.25.0...18e54f31725d6645dd71a8749c9e1eb28281f804">Full
Changelog</a>)</p>
<h3>Bugs fixed</h3>
<ul>
<li>Modifying debugger to return the same breakpoints in 'debugInfo'
response as 'setBreakpoints' <a
href="https://redirect.github.com/ipython/ipykernel/pull/1140">#1140</a>
(<a
href="https://github.com/vaishnavi17"><code>@​vaishnavi17</code></a>)</li>
</ul>
<h3>Maintenance and upkeep improvements</h3>
<h3>Contributors to this release</h3>
<p>(<a
href="https://github.com/ipython/ipykernel/graphs/contributors?from=2023-07-25&amp;to=2023-08-07&amp;type=c">GitHub
contributors page for this release</a>)</p>
<p><a
href="https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Apre-commit-ci+updated%3A2023-07-25..2023-08-07&amp;type=Issues"><code>@​pre-commit-ci</code></a>
| <a
href="https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Avaishnavi17+updated%3A2023-07-25..2023-08-07&amp;type=Issues"><code>@​vaishnavi17</code></a></p>
<!-- raw HTML omitted -->
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/ipython/ipykernel/commit/6bf3fe9e44f1caf4bc371f700ac0c2e9c9c3bd84"><code>6bf3fe9</code></a>
Publish 6.25.1</li>
<li><a
href="https://github.com/ipython/ipykernel/commit/18e54f31725d6645dd71a8749c9e1eb28281f804"><code>18e54f3</code></a>
Modifying debugger to return the same breakpoints in 'debugInfo'
response as ...</li>
<li><a
href="https://github.com/ipython/ipykernel/commit/c8517461f434a72fb4e30fc03b5949aca4c5af52"><code>c851746</code></a>
[pre-commit.ci] pre-commit autoupdate (<a
href="https://redirect.github.com/ipython/ipykernel/issues/1138">#1138</a>)</li>
<li>See full diff in <a
href="https://github.com/ipython/ipykernel/compare/v6.25.0...v6.25.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ipykernel&package-manager=pip&previous-version=6.25.0&new-version=6.25.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-08-08 00:04:22 +00:00
78613496d4 Python: Update Planner Jupyter Notebook to feature latest planners (#2341)
### Motivation and Context
The Python Jupyter notebook for Planners need to be updated to include
the latest planners (Sequential and Action)

The `BasicPlanner` implementation also needed to have a separate Plan
class since we now have plan object model. These changes allow for
people to still use the BasicPlanner if they want.

---------

Co-authored-by: Alex Chao <achao@achao>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-07 23:30:08 +00:00
Devis Lucato 619534c904 Update pyproject.toml (next release version) 2023-08-07 09:20:19 -07:00
3774258d0f Python: Embeddings batch size (#2331)
### 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.
-->
Adding optional batch size parameter for when Azure OpenAI limits number
of inputs for embeddings requests. Fixes
https://github.com/microsoft/semantic-kernel/issues/2099
### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 23:54:07 +00:00
77eeff2cd6 Python: Adgudime/python/serialization/skill definition (#2329)
This is part 4 of the Serialization work for semantic kernel.

Corresponding issue:
https://github.com/microsoft/semantic-kernel/issues/131

### Motivation and Context

While there are no user facing changes, the ReadOnlySkillCollection has
been modified to remove
circular dependencies that were causing issues with serialization.

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 23:46:17 +00:00
JoowonandAbby Harrison 67dfb4c1f5 Python: add invoke_stream_async for SKFunction (#2200)
### 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.
-->
while implementing #1691, there was an idea that adding
`invoke_stream_async` on `SKFunction` is reasonable.

<img width="870" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/69464062/44278d30-66b2-41d2-8c9f-c1daea50b331">



### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
moved temporal streaming logic from `Kernel` to `SKFunction`
I didn't want to add new `DelegateTypes` like `InStringOutStreaming` for
minimal changes.

in most cases, `SKFunction` is initiated from `from_semantic_config` or
`from_native_method`.
Now, both functions will handle the 'delegate_stream_function' argument,
which will be used in `invoke_stream_async`



### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 19:06:27 +00:00
Aditya GudimellaandAbby Harrison 68dbbcfb1a Python: Serialization add pydantic integration instructions (#2288)
### Summary

This is part 1 of the Serialization work for semantic kernel.

Corresponding issue:
https://github.com/microsoft/semantic-kernel/issues/131

### Motivation and Context

Adds instructions on how to serialize your classes using Pydantic.


<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 19:04:56 +00:00
JoowonandAbby Harrison 8aa133bc8b Python: make input parameter optional (#2234)
### 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.
-->
solve #2233 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 18:00:26 +00:00
Mark KarleandAbby Harrison 2733a5574f Python: Import OpenAPI documents into the semantic kernel (#2297)
### 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 allows us to import OpenAPI documents, including ChatGPT plugins,
into the Semantic Kernel.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- The interface reads the operationIds of the openapi spec into a skill:
```python
from semantic_kernel.connectors.openapi import register_openapi_skill
skill = register_openapi_skill(kernel=kernel, skill_name="test", openapi_document="url/or/path/to/openapi.yamlorjson")
skill['operationId'].invoke_async()
```
- Parse an OpenAPI document
- For each operation in the document, create a function that will
execute the operation
- Add all those operations to a skill in the kernel
- Modified `import_skill` to accept a dictionary of functions instead of
just class so that we can import dynamically created functions
- Created unit tests

TESTING:
I've been testing this with the following ChatGPT plugins:
- [Semantic Kernel Starter's Python Flask
plugin](https://github.com/microsoft/semantic-kernel-starters/tree/main/sk-python-flask)
- [ChatGPT's example retrieval
plugin](https://github.com/openai/chatgpt-retrieval-plugin/blob/main/docs/providers/azuresearch/setup.md)
- This one was annoying to setup. I didn't get the plugin functioning,
but I was able to send the right API requests
- Also, their openapi file was invalid. The "servers" attribute is
misindented
- [Google ChatGPT
plugin](https://github.com/Sogody/google-chatgpt-plugin)
- [Chat TODO plugin](https://github.com/lencx/chat-todo-plugin)
- This openapi file is also invalid. I checked with an online validator.
I had to remove"required" from the referenced request objects'
properties:
https://github.com/lencx/chat-todo-plugin/blob/main/openapi.yaml#L85

Then I used this python file to test the examples:

```python
import asyncio
import logging

import semantic_kernel as sk
from semantic_kernel import ContextVariables, Kernel
from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion
from semantic_kernel.connectors.openapi.sk_openapi import register_openapi_skill

# Example usage
chatgpt_retrieval_plugin = {
    "openapi": # location of the plugin's openapi.yaml file,
    "payload": {
        "queries": [
            {
                "query": "string",
                "filter": {
                    "document_id": "string",
                    "source": "email",
                    "source_id": "string",
                    "author": "string",
                    "start_date": "string",
                    "end_date": "string",
                },
                "top_k": 3,
            }
        ]
    },
    "operation_id": "query_query_post",
}

sk_python_flask = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"skill_name": "FunSkill", "function_name": "Joke"},
    "payload": {"input": "dinosaurs"},
    "operation_id": "executeFunction",
}
google_chatgpt_plugin = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "query_params": {"q": "dinosaurs"},
    "operation_id": "searchGet",
}

todo_plugin_add = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"username": "markkarle"},
    "payload": {"todo": "finish this"},
    "operation_id": "addTodo",
}

todo_plugin_get = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"username": "markkarle"},
    "operation_id": "getTodos",
}

todo_plugin_delete = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"username": "markkarle"},
    "payload": {"todo_idx": 0},
    "operation_id": "deleteTodo",
}


plugin = todo_plugin_get # set this to the plugin you want to try

logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)

kernel = Kernel(log=logger)
deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()
kernel.add_text_completion_service(
    "dv", AzureTextCompletion(deployment, endpoint, api_key)
)

skill = register_openapi_skill(
    kernel=kernel, skill_name="test", openapi_document=plugin["openapi"]
)
context_variables = ContextVariables(variables=plugin)
result = asyncio.run(
    skill[plugin["operation_id"]].invoke_async(variables=context_variables)
)
print(result)
```

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 17:48:21 +00:00
Aditya GudimellaandAbby Harrison 0c49538788 Python: Serialize semantic_kernel/template_engine/blocks (#2317)
This is part 3 of the Serialization work for semantic kernel.

Corresponding issue:
https://github.com/microsoft/semantic-kernel/issues/131

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Contains one breaking change: 
`TextBlock(...)` becomes `TextBlock.from_text(...)`


### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 17:43:42 +00:00
2163e08edd Python: casting device int to str (#2242)
fixes an issue when gpu is enabled to run HF models.

### Motivation and Context

  1. Why is this change required?
      running hf models on GPU causes an issue with device string
  2. What problem does it solve?
      fixed string concatenation issue
  3. What scenario does it contribute to?
      Helps when running HF models on GPU


### Description



### Contribution Checklist

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

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

---------

Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Mark Karle <[email protected]>
2023-08-03 23:51:51 +00:00
Aditya GudimellaandAbby Harrison ca6548a441 Python: Enable core skills, retry mechanisms and template engine protocols to be used as pydantic fields (#2287)
### Summary

This is part 1 of the Serialization work for semantic kernel.

Corresponding issue:
https://github.com/microsoft/semantic-kernel/issues/131

### Motivation and Context

This PR allows core skills (all except 2), retry mechanisms and template
engine protocols to be used
as valid pydantic fields. This allows me to convert the classes that
depend on these classes to pydantic
models, and thus be able to serialize them.

No user facing code changes are expected from this PR.

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-03 17:53:01 +00:00
Mark KarleandShawn Callegari 8552943c5a Python: Fix missed assertion bug when loading from .env file (#2274)
### 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.
-->
When loading config from .env, the assertions like `assert api_key is
not None, "Azure OpenAI API key not found in .env file"` don't catch
anything. While `dotenv_values(".env")` does put None values for keys
with missing values, that's only if there's no equals sign after the
key. For example, this file:
```
OPENAI_API_KEY=""
OPENAI_ORG_ID="org_id"
AZURE_OPENAI_DEPLOYMENT_NAME=
AZURE_OPENAI_ENDPOINT
```
Would be parsed like this:
```
OrderedDict([('OPENAI_API_KEY', ''), ('OPENAI_ORG_ID', 'org_id'), ('AZURE_OPENAI_DEPLOYMENT_NAME', ''), ('AZURE_OPENAI_ENDPOINT', None)])
```

As you can see, OPENAI_API_KEY and AZURE_OPENAI_DEPLOYMENT_NAME are
loaded with empty strings, not None.
### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

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

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

---------

Co-authored-by: Shawn Callegari <[email protected]>
2023-08-03 06:09:38 +00:00
dependabot[bot] b6111bd770 Python: Bump ruff from 0.0.281 to 0.0.282 in /python (#2296)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.281 to 0.0.282.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/releases">ruff's
releases</a>.</em></p>
<blockquote>
<h2>v0.0.282</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Reset model state when exiting deferred visitors by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6208">astral-sh/ruff#6208</a></li>
<li>Skip trivia when searching for named exception by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6218">astral-sh/ruff#6218</a></li>
<li>Avoid PERF401 false positive on list access in loop by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6220">astral-sh/ruff#6220</a></li>
<li>Avoid detecting continuations at non-start-of-line by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6219">astral-sh/ruff#6219</a></li>
<li>Revert &quot;Expand scope of <code>quoted-annotation</code> rule (<a
href="https://redirect.github.com/astral-sh/ruff/issues/5766">#5766</a>)&quot;
by <a
href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a>
in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6237">astral-sh/ruff#6237</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/klistwan"><code>@​klistwan</code></a>
made their first contribution in <a
href="https://redirect.github.com/astral-sh/ruff/pull/6146">astral-sh/ruff#6146</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/astral-sh/ruff/compare/v0.0.281...v0.0.282">https://github.com/astral-sh/ruff/compare/v0.0.281...v0.0.282</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/astral-sh/ruff/commit/743118ae9ac9c56b7b276dce87291d8200286e43"><code>743118a</code></a>
Bump version to 0.0.282 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6241">#6241</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/0753017cf1b8f31c2d4bc3232a435f3f82d326f2"><code>0753017</code></a>
Revert &quot;Expand scope of <code>quoted-annotation</code> rule (<a
href="https://redirect.github.com/astral-sh/ruff/issues/5766">#5766</a>)&quot;
(<a
href="https://redirect.github.com/astral-sh/ruff/issues/6237">#6237</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/29fb655e04947c64380d085f28c482acedc46c17"><code>29fb655</code></a>
Fix <code>logger-objects</code> documentation (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6238">#6238</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/f45e8645d7c4a2ad4e934ebbbadd91ca59fd543a"><code>f45e864</code></a>
Remove unused parser modes</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/7c7231db2e31cd0cc94bb3ec7ae5147fc6fc72d7"><code>7c7231d</code></a>
Remove unsupported <code>type_comment</code> field</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/4ad5903ef65815b68eeee048d1bb0cef94d0c16d"><code>4ad5903</code></a>
Delete type-ignore node</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/c6986ac95d9e0596bd320bbd08e007c81f930c72"><code>c6986ac</code></a>
Consistent <code>CommentPlacement</code> conversion signatures (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6231">#6231</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/ecfdd8d58b8e6e95546b37b6fce599c987be198f"><code>ecfdd8d</code></a>
Add static assertions to nodes (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6228">#6228</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/07468f8be9f046cbbf11e5b24cdd1840bf6e5bcf"><code>07468f8</code></a>
format ExprJoinedStr (<a
href="https://redirect.github.com/astral-sh/ruff/issues/5932">#5932</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/ba990b676fb4fe39f4feac4960615d8b40fe5857"><code>ba990b6</code></a>
add <code>DebugText</code> for self-documenting f-strings (<a
href="https://redirect.github.com/astral-sh/ruff/issues/6167">#6167</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/astral-sh/ruff/compare/v0.0.281...v0.0.282">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ruff&package-manager=pip&previous-version=0.0.281&new-version=0.0.282)](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-08-03 05:21:32 +00:00
Devis Lucato cd98c4aeea Update pyproject.toml (next release) 2023-08-02 14:30:25 -07:00
Devis Lucato cfccde417e Update pyproject.toml 2023-08-02 14:24:47 -07:00