1299 Commits
Author SHA1 Message Date
Evan Mattson e696dc7d52 Python: Add directory allowlist configuration for SessionsPythonTool file (#13467)
### Motivation and Context

When `SessionsPythonTool` is used with an AI model, providing explicit
directory boundaries for file operations gives developers fine-grained
control over which parts of the filesystem the plugin can access. This
follows the pattern established by `HttpPlugin.allowed_domains`.

- Add `allowed_upload_directories` parameter to control which local
directories can be used for file uploads
- Add `allowed_download_directories` parameter for optional restrictions
on file download destinations
- Implement path canonicalization to resolve symlinks and normalize
paths

Usage:

```python
tool = SessionsPythonTool(
    credential=credential,
    allowed_upload_directories={"/app/data/uploads", "/app/user_files"},
    allowed_download_directories={"/app/data/downloads"},  # optional
)
```


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

- `upload_file` now requires `allowed_upload_directories` to be
configured (deny-by-default)
- `download_file` optionally supports `allowed_download_directories`
(permissive-by-default, since it's not exposed as a kernel function)
- Both parameters accept `set[str]` or `list[str]` for convenience
- Paths are canonicalized using `os.path.realpath()` before validation

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

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2026-01-23 09:02:05 +00:00
Eduard van Valkenburg 72bc02551f Python: added allowed_domains to HttpPlugin (#13462)
### 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.
-->
Adds allowed_domains setup for HttpPlugin.

### 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 😄
2026-01-22 12:52:56 +09:00
Evan Mattson 1e1fb14d68 Python: Bump Python version to 1.39.2 for a release (#13459)
### Motivation and Context

Bump Python version to 1.39.2 for a release

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

Bump Python version to 1.39.2 for a release

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

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2026-01-19 12:30:52 +09:00
Eduard van Valkenburg f511c965c1 Python: inversed the filter logic for InMemory vector stores (#13457)
### Motivation and Context

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

### Description

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

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2026-01-19 12:22:19 +09:00
Evan Mattson adb71bc63b Python: Bump to v1.39.1 for a release (#13455)
### Motivation and Context

Bump to v1.39.1 for a release

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

Bump to v1.39.1 for a release

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

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2026-01-16 07:56:08 +09:00
Eduard van Valkenburg e68f09c710 Python: adding collection to all for oracle (#13412)
### 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 the OracleCollection to the all for oracle

### 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 😄
2026-01-15 14:11:08 +01:00
Eduard van Valkenburg e50ba67f00 Python: improve the filtering of in-memory vector stores (#13440)
### 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.
-->
Slight improvement to the in-memory vector store filtering.

### Description

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

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2026-01-15 14:10:47 +01:00
Dmytro Struk dc7c1c0484 Python: Updated Copilot Studio README (#13432)
### 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.
-->

Renamed dependency from Copilot Studio README.

### 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 😄
2025-12-23 00:28:28 +00:00
Noah Stapp 28e2fa6046 INTPYTHON-724 - Add DriverInfo metadata to MongoDB connector (#13379)
### Motivation and Context

This PR updates the MongoDB connector to use best practices for
DriverInfo while connecting to the database.

### Description

### Contribution Checklist

Passing MongoDB connector tests:
https://spruce.mongodb.com/task/ai_ml_pipeline_testing_test_semantic_kernel_python_rhel_test_semantic_kernel_python_local_patch_888cccaf0dc36ca794fde4fd82cb1f997e5a4211_69209c01107dec0007300089_25_11_21_17_06_20/logs?execution=0

<!-- 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 😄
2025-12-01 17:16:31 +00:00
Yashwant Bezawada 775b8fc1f1 Fix YAML agent ignoring model.options execution settings (#13365)
## Summary

Fixes #13349 

When loading agents from YAML files using
`AgentRegistry.create_from_file()` or `create_from_yaml()`, the
`model.options` field (containing settings like `response_format`,
`temperature`, etc.) were being added as regular `KernelArguments` dict
items instead of being placed in the `execution_settings` property. This
caused AI service calls to ignore these critical settings.

## Root Cause

In `_normalize_spec_fields()` method in
`python/semantic_kernel/agents/agent.py`, model options were being
passed to `KernelArguments` constructor as `**kwargs`:

```python
# OLD (buggy) CODE
arguments = KernelArguments(**model_options)
```

This made them regular dict items, but execution settings need to be in
the `execution_settings` property to be passed to AI services.

## Changes

Modified `_normalize_spec_fields()` in
`python/semantic_kernel/agents/agent.py`:
- Added import for `PromptExecutionSettings`
- Convert model.options to `PromptExecutionSettings` object before
creating `KernelArguments`
- Model options now correctly placed in `execution_settings` property
- Input defaults continue to be added as regular dict items (correct
behavior)

## Testing

- ✅ Created custom test verifying model.options are now in
execution_settings
- ✅ All 30 existing unit tests in `tests/unit/agents/test_agent.py` pass
- ✅ No breaking changes introduced
- ✅ Verified execution_settings passed programmatically still work
correctly

## Example

YAML file:
```yaml
type: chat_completion_agent
name: TestAgent
description: Test agent
instructions: You are a test agent
model:
  options:
    response_format: structured_output
    temperature: 0.7
```

**Before this fix:**
- `response_format` was in dict items (wrong location)
- AI service calls ignored it

**After this fix:**
- `response_format` is in `execution_settings.extension_data`
- AI service calls receive it properly
2025-12-01 15:38:48 +00:00
Monita e1fbafe552 Python: feat(oracle): add new Oracle connector for Semantic Kernel (#13229)
…ync support

### 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 change is required to enable Semantic Kernel users to store and
retrieve embeddings using Oracle databases. Currently, Semantic Kernel
supports vector storage for several backends, but Oracle was missing.
This connector solves that gap by providing full async support, native
VECTOR type handling, and vector index management.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
This PR introduces a new Oracle connector for Semantic Kernel with the
following features:

- Asynchronous upsert, get, delete and search operations for memory
records.

- Native Oracle VECTOR type support for storing embeddings efficiently.

- Support for HNSW and IVFFLAT vector indexes for similarity search.

- Integration with Semantic Kernel collections, enabling semantic search
and memory operations.

- Comprehensive unit tests to ensure correctness and stability.

The connector is designed to work seamlessly with existing Semantic
Kernel memory abstractions and follows the same async patterns as other
vector stores.

Integration tests have also been implemented and verified locally;
however, they are not included in this PR because the current CI
environment setup for Oracle Database support is unknown.
Once guidance is provided on Oracle DB availability in the CI pipeline,
integration tests can be enabled and added in a follow-up PR.

### 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 😄
2025-11-26 20:08:16 +00:00
Evan Mattson 9cb9aba41d Python: Bump to v1.39.0 for a release (#13392)
### Motivation and Context

Bump to v1.39.0 for a release

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

Bump to v1.39.0 for a release

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

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-11-26 11:46:52 +09:00
Tao Chen d84363f477 Python: Migrate to new Google GenAI SDK (#13371)
### 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.
-->
Closes #12970, #13352

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Migrate Google AI connector to use the new Google AI SDK.
2. This PR also marks the VertexAI connector as deprecated in favor of
the Google AI connector. With this update, if users wants to connect to
a VertexAI project instead of a Google AI endpoint, they can do so with
the Google AI connector.
3. This PR also adds the ability for users to provide a custom client to
the Google AI connector (#13352).
4. This PR also marks `AzureTextCompletion` deprecated.

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-11-24 21:53:57 +00:00
Evan Mattson 849cff0b50 Python: Bump Python version to 1.38.0 for a release. (#13354)
### Motivation and Context

Bump Python version to 1.38.0 for a release.

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

Bump Python version to 1.38.0 for a release.

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

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-11-11 19:18:05 +09:00
Nico MöllerandEvan Mattson 145ad9bfd2 Python: Upgrade Onnx Connector to use 0.9.0 (#13162)
### Motivation and Context

Fixes : #13001 

### Description

Package version 0.9.0 introduced very helpful methods like applying chat
templates automatically from the tokenizer and also support for multi
audio & image files.

This PR adds the following functionalities:

- [x] Add Inference with multiple Images
- [x] Add Inference with multiple Audios
- [x] Chat Templates for non Multimodal Models are read via onnx 

### Samples

Text Sample with ONNX:
<img width="1728" height="90" alt="image"
src="https://github.com/user-attachments/assets/b93d9fc1-4e38-4fa9-b535-cc316e0900ed"
/>

Image Sample with ONNX :
<img width="1721" height="91" alt="image"
src="https://github.com/user-attachments/assets/47761beb-b728-4936-a6b6-fd253e041689"
/>


### 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: Evan Mattson <[email protected]>
2025-11-11 08:44:52 +00:00
Tao Chen b2cceb5985 .Net: Update OTel GenAI operation names (#13334)
### 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.
-->
OTel GenAI operation names have the following updates:
1. `chat.completion` to `chat`
2. `text.completion` to `text_completion`

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
This PR updates those operation names

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-11-05 05:07:34 +00:00
Eduard van Valkenburg 1c11258a32 Python: added af_tool bridge for kernel_functions (#13227)
### 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.
-->
Adds a new method to KernelFunction that creates a Agent Framework Tool
from that function.

Does require the user to install agent-framework-core themselves.

### 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 😄
2025-10-30 15:24:16 +00:00
Evan Mattson 265130743d Python: Bump Python version to 1.37.1 for a release. (#13314)
### Motivation and Context

Bump Python version to 1.37.1 for a release.

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

Bump Python version to 1.37.1 for a release.

<!-- 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 😄
2025-10-30 15:38:50 +09:00
9962d434ab Python: Fixed sending "text" parameter to OpenAI Responses API (#13280)
## Summary

Fixed an issue where the `text` parameter was missing in requests to the
OpenAI Responses API.

## Changes Made

Modified the `ResponsesAgentThreadActions._generate_options()` method to
correctly handle the `text` parameter:

  - Added to the options dictionary **only** if `text` is not `None`.
  - Not added if it is an empty dict (the default value).
- This ensures that **only explicitly set `text` parameters** are sent
to the API.

## Fix Location

**File:**
`semantic_kernel/agents/open_ai/responses_agent_thread_actions.py`

**Before:**

```python
options = {
    "model": merged.get("model"),
    "top_p": merged.get("top_p"),
    "temperature": merged.get("temperature"),
    "truncation": truncation,
    "metadata": merged.get("metadata"),
    "max_output_tokens": max_output_tokens,
    "parallel_tool_calls": parallel_tool_calls,
}
```

**After:**

```python
options = {
    "model": merged.get("model"),
    "top_p": merged.get("top_p"),
    "temperature": merged.get("temperature"),
    "truncation": truncation,
    "metadata": merged.get("metadata"),
    "max_output_tokens": max_output_tokens,
    "parallel_tool_calls": parallel_tool_calls,
}

# Add text option if it exists
if merged.get("text") is not None:
    options["text"] = merged.get("text")
```

- Closes #13281

### 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: Copilot <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-10-30 06:20:13 +00:00
Evan Mattson 05d659d6e9 Python: Fix non-string KernelArguments being converted to strings in prompt template function calls (#13292)
### Motivation and Context

Fixes #13199 - Non-string kernel arguments are now preserved when passed
to functions in prompt templates. Adds unit 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.
-->

### 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 😄
2025-10-30 06:11:35 +00:00
1f8fea2b49 Python: Fix ai connector integration tests (#13311)
### 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.
-->
Vertex AI and Bedrock integration tests have been failing.


### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. This PR fixes the vertex ai integration tests by upgrading the Google
AI SDK version.
2. This PR fixes the Bedrock integration tests by upgrading the models.


### 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: Copilot <[email protected]>
Co-authored-by: moonbox3 <[email protected]>
2025-10-30 04:22:14 +00:00
Evan Mattson cf9a5f21f7 Python: Fix onnx pkg by pinning. Pin openai < 2.0. (#13284)
### Motivation and Context

For the latest onnxruntime 1.23.2 pkg: our GitHub Actions run is failing
because uv is not matching the macOS wheel tag.
Pinning to last-known-good until it's sorted out.

- Pin openai pkg < 2.0 until we can investigate if 2.0 brings in other
breaking changes.

### Contribution Checklist

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

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-10-24 11:23:08 +09:00
Taylor Rockey e73446e86e Python: [Python] Updated Agents SDK version to latest for CopilotStudio connector (#13144)
### 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?
- The Agents SDK has been released, and the recent release changed the
namespace from `microsoft.agents` to `microsoft_agents`, which breaks
imports.
  2. What problem does it solve?
- This updates the `pyproject.toml` and copilot studio related files to
fix the imports
  3. What scenario does it contribute to?
      - Using a Copilot Studio agent as an Agent in Semantic Kernel
  4. If it fixes an open issue, please link to the issue here.
      - N/A
-->

### Description

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

- Updated pyproject.toml to use the released packages for the Agents
SDK.
- Updated imports in the `copilot_studio_agent` related files to use the
new `microsoft_agents` namespace

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [] I didn't break anyone 😄
2025-09-23 01:01:51 +00:00
Tao Chen d455a20033 .Net & Python: Add tool definitions to agent invoke span (#13153)
### 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 current GenAI Semantic Conventions have changed since the last time
we modified the `agent_invoke` span.

Previous PRs: #12940, #12928, #12834

### Description
The following changes were made:
1. `gen_ai.agent.invocation_input` -> `gen_ai.input.messages`
2. `gen_ai.agent.invocation_output` -> `gen_ai.output.messages`
3. Add `gen_ai.tool.definitions`

.Net:
<img width="2056" height="459" alt="image"
src="https://github.com/user-attachments/assets/533b8e08-7674-4c70-bdbe-ba3600855b20"
/>

Python:
<img width="1323" height="659" alt="image"
src="https://github.com/user-attachments/assets/702171ac-dc0b-4187-933d-dad77f2719df"
/>


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

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-09-22 17:09:44 +00:00
Evan Mattson 28ea2f4df8 Python: Fix AzureAIAgent readme links (#13138)
### Motivation and Context

Current getting started with agents README links for AzureAIAgent are
broken.

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

- Fixes #13129

<!-- 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 😄
2025-09-17 04:40:38 +00:00
Evan Mattson cc71ebfafa Python: Bump Python version to 1.37.0 for a release. (#13127)
### Motivation and Context

Bump Python version to 1.37.0 for a release.

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

Bump Python version to 1.37.0 for a release.

<!-- 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 😄
2025-09-16 08:58:37 +09:00
Soumili Nandi 61d3e6ee8d Python: Introduce NvidiaChatCompletion AI Connector (#12952)
### 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?
Enables developers to use NVIDIA's chat models through Semantic Kernel
with structured output support.
  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 change adds chat completion support with structured output to the
existing NVIDIA connector, enabling developers to use NVIDIA's chat
models through Semantic Kernel while building conversational AI
applications that require structured, validated responses. The connector
will support more model types iteratively, with future PRs introducing
VLM models and additional capabilities.

### Description

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

- New Chat Completion Service:
`NvidiaChatCompletion`: Chat completion service following same structure
as other connectors
- Extends existing NVIDIA embedding connector patterns and architecture
- Custom logic for handling structured output specific to NVIDIA models
  
- Enhanced Configuration:
`NvidiaChatPromptExecutionSettings`: Chat-specific settings following
existing connector patterns
### 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 😄
2025-09-15 23:26:38 +00:00
Evan Mattson d8af1ed633 Python: Safely clone plugins (#13109)
### Motivation and Context

Currently, we attempt to deep copy plugins, no matter what the plugin
instance holds. This will cause issues when plugins contain unpickleable
items like an async generator.

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

- Closes #12819

<!-- 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 😄
2025-09-12 00:25:07 +00:00
1404a72bce Python: Fix Cosmos DB NoSQL vector search functionality (issue #13028) (#13055)
## Summary
Fixes vector search functionality in Cosmos DB NoSQL connector that was
failing with syntax errors and "One of the input values is invalid"
errors.

## Changes
- Fixed VectorDistance function call to use correct 2-parameter syntax
instead of 4 parameters
- Removed RANK keyword from ORDER BY clause to fix SQL syntax error
- Removed distance function parameter setting as it should be configured
in vector index, not query
- Added proper handling for empty where clauses

## Testing
- Verified fix resolves the syntax errors reported in issue #13028
- Vector search functionality now works correctly with existing
collections

Fixes #13028

---------

Co-authored-by: Jian Wang <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-09-11 05:21:58 +00:00
Evan Mattson 652575a97a Python: Bump Python version to 1.36.2 for a release (#13067)
### Motivation and Context

Bump Python version to 1.36.2 for a release

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

Bump Python version to 1.36.2 for a release

<!-- 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 😄
2025-09-04 11:24:45 +09:00
Evan Mattson 22ff5f844f Python: Fix responses agent kernel args bug (#13056)
### Motivation and Context

The `arguments: KernelArguments` are not getting handled properly for
the Responses Agent invoke. Use the provided `arguments` instead of
trying to get them from the kwargs.

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

- Closes #13053
- Adds unit test coverage. 

<!-- 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 😄
2025-09-04 01:27:27 +00:00
Tao Chen d7db35dc47 Python: Fix Azure AI Inference connector model_extras duplication (#13066)
### 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.
-->
Addresses #13005 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Remove the `extra_parameters` key from
`AzureAIInferenceChatPromptExecutionSettings` before calling the chat
completion API to avoid unknown parameter error.
2. Allow setting the API version on the `AzureAIInferenceXXX`
connectors.

### 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 😄
2025-09-04 01:27:19 +00:00
Evan Mattson 06d6494ae9 Python: Don't return code output via on_intermediate_msg callback (#13058)
### Motivation and Context

Current, while using an OpenAIAssistantAgent, we are returning code
output via the on_intermediate_message callback. This shouldn't be
happening right now, as all other agents return code via TextContent
with a metadata `{"code": True}` key-value pair in the dictionary.

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

- Closes #12956

<!-- 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 😄
2025-09-04 01:13:53 +00:00
dependabot[bot] c61af1a255 Python: Update pymongo requirement from <4.14,>=4.8.0 to >=4.8.0,<4.15 in /python (#12921)
Updates the requirements on
[pymongo](https://github.com/mongodb/mongo-python-driver) to permit the
latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/mongodb/mongo-python-driver/releases">pymongo's
releases</a>.</em></p>
<blockquote>
<h2>PyMongo 4.14.0</h2>
<p>Community notes: <a
href="https://www.mongodb.com/community/forums/t/pymongo-4-14-released/326906">https://www.mongodb.com/community/forums/t/pymongo-4-14-released/326906</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/mongodb/mongo-python-driver/blob/master/doc/changelog.rst">pymongo's
changelog</a>.</em></p>
<blockquote>
<h2>Changes in Version 4.14.0 (2025/08/06)</h2>
<p>.. warning:: PyMongo 4.14 drops support for MongoDB 4.0. PyMongo now
supports
MongoDB 4.2+.</p>
<p>PyMongo 4.14 brings a number of changes including:</p>
<ul>
<li>
<p>Dropped support for MongoDB 4.0.</p>
</li>
<li>
<p>Added preliminary support for Python 3.14 and 3.14 with
free-threading. We do
not yet support the following with Python 3.14:</p>
<ul>
<li>Subinterpreters (<code>concurrent.interpreters</code>)</li>
<li>Free-threading with Encryption</li>
<li>mod_wsgi</li>
</ul>
</li>
<li>
<p>Removed experimental support for free-threading support in Python
3.13.</p>
</li>
<li>
<p>Added :attr:<code>bson.codec_options.TypeRegistry.codecs</code> and
:attr:<code>bson.codec_options.TypeRegistry.fallback_encoder</code>
properties
to allow users to directly access the type codecs and fallback encoder
for a
given :class:<code>bson.codec_options.TypeRegistry</code>.</p>
</li>
<li>
<p>Added

:meth:<code>pymongo.asynchronous.mongo_client.AsyncMongoClient.append_metadata</code>
and
:meth:<code>pymongo.mongo_client.MongoClient.append_metadata</code> to
allow instantiated
MongoClients to send client metadata on-demand</p>
</li>
<li>
<p>Improved performance of selecting a server with the Primary
selector.</p>
</li>
<li>
<p>Introduces a minor breaking change. When encoding
:class:<code>bson.binary.BinaryVector</code>, a <code>ValueError</code>
will be raised if the
'padding' metadata field is &lt; 0 or &gt; 7, or non-zero for any type
other than
PACKED_BIT.</p>
</li>
<li>
<p>Changed :meth:<code>~pymongo.uri_parser.parse_uri</code>'s
<code>options</code> return value to be
type <code>dict</code> instead of
<code>_CaseInsensitiveDictionary</code>.</p>
</li>
</ul>
<h2>Changes in Version 4.13.2 (2025/06/17)</h2>
<p>Version 4.13.2 is a bug fix release.</p>
<ul>
<li>Fixed a bug where <code>AsyncMongoClient</code> would block the
event loop while creating new connections,
potentially significantly increasing latency for ongoing
operations.</li>
</ul>
<p>Issues Resolved
...............</p>
<p>See the <code>PyMongo 4.13.2 release notes in JIRA</code>_ for the
list of resolved issues
in this release.</p>
<p>.. _PyMongo 4.13.2 release notes in JIRA: <a
href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=43937">https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=43937</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/6354d6cae770d765dd536eeaace13088dc09b993"><code>6354d6c</code></a>
Prepare 4.14.0 release (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2458">#2458</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/d7074ba9eedc8db2efa9e1929d63f3258b6320bd"><code>d7074ba</code></a>
PYTHON-5454 &amp; PYTHON-5455 Add preliminary python 3.14 support (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2451">#2451</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/d11cf20452fbf6418f1612607260faf3ae18753c"><code>d11cf20</code></a>
Fix In-Use Encryption examples (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2457">#2457</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/baec1e05f7005dc8a5979028ba5aac74256e3a3e"><code>baec1e0</code></a>
Bump pyright from 1.1.392.post0 to 1.1.403 (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2455">#2455</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/003ff56cbcecaa4860e14403b342967f5ee1336f"><code>003ff56</code></a>
Bump the actions group with 2 updates (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2454">#2454</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/cbe1b9e81b62f5a63f83694336fcf466126ce830"><code>cbe1b9e</code></a>
Update coverage requirement from &lt;=7.5,&gt;=5 to &gt;=5,&lt;=7.10.2
(<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2453">#2453</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/0249a08201529346024d191c7cc098365375d5e8"><code>0249a08</code></a>
Bump mypy from 1.14.1 to 1.17.1 (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2452">#2452</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/bfaab82e2644a9d6867626cff08c1ff7d30517a3"><code>bfaab82</code></a>
[Spec Resync] 07-28-2025 (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2447">#2447</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/9f64dad6871bd13e359c56698810e93f5a1173be"><code>9f64dad</code></a>
PYTHON-5473 - Better test assertions for booleans (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2450">#2450</a>)</li>
<li><a
href="https://github.com/mongodb/mongo-python-driver/commit/9514a6727022d602cfd87bf74ebccd21023252dd"><code>9514a67</code></a>
PYTHON-5441 - Unskip gridfs download chunk tests (<a
href="https://redirect.github.com/mongodb/mongo-python-driver/issues/2449">#2449</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/mongodb/mongo-python-driver/compare/4.8.0...4.14.0">compare
view</a></li>
</ul>
</details>
<br />


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>
2025-09-04 00:35:13 +00:00
0x-fangandTao Chen f1aac84b51 Python: Add framework name into UserAgent header for bedrock integration (#12901)
### Motivation and Context

This PR adds the framework name into User-Agent header of Bedrock API
call, so it can be used to collect the usage.

### Description

Updated integration with Amazon Bedrock services to include the
framework name `semantic-kernel` into the User-Agent header field for
Bedrock API call for improved client identification. No changes to
user-facing features or workflows. Similar change had been made to other
framework such as
[langchain](https://github.com/langchain-ai/langchain-aws/pull/558)

### 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: Tao Chen <[email protected]>
2025-09-03 17:34:08 +00:00
Ajeet VermaandTao Chen ea564cf04f Python: docs(typing): add return type and docstring to store_results in utils/chat.py (#12910)
## Summary
- Added explicit return type `-> ChatHistory` to `store_results`.
- Added detailed docstring explaining parameters, return type, and
behavior.

## Why
- Improves static analysis, IDE support, and code readability.
- Makes the function self-documenting for new contributors.

## Testing
- No changes to runtime behavior.
- Existing test suite passes locally.

### 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: Tao Chen <[email protected]>
2025-09-03 17:28:27 +00:00
dependabot[bot] e110472edd Python: Update pymilvus requirement from <2.6,>=2.3 to >=2.3,<2.7 in /python (#12918)
Updates the requirements on
[pymilvus](https://github.com/milvus-io/pymilvus) to permit the latest
version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/milvus-io/pymilvus/releases">pymilvus's
releases</a>.</em></p>
<blockquote>
<h2>PyMilvus v2.6.0 Release Notes</h2>
<h2>New Features</h2>
<ol>
<li>Add APIs in MilvusClient</li>
</ol>
<ul>
<li>enhance: add describe and alter database in MilvusClient by <a
href="https://github.com/smellthemoon"><code>@​smellthemoon</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2433">milvus-io/pymilvus#2433</a></li>
<li>enhance: support milvus-client iterator by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2461">milvus-io/pymilvus#2461</a></li>
<li>enhance: Enable resource group api in milvus client by <a
href="https://github.com/weiliu1031"><code>@​weiliu1031</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2513">milvus-io/pymilvus#2513</a></li>
<li>enhance: add release_collection, drop_index, create_partition,
drop_partition, load_partition and release_partition by <a
href="https://github.com/brcarry"><code>@​brcarry</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2525">milvus-io/pymilvus#2525</a></li>
<li>enhance: enable describe_replica api in milvus client by <a
href="https://github.com/weiliu1031"><code>@​weiliu1031</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2541">milvus-io/pymilvus#2541</a></li>
<li>enhance: support recalls for milvus_client by <a
href="https://github.com/chasingegg"><code>@​chasingegg</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2552">milvus-io/pymilvus#2552</a></li>
<li>enhance: add use_database by <a
href="https://github.com/czs007"><code>@​czs007</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2491">milvus-io/pymilvus#2491</a></li>
</ul>
<ol start="2">
<li>Add AsyncMilvusClient</li>
</ol>
<ul>
<li>[FEAT] Asyncio support by <a
href="https://github.com/brcarry"><code>@​brcarry</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2411">milvus-io/pymilvus#2411</a></li>
<li>Add async DDL funcs &amp; DDL examples by <a
href="https://github.com/Shawnzheng011019"><code>@​Shawnzheng011019</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2852">milvus-io/pymilvus#2852</a></li>
</ul>
<ol start="3">
<li>Other features</li>
</ol>
<ul>
<li>enhance: support Int8Vector by <a
href="https://github.com/cydrain"><code>@​cydrain</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2611">milvus-io/pymilvus#2611</a></li>
<li>feat: support recalls field in SearchResult by <a
href="https://github.com/chasingegg"><code>@​chasingegg</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2390">milvus-io/pymilvus#2390</a></li>
<li>enhance: Support Python3.13 and upgrade grpcio range by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2684">milvus-io/pymilvus#2684</a></li>
<li>enhance: support run analyzer return detail token by <a
href="https://github.com/aoiasd"><code>@​aoiasd</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2679">milvus-io/pymilvus#2679</a></li>
<li>enhance: Add force_drop parameter to drop_role method for role
deletion by <a href="https://github.com/SimFG"><code>@​SimFG</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2705">milvus-io/pymilvus#2705</a></li>
<li>enhance: add property func for AnalyzeToken by <a
href="https://github.com/aoiasd"><code>@​aoiasd</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2704">milvus-io/pymilvus#2704</a></li>
<li>enhance: grant/revoke v2 optional db and collection params by <a
href="https://github.com/shaoting-huang"><code>@​shaoting-huang</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2386">milvus-io/pymilvus#2386</a></li>
<li>extend unlimted offset for query iterator(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2418">#2418</a>)
by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2419">milvus-io/pymilvus#2419</a></li>
<li>enhance: alterindex &amp; altercollection supports altering
properties by <a
href="https://github.com/JsDove"><code>@​JsDove</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2406">milvus-io/pymilvus#2406</a></li>
<li>enhance: alterdatabase support delete property by <a
href="https://github.com/JsDove"><code>@​JsDove</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2435">milvus-io/pymilvus#2435</a></li>
<li>enhance: support hints param by <a
href="https://github.com/chasingegg"><code>@​chasingegg</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2408">milvus-io/pymilvus#2408</a></li>
<li>enhance: create database support properties by <a
href="https://github.com/JsDove"><code>@​JsDove</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2448">milvus-io/pymilvus#2448</a></li>
<li>enhance: Add <code>db_name</code> parameter at
<code>bulk_import</code> by <a
href="https://github.com/counter2015"><code>@​counter2015</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2446">milvus-io/pymilvus#2446</a></li>
<li>enhance: add search iterator v2 by <a
href="https://github.com/PwzXxm"><code>@​PwzXxm</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2395">milvus-io/pymilvus#2395</a></li>
<li>enhance: simplify the structure of search_params by <a
href="https://github.com/smellthemoon"><code>@​smellthemoon</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2507">milvus-io/pymilvus#2507</a></li>
<li>enhance: Remove long deprecated Milvus class by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2544">milvus-io/pymilvus#2544</a></li>
<li>enhance: Use new model pkg by <a
href="https://github.com/junjiejiangjjj"><code>@​junjiejiangjjj</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2595">milvus-io/pymilvus#2595</a></li>
<li>enhance: Add schema update time verification to insert and upsert to
use cache by <a
href="https://github.com/JsDove"><code>@​JsDove</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2551">milvus-io/pymilvus#2551</a></li>
<li>enhance: describecollection output add created_timestamp by <a
href="https://github.com/JsDove"><code>@​JsDove</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2618">milvus-io/pymilvus#2618</a></li>
<li>feat: add external filter func for search iterator v2 by <a
href="https://github.com/PwzXxm"><code>@​PwzXxm</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2639">milvus-io/pymilvus#2639</a></li>
<li>enhance: support run analyzer by <a
href="https://github.com/aoiasd"><code>@​aoiasd</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2622">milvus-io/pymilvus#2622</a></li>
<li>weighted reranker to allow skip score normalization by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2708">milvus-io/pymilvus#2708</a></li>
<li>enhance: Support AddCollectionField API by <a
href="https://github.com/congqixia"><code>@​congqixia</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2722">milvus-io/pymilvus#2722</a></li>
<li>Add 1-Way and 2-Way TLS Support to Bulk Import Functions by <a
href="https://github.com/abd-770"><code>@​abd-770</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2672">milvus-io/pymilvus#2672</a></li>
<li>enhance: Use SearchResult in MilvusClient by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2735">milvus-io/pymilvus#2735</a></li>
<li>Support rerank by <a
href="https://github.com/junjiejiangjjj"><code>@​junjiejiangjjj</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2729">milvus-io/pymilvus#2729</a></li>
<li>feat: suppoprt multi analyzer params by <a
href="https://github.com/aoiasd"><code>@​aoiasd</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2747">milvus-io/pymilvus#2747</a></li>
<li>Add funciton checker by <a
href="https://github.com/junjiejiangjjj"><code>@​junjiejiangjjj</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2760">milvus-io/pymilvus#2760</a></li>
<li>enhance: Support run analyzer by collection and field by <a
href="https://github.com/aoiasd"><code>@​aoiasd</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2822">milvus-io/pymilvus#2822</a></li>
<li>feat: support load collection/partition with priority(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2835">#2835</a>)
by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2836">milvus-io/pymilvus#2836</a></li>
<li>enhance: optimize perf for large topk(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2848">#2848</a>)
by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2849">milvus-io/pymilvus#2849</a></li>
<li>enhance: Add usage guide to manage MilvusClient by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2907">milvus-io/pymilvus#2907</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/1e56ce7d3159883108fb581d820572c1ab9a4c11"><code>1e56ce7</code></a>
enhance: Update milvus-proto and readme (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2921">#2921</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/75052b1b7cada14585eed4e7d7aa68ac2f541306"><code>75052b1</code></a>
enhance: Add usage guide to manage MilvusClient (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2907">#2907</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/9f44053086002d782cf7f81576a7a0f2bcc9f5ad"><code>9f44053</code></a>
add example code for language identifier and multi analyzer (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2919">#2919</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/058836de26f84c4c9e82490e3ef76a6a122b8dff"><code>058836d</code></a>
fix: Return new pk value for upsert when autoid=true (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2914">#2914</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/bbc6777565694dc2d6479177c5d2136256d332a9"><code>bbc6777</code></a>
[cherry-pick] Compatible with the default behavior of free on the cloud
(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2913">#2913</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/45080c39c59b5dbc8a5766d8afb9c08bba8d3896"><code>45080c3</code></a>
fix: Aviod coping functions when init CollectionSchema (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2902">#2902</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/52b8461c5bee1466c4678f3bc029a9cda4422bd0"><code>52b8461</code></a>
[cherry-pick] bulk_import add stageName/dataPaths parameter (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2905">#2905</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/a8c3120622290d429dc3b12ece643248dc2f5d76"><code>a8c3120</code></a>
[cherry-pick] support stage (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2895">#2895</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/3653effa88a8af263690ca88b53dc529da3082fb"><code>3653eff</code></a>
fix: Tidy alias configs when connect fails (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2900">#2900</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/728791a7de7d6eb0a4201ba755ea0675bb6976a0"><code>728791a</code></a>
enhance: Store alias before wait for ready (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2894">#2894</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/milvus-io/pymilvus/compare/v2.3.0...v2.6.0">compare
view</a></li>
</ul>
</details>
<br />


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>
2025-09-03 17:07:53 +00:00
dependabot[bot] 2db2aa1bb9 Python: Bump torch from 2.7.1 to 2.8.0 in /python (#12919)
Bumps [torch](https://github.com/pytorch/pytorch) from 2.7.1 to 2.8.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytorch/pytorch/releases">torch's
releases</a>.</em></p>
<blockquote>
<h1>PyTorch 2.8.0 Release Notes</h1>
<ul>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#highlights">Highlights</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#backwards-incompatible-changes">Backwards
Incompatible Changes</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#deprecations">Deprecations</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#new-features">New
Features</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#improvements">Improvements</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#bug-fixes">Bug
fixes</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#performance">Performance</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#documentation">Documentation</a></li>
<li><a
href="https://github.com/pytorch/pytorch/blob/HEAD/#developers">Developers</a></li>
</ul>
<h1>Highlights</h1>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytorch/pytorch/commit/ba56102387ef21a3b04b357e5b183d48f0afefc7"><code>ba56102</code></a>
Cherrypick: Add the RunLLM widget to the website (<a
href="https://redirect.github.com/pytorch/pytorch/issues/159592">#159592</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/c525a02c89217181b5731d8043c7309a84e84066"><code>c525a02</code></a>
[dynamo, docs] cherry pick torch.compile programming model docs into 2.8
(<a
href="https://redirect.github.com/pytorch/pytorch/issues/15">#15</a>...</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/a1cb3cc05d46d198467bebbb6e8fba50a325d4e7"><code>a1cb3cc</code></a>
[Release Only] Remove nvshmem from list of preload libraries (<a
href="https://redirect.github.com/pytorch/pytorch/issues/158925">#158925</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/c76b2356bc31654de2af0c98cce1bef291f06f89"><code>c76b235</code></a>
Move out super large one off foreach_copy test (<a
href="https://redirect.github.com/pytorch/pytorch/issues/158880">#158880</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/20a0e225a01d4ebbffd44a6a59acff628359c772"><code>20a0e22</code></a>
Revert &quot;[Dynamo] Allow inlining into AO quantization modules (<a
href="https://redirect.github.com/pytorch/pytorch/issues/152934">#152934</a>)&quot;
(<a
href="https://redirect.github.com/pytorch/pytorch/issues/158">#158</a>...</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/9167ac8c75481e2beb3746aa37b7f48a213c631e"><code>9167ac8</code></a>
[MPS] Switch Cholesky decomp to column wise (<a
href="https://redirect.github.com/pytorch/pytorch/issues/158237">#158237</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/5534685c62399db8d1e51b47e2dcbc17deaab230"><code>5534685</code></a>
[MPS] Reimplement <code>tri[ul]</code> as Metal shaders (<a
href="https://redirect.github.com/pytorch/pytorch/issues/158867">#158867</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/d19e08d74b2a27e661bf57a9015014b757e8ea31"><code>d19e08d</code></a>
Cherry pick PR 158746 (<a
href="https://redirect.github.com/pytorch/pytorch/issues/158801">#158801</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/a6c044ab9aa14f0864c6a572f7c023432511c5ea"><code>a6c044a</code></a>
[cherry-pick] Unify torch.tensor and torch.ops.aten.scalar_tensor
behavior (#...</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/620ebd0646252bbb22524f5c252ec7e9ab977bee"><code>620ebd0</code></a>
[Dynamo] Use proper sources for constructing dataclass defaults (<a
href="https://redirect.github.com/pytorch/pytorch/issues/158689">#158689</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pytorch/pytorch/compare/v2.7.1...v2.8.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=torch&package-manager=pip&previous-version=2.7.1&new-version=2.8.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>
2025-09-03 17:07:16 +00:00
da8ca43064 Python: fix (openai): only propagate usage metadata for final streaming chunk without choices (#12977)
### Motivation and Context

1. Why is this change required?
- The previous condition copied usage metadata whenever chunk.usage
existed, which could incorrectly propagate usage into chunks that
already contained choices.

2. What problem does it solve?
- Prevents incorrect propagation of usage metadata that can cause empty
messages or duplicated metadata when a streaming chunk contains choices
plus usage.

3. What scenario does it contribute to?
- Streaming OpenAI chat responses where the API may send a final
usage-only chunk (no choices) to report usage stats.

4. If it fixes an open issue, please link to the issue here.
   - No linked issue.

### Description

- File modified:
-
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py

- Change summary:
- In
OpenAIChatCompletionBase._inner_get_streaming_chat_message_contents,
    replace:
      if chunk.usage is not None
    with:
      if len(chunk.choices) == 0 and chunk.usage is not None

- Design notes:
- This is a minimal, targeted fix to ensure usage metadata is only
copied when the streaming chunk contains no choices (typical for the
final usage-only chunk).
  - Behavior of other streaming logic is unchanged.
  - Recommend adding unit tests covering:
- A chunk that contains choices and usage (should not propagate usage).
- A usage-only final chunk (should propagate usage to the synthesized
choice).

### Contribution Checklist

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the SK Contribution Guidelines and formatting
script raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

Files changed:
-
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py

---------

Co-authored-by: chentiantian <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-09-03 16:35:54 +00:00
Evan Mattson 4e9ea78390 Python: Bump Python version to 1.36.1 for a release (#13049)
### Motivation and Context

Bump Python version to 1.36.1 for a release

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

Bump Python version to 1.36.1 for a release

<!-- 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 😄
2025-09-02 11:38:35 +09:00
Evan Mattson f7fdfcd9a9 Python: Add AzureAIAgent Deep Research Tool support (#13034)
### Motivation and Context

The deep research tool was introduced for the AzureAIAgent; however, we
didn't have support yet in SK. Adding support now for using the deep
research tool for both streaming and non-streaming. Samples added as
well.

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

### Description

- Add support for deep research tool.
- Add samples with notes on prerequisites to configure the sample to run
properly.
- Added support for `AZURE_AI_AGENT_DEEP_RESEARCH_MODEL` env var within
`AzureAIAgentSettings` class.
- Bumped min allowed `azure-ai-agents` package ver to 1.2.0b3.
- Closes #12978

<!-- 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 😄
2025-09-01 02:35:56 +00:00
Evan Mattson 86b10b95d2 Python: provide AzureAIAgent thread msg id during streaming (#13032)
### Motivation and Context

As part of invoking an AzureAIAgent via streaming, we weren't providing
the `thread_id` via the `AgentStreamEvent.THREAD_MESSAGE_CREATED` event.

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

Supply the caller with the `thread_msg_id` by sticking it into the
returned SCMC's `metadata` dictionary.
- Closes #12959

Sample output looks like:

```
Sample Output:

# User: 'Hello'
# AuthorRole.ASSISTANT: (thread message id: msg_HZ2h4Wzbj7GEcnVCjnyEuYWT) Hello! How can I assist you with 
    the menu today?
# User: 'What is the special soup?'
# AuthorRole.ASSISTANT: (thread message id: msg_TSjkJK6hHJojIkPvF6uUofHD) The special soup today is 
    Clam Chowder. Would you like to know more about it or anything else from the menu?
# User: 'How much does that cost?'
# AuthorRole.ASSISTANT: (thread message id: msg_liwTpBFrB9JpCM1oM9EXKiwq) The Clam Chowder costs $9.99. 
    Is there anything else you'd like to know?
# User: 'Thank you'
# AuthorRole.ASSISTANT: (thread message id: msg_K6lpR3gYIHethXq17T6gJcxi) You're welcome! 
    If you have any more questions or need assistance, feel free to ask. Enjoy your meal!
```

<!-- 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 😄
2025-08-30 10:05:55 +00:00
5e50e190c4 Python: Add reasoning support for OpenAI Responses Agents (GPT-5, o4-mini, o3) (#12881)
## Summary

Adds reasoning capabilities to Python OpenAI ResponsesAgent, bringing
parity with the C# implementation. This enables fine-grained control
over reasoning effort for O-series models (o1, o3-mini, o4-mini) and
gpt-5 that support the reasoning parameter.

Fixes #12843

## Changes

### Core Implementation
- **`openai_responses_agent.py`**: Added reasoning configuration support
  - Constructor-level reasoning effort setting
  - Per-invocation reasoning effort override capability
  - Proper parameter validation and model compatibility checks
- **`responses_agent_thread_actions.py`**: Extended thread actions to
support reasoning parameters
  - Reasoning effort propagation through thread operations
  - Metadata preservation for reasoning tokens and summaries

### Sample and Tests
- **`responses_agent_reasoning.py`**: Comprehensive demonstration sample
  - Constructor vs per-invocation reasoning configuration
  - Function calling integration with reasoning
  - Reasoning comparison scenarios (low/medium/high effort)
  - Error handling and troubleshooting guidance
- **`test_openai_responses_agent_reasoning.py`**: Full unit test
coverage
  - Parameter validation tests
  - Integration scenarios with function calling
  - Edge cases and error conditions

## Features

✅ **Constructor-Level Reasoning**: Set default reasoning effort when
creating agents
✅ **Per-Invocation Override**: Override reasoning effort per request  
✅ **Priority Hierarchy**: per-invocation > constructor > model default  
✅ **Function Calling Compatible**: Works seamlessly with existing plugin
system
✅ **Azure OpenAI & OpenAI Support**: Compatible with both service
providers
✅ **Model Validation**: Automatic compatibility checks for O-series
models nad GÜT-5
✅ **Metadata Access**: Reasoning tokens and summaries available in
response metadata

## Usage Example

```python
# Constructor-level reasoning
# Constructor-level reasoning configuration
agent = AzureResponsesAgent(
    ai_model_id="gpt-5",
    client=client,
    reasoning={"effort": "low"}  # Default reasoning for all requests
)

# Per-invocation override
response = await agent.invoke(
    "Solve this complex problem step by step",
    reasoning={"effort": "high"}  
)


# Invoke with reasoning callback to capture intermediate thoughts
response = await agent.invoke(
    "Analyze this data step by step",
    reasoning={"effort": "high", "summary": "detailed"},
    on_intermediate_message=handle_reasoning_message
)

# Streaming with reasoning
async for response in agent.invoke_stream(
    "Explain quantum computing in detail",
    reasoning={"effort": "high", "summary": "detailed"},
    on_intermediate_message=handle_reasoning_message
):
    print(response.content, end="", flush=True)

---------

Co-authored-by: Evan Mattson <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-08-28 23:25:26 +00:00
ふぁーandEvan Mattson d3318adfc2 Python: Add container_id and filename fields to AnnotationContent class (#12985)
### Motivation and Context

I confirmed that Code Interpreter can run via Azure Responses API in
Semantic Kernel, but I found two issues: an error occurs when a file is
created inside the Code Interpreter, and the response lacks parameters
required to access the created file.

### Description

#### Bug 1: ValidationError for AnnotationContent

Semantic Kernel uses the following enum for
`AnnotationContent.content_type`:

```python
@experimental
class CitationType(str, Enum):
    """Citation type."""

    URL_CITATION = "url_citation"
    FILE_PATH = "file_path"
    FILE_CITATION = "file_citation"
```

However, the Responses API returns file citations with a `type` like
this:

```json
{"container_id": "cntr_68a6c50135d88190b6fdc062051155b50847ddec73d3be1b", "end_index": 94, "file_id": "cfile_68a6c67a7fcc8190889d7e1789d485e2", "filename": "sample.txt", "start_index": 66, "type": "container_file_citation"}
```

There is no matching enum member on the Semantic Kernel side. The
`CitationType` should include `CONTAINER_FILE_CITATION`, for example:

```python
@experimental
class CitationType(str, Enum):
    """Citation type."""

    URL_CITATION = "url_citation"
    FILE_PATH = "file_path"
    FILE_CITATION = "file_citation"
    CONTAINER_FILE_CITATION = "container_file_citation"
```

#### Bug 2: Missing parameters to access generated files

The response returned by the agent shows a `file_id`, but lacks the
`container_id` and `filename` required to download the file (the
filename is needed to replace `sandbox:/mnt/data/sample.txt`):

Example call:

```python
r = await agent.get_response(cast(list, history.messages), thread=thread)
print(r.content.items)
```

Example output:

```python
[
  TextContent(inner_content=None, ai_model_id=None, metadata={}, content_type='text', text='<user_prompt>', encoding=None),
  TextContent(inner_content=None, ai_model_id=None, metadata={}, content_type='text', text='<assistant_message>\n\n[sample.txt](sandbox:/mnt/data/sample.txt)', encoding=None), 
  AnnotationContent(inner_content=None, ai_model_id=None, metadata={}, content_type='annotation', file_id='cfile_68a6c67a7fcc8190889d7e1789d485e2', quote=None, start_index=88, end_index=116, url=None, title=None, citation_type=<CitationType.CONTAINER_FILE_CITATION: 'container_file_citation'>)
]
```

To include these values in the parsed result, `AnnotationContent` in
`semantic_kernel/contents/annotation_content.py` should expose
`container_id` and `filename`, and map the incoming `type` to
`citation_type`. Example suggested structure:

```python
@experimental
class AnnotationContent(KernelContent):
    """Annotation content."""

    content_type: Literal[ContentTypes.ANNOTATION_CONTENT] = Field(ANNOTATION_CONTENT_TAG, init=False)  # type: ignore
    tag: ClassVar[str] = ANNOTATION_CONTENT_TAG
    file_id: str | None = None
    quote: str | None = None
    start_index: int | None = None
    end_index: int | None = None
    url: str | None = None
    title: str | None = None
    # added
    container_id: str | None = None
    filename: str | None = None
    citation_type: CitationType | None = Field(None, alias="type")

    model_config = ConfigDict(
        extra="ignore",
        populate_by_name=True,
    )

    def __str__(self) -> str:
        ...

    def to_element(self) -> Element:
        ...

    @classmethod
    def from_element(cls: type[_T], element: Element) -> _T:
        ...

    def to_dict(self) -> dict[str, Any]:
        ...
```

Summary: add the missing enum value `container_file_citation` and extend
`AnnotationContent` to include `container_id` and `filename` (and map
`type` to `citation_type`) so file references returned by the Azure
Responses API are fully usable.

#### Code

```python
client: AsyncAzureOpenAI = AsyncAzureOpenAI(
    base_url=urljoin(server_settings.AZURE_OPENAI_COMPLETION_ENDPOINT.rstrip("/") + "/", "openai/v1/"),
    api_key=server_settings.AZURE_OPENAI_COMPLETION_API_KEY,
    api_version="preview",
)

async def run(history: ChatHistory) -> dict[str, Any]:
    with open("sample.txt", "rb") as fp:
        f = await client.files.create(file=fp, purpose="assistants")

    agent = AzureResponsesAgent(
        ai_model_id=server_settings.AZURE_OPENAI_COMPLETION_DEPLOYMENT_NAME,
        client=client,
        name="name",
        function_choice_behavior=FunctionChoiceBehavior.Required(),
        tools=[
            CodeInterpreter(
                type="code_interpreter",
                container=CodeInterpreterContainerCodeInterpreterToolAuto(type="auto", file_ids=[f.id]),
            )
        ],
    )

    thread = ResponsesAgentThread(client, history, previous_response_id=None, enable_store=True)
    r = await agent.get_response(cast(list, history.messages), thread=thread)
    print(thread.id, r.content.items)

    annotation_content = [item for item in r.content.items if isinstance(item, AnnotationContent)]

    for ac in annotation_content:
        print(ac.file_id, ac.filename, ac.container_id)
```

### 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: Evan Mattson <[email protected]>
2025-08-28 00:01:39 +00:00
Evan Mattson 1179122a5e Python: Bump Python version to 1.36.0 for a release. (#13014)
### Motivation and Context

Bump Python version to 1.36.0 for a release.

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

Bump Python version to 1.36.0 for a release.

<!-- 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 😄
2025-08-26 22:09:17 -07:00
Dmytro Struk 18d9a8e8b2 Python: .Net: Updated encoding logic in prompt templates (#12983)
### 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.
-->

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

Today, the encoding of template arguments is performed only if argument
type is `string`. In case of custom type, anonymous type or collection -
the encoding is not performed.

This PR contains changes to throw an exception in case if encoding is
enabled but complex type is used. In case of complex type, the encoding
should be performed manually according to business logic and automatic
encoding should be explicitly disabled.

This enforces stricter, but more secure template rendering rules.

**Note**: this is a breaking change for customers who use Handlebars or
Liquid template with complex type arguments. Code changes are required
when initializing template arguments:
```diff
var arguments = new KernelArguments()
{
    { "customer", new
        {
-             firstName = userInput.FirstName,
-             lastName = userInput.LastName,
+             firstName = HttpUtility.HtmlEncode(userInput.FirstName),
+             lastName = HttpUtility.HtmlEncode(userInput.LastName),
        }
    }
};

var templateFactory = new LiquidPromptTemplateFactory();
var promptTemplateConfig = new PromptTemplateConfig()
{
    TemplateFormat = "liquid"
+   InputVariables = new()
+   {
+       // We set AllowDangerouslySetContent to 'true' because each property of this argument is encoded manually. 
+       new() { Name = "customer", AllowDangerouslySetContent = true },
+   }
};

var promptTemplate = templateFactory.Create(promptTemplateConfig);
var renderedPrompt = await promptTemplate.RenderAsync(kernel, arguments); 
```

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-08-26 22:09:00 -07:00
Dmytro Struk 2a47ba9b7d Python: Removed usage of DefaultAzureCredential (#12964)
### 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 usage of `DefaultAzureCredential` by default is unsafe and raises
security issues. Instead, users should provide their own credential
types such as `AzureCliCredential`, `ManagedIdentityCredential` and so
on. More information here:

https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.aio?view=azure-python

In this PR:
1. Removed the usage of `DefaultAzureCredential` from authentication
logic.
2. Replaced `DefaultAzureCredential` with `AzureCliCredential` in all
examples.

**Note**: this is breaking change for Azure users, who relies on
`DefaultAzureCredential`. Users will need to update the code and pass
the credential type of their choice by using `credential` parameter when
initializing one of the Azure clients.

Before:
```python
chat_completion = AzureChatCompletion()
```

After:
```python
chat_completion = AzureChatCompletion(credential=AzureCliCredential())
```

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-08-25 18:29:13 +00:00
Evan Mattson 96bad5ceac Python: Update MCP streamable sample (#12950)
### Motivation and Context

The MCPStreamableHttpPlugin concept sample pointing to GitHub isn't
working. Updating it to use the Microsoft Learn site MCP server instead.

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

<!-- 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 😄
2025-08-14 15:13:10 +00:00
45fe60545c Python: Fix issue with orphaned tool/tool_calls (#12923)
### Motivation and Context

Tool/tool_calls are getting orphaned.

Issue : https://github.com/microsoft/semantic-kernel/issues/12708

How to reproduce :

```python
from semantic_kernel.contents import (
    AuthorRole,
    ChatMessageContent,
    FunctionCallContent,
    FunctionResultContent,
    ChatHistoryTruncationReducer,
)

messages = [
    ChatMessageContent(role=AuthorRole.SYSTEM, content="sys"),
    ChatMessageContent(role=AuthorRole.USER, content="user A"),
    ChatMessageContent(
        role=AuthorRole.ASSISTANT,
        items=[
            FunctionCallContent(
                id="123", function_name="search", plugin_name="plugin", arguments={"q": "x"}
            )
        ],
    ),
    ChatMessageContent(
        role=AuthorRole.TOOL,
        items=[
            FunctionResultContent(
                id="123", function_name="search", plugin_name="plugin", result="RESULT"
            )
        ],
    ),
    ChatMessageContent(role=AuthorRole.USER, content="user B"),
    ChatMessageContent(role=AuthorRole.ASSISTANT, content="done"),
]

reducer = ChatHistoryTruncationReducer(target_count=3, threshold_count=0)
reducer.messages = messages

print("Before reduce:", [m.role for m in reducer.messages])
await reducer.reduce()
print("After reduce:", [m.role for m in reducer.messages])

# After reduce: [<AuthorRole.TOOL: 'tool'>, <AuthorRole.USER: 'user'>, <AuthorRole.ASSISTANT: 'assistant'>]
```

### Description

Move backward as long as we are in a tool/tool_call island when reducing
the messages.

---------

Co-authored-by: Allaoua Benchikh <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-08-14 00:23:04 +00:00
Evan Mattson 09fb007bb1 Python: Bump Python version to 1.35.3 for a release (#12945)
### Motivation and Context

Bump Python version to 1.35.3 for a release

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

Bump Python version to 1.35.3 for a release

<!-- 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 😄
2025-08-14 09:17:46 +09:00