Commit Graph
1092 Commits
Author SHA1 Message Date
Tao Chen 2f84e5d1bf Python: Add chat completion agent code interpreter sample (#12393)
### 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.
-->
Closing #10962 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Add a sample to demonstrate how to create a chat completion agent
with code interpreter capabilities using the Azure Container Apps
session pool service.
2. Fix a bug that cause the session tool to throw because the upload API
doesn't return the file uploaded.
3. Modify unit tests accordingly.

### 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-06-06 18:13:44 +00:00
Evan Mattson 618169f974 Python: Bump Python version to 1.32.2 for a release. (#12381)
### Motivation and Context

Bump Python version to 1.32.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.32.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-06-05 08:40:22 +09:00
Evan Mattson 6b964c0328 Python: Allow custom httpx client timeout when not using custom client (#12379)
### Motivation and Context

Currently, if one is using the OpenAPI plugin within SK, and not
providing a custom httpx client, they are hit with a hard-coded 5 second
timeout. Devs need a way to be able to customize the timeout.

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

Provide a way to customize the timeout used during API calls.
- Closes #12373 
- Adds unit tests

<!-- 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-06-04 23:31:05 +00:00
Tao Chen 3baaee2ff3 Python: streaming agent response callback in agent orchestrations (#12360)
### 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.
-->
Issue: #12306 
Discussion: #12302 

Currently, we only have a **non-streaming** agent response callback for
users to interact with the agents inside an orchestration. Support for a
stream one has been requested by developers.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Add support for a streaming agent response callback to all
orchestrations.

### 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-06-04 23:06:58 +00:00
Tao Chen c822511f2c Python: Add special notes to samples that are still using AgentGroupchat (#12377)
### 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.
-->
As we move away from `AgentGroupChat` to the new orchestrations, we want
to make sure it's clear to developers getting started with SK are aware
of the changes.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
We are including a special note to all the samples that use
`AgentGroupChat` to inform developers that this feature is no longer
maintained and they should consider using `GroupChatOrchestration`
instead.

We are keeping the samples for now so that developers can still refer to
them and we don't break any external links to these samples, but we want
to make sure they are aware of the changes and can migrate to the new
orchestrations.


### 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-06-04 22:15:44 +00:00
Evan Mattson 12a3904045 Python: Bump Python version to 1.32.1 for a release (#12344)
### Motivation and Context

Bump Python version to 1.32.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.32.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-06-03 10:25:47 +09:00
Evan Mattson fb0e418a7c Python: Fix for AzureAIAgent streaming func call invocations. Other fixes/improvements for tool call content types, and logging. (#12335)
### Motivation and Context

The AzureAIAgent streaming function call invocation is broken when
handling more than one required function call from the service. There is
nested logic to handle passing the tool calls back to the service
because it requires one to pass in a handler.

In this PR, we're now controlling everything from the main loop and are
passing back the handler as the event stream for further processing.
This does require some logic to determine if we have an initial async
context manager (based on the first call to create the run stream) or if
we're now using the handler from submitting tool calls. We can now see
that when we have multiple functions involved, we are able to get the
results as we expect:

```
Sample Output:

# User: 'What is the price of the special drink and then special food item added together?'
Function Call:> MenuPlugin-get_specials with arguments: {}
Function Result:> 
        Special Soup: Clam Chowder
        Special Salad: Cobb Salad
        Special Drink: Chai Tea
        for function: MenuPlugin-get_specials
Function Call:> MenuPlugin-get_item_price with arguments: {"menu_item": "Chai Tea"}
Function Call:> MenuPlugin-get_item_price with arguments: {"menu_item": "Clam Chowder"}
Function Result:> $9.99 for function: MenuPlugin-get_item_price
Function Result:> $9.99 for function: MenuPlugin-get_item_price
Function Call:> MathPlugin-Add with arguments: {"input":9.99,"amount":9.99}
Function Result:> 19.98 for function: MathPlugin-Add
# AuthorRole.ASSISTANT: The price of the special drink, Chai Tea, is $9.99 and the price of the special food 
    item, Clam Chowder, is $9.99. Added together, the total price is $19.98.
```

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

Fix handling multiple function calls for the streaming AzureAIAgent.
- Fixes a missing `quote` from the url citation for streaming annotation
content
- Shows the correct way to retrieve Bing Grounding tool calls in the two
concept samples.
- Adds handling for tool content content for OpenAPI plugins.
- Adds logging for streaming agent invocation tool calls.
- Relaxes the handling of the `FunctionResultContent` id attribute to be
`str | None` similar to that of `FunctionCallContent`. The type hints
for `id` have always been `str | None`, but the actual type hint on the
attribute has been `str`. We don't always get a `FunctionResultContent`
id from the Azure Agent Service during streaming invocations - message
addition via the overide `__add__` method still work properly.
- Move the AzureAIAgent pkg dependencies to be installed by default,
instead of requiring the `azure` extra.
- Closes #12312
- Closes #12328
- Closes #12331
- Closes #12324

<!-- 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-06-03 01:11:56 +00:00
4871024d07 Python: Fix AttributeError in ResponsesAgentThreadActions._get_tool_calls_from_output (#12301)
## Summary
Fixes AttributeError: 'ResponseOutputMessage' object has no attribute
'call_id' in `ResponsesAgentThreadActions._get_tool_calls_from_output`

- Updated type annotation from `list[ResponseFunctionToolCall]` to
`list[ResponseOutputItem < /dev/null | ResponseOutputMessage]` to
accurately reflect actual input types
- Improved filtering to only process `ResponseFunctionToolCall` objects,
safely ignoring other types like `ResponseOutputMessage`
- Removed problematic `.delta` access and dangerous cast operations that
caused the AttributeError

## Test plan
- [x] All existing OpenAI responses agent tests pass (34/34)
- [x] Ruff formatting and linting passes
- [x] Pre-commit hooks pass

Fixes #12296

Co-authored-by: Claude <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-05-29 00:43:09 +00:00
Evan Mattson 82229cecc3 Python: Improve Python README (#12289)
### Motivation and Context

The Python README file is a bit stale, and lacking current content
related to agent framework and directly calling the AI service (not
always needing to invoke via the kernel). Additionally, there are links
to samples/notebooks that are relative and thus not resolving from pypi.

The [`ALL_SETTINGS.md`
guide](https://github.com/microsoft/semantic-kernel/blob/main/python/samples/concepts/setup/ALL_SETTINGS.md#semantic-kernel-settings)
is also missing the Agent Framework settings used. Adding those in this
PR.

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

### Description

Improve the README to be more relevant.
- Closes #12286

<!-- 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-05-28 23:34:20 +00:00
Evan Mattson 079594d297 Python: Bump Python version to 1.32.0 for a release. (#12287)
### Motivation and Context

Bump Python version to 1.32.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.32.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-05-28 09:45:05 +09:00
Tao Chen c0605cc4e7 Python: Update kernel function span (#12285)
### 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.
-->
Closing #12262

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
This PR updates tracing support for function execution across both .NET
and Python according to the latest OTel GenAI semantic conventions:
https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#execute-tool-span

### 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-05-27 23:41:44 +00:00
kanchiandEvan Mattson 7295458954 Python: Include Bing Grounding Tool call results in invoke_stream responses (#12265)
### Motivation and Context

According to the [Terms of Service for Grounding with Bing
Search](https://www.microsoft.com/en-us/bing/apis/grounding-legal#use-and-display-requirements),
the tool’s call results must be displayed in their original format.
Currently, in the `AzureAIAgent` `invoke/invoke_stream` responses,
search results are included in the `AnnotationContent`, but the search
query itself is not.
This PR updates the response of `invoke/invoke_stream` to include the
Bing Grounding Tool’s call results, so that the Bing search query can
also be displayed.

### Description

- Fixe an issue where errors occurred when handling Bing Grounding Tool
results in streaming mode
- Update `invoke/invoke_stream` responses to include the Bing Grounding
Tool call results

### 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-05-27 15:06:47 +00:00
kanchiandEvan Mattson 7a475c8e93 Python: Allow configuration of parameters for BingGroundingTool (#12264)
### Motivation and Context

This PR enables customization of parameters such as the number of search
results when using the Bing Grounding Tool with `AzureAIAgent`.

### Description

- Allow configuration of parameters (such as `count`, `set_lang`, etc.)
for `BingGroundingTool`.

### 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-05-27 15:03:25 +00:00
Evan Mattson ac5c37e442 Python: Allow hyphens in function param metadata which are sometimes present with MCP plugins (#12267)
### Motivation and Context

We recently relaxed the regex for `FUNCTION_NAME_REGEX` and
`FULLY_QUALIFIED_FUNCTION_NAME` to allow hyphens, which are sometimes
present while using MCP. However, we did not include a relaxed Regex for
`FUNCTION_PARAM_NAME_REGEX`, which was still causing errors while using
MCP within SK.

This PR relaxes the regex for `FUNCTION_PARAM_NAME_REGEX` so that there
are no errors while using MCP.

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

Relax the `FUNCTION_PARAM_NAME_REGEX` which won't throw validation
errors while using MCP.
- Fully closes #11758

<!-- 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-05-26 15:03:19 +00:00
Evan Mattson ff1997047d Python: Support Declarative Spec for OpenAIAssistantAgent & OpenAIResponsesAgent (#12247)
### Motivation and Context

This PR builds on the initial work/abstractions from #11982. The
`AzureAssistantAgent` / `OpenAIAssistantAgent` as well as the
`AzureResponsesAgent` / `OpenAIResponsesAgent` now support declarative
specs. Several examples on how to declare the spec are shown in the
respective dirs in `samples/concepts/agents`, as well as a simple
getting started example for each agent type.

To further simplify working with these two agents, the
`setup_resources()` methods for each agent type have been marked with a
deprecation tag. The new method to use is
`OpenAIAssistantAgent.create_client()` or
`OpenAIResponsesAgent.create_client()`. Further, when one needs to
access the underlying setting's, it's simple to do so with a settings
object and accessing the attribute.

In the previous PR for the AzureAIAgent, it lacked support for
templating - this is included in this current PR.

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

### Description

Bring in support for the declarative single agent spec for these agent
types.
- Add samples
- Add unit tests
- Add support for prompt templates for all current agent types
- Closes #11979

<!-- 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-05-26 05:02:59 +00:00
Eduard van Valkenburg f5017a1d64 Python: updated onnx deps (#12251)
### 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.
-->
Updated onnx dependencies, since it now supports both python 3.13 and
all platforms.

### 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-05-23 16:29:00 +00:00
Evan Mattson afb1e15724 Python: Relax Agent Invocation Methods to Allow Positional or Keyword Arguments for messages (#12248)
### Motivation and Context

This PR relaxes the API signatures of all agent invocation methods
(`get_response`, `invoke`, `invoke_stream`) by changing the `messages`
parameter from keyword-only to positional-or-keyword. This enhances
ergonomics and Pythonic usability by allowing callers to pass messages
either positionally or as a keyword argument:

```python
agent.get_response("Why is the sky blue?")
agent.get_response(messages="Why is the sky blue?")
```

With our current use of **kwargs, it is possible to explicitly pass None
for messages (like `agent.get_response(messages=None)`). However, this
does not feel idiomatic in Python. If a caller wishes to invoke the
agent on an existing thread (which already contains all relevant
context), it is more natural and Pythonic to simply write:

```python
response = await agent.get_response()
```

This change makes the API more user-friendly, and removes unnecessary
verbosity when no new messages need to be provided.

Impact
- Backward compatible for all previous usage.
- Enables concise and intuitive API calls for primary message arguments.
- Subclasses overriding the prior keyword-only signature will continue
to work at runtime, but static type-checkers may require updating their
signatures to match the new base definition.
- No runtime breaking changes are expected.

| Scenario | Breaks at runtime? | Breaks at type-check? | Notes |

|----------------------------------|----------------------|-------------------------|--------------------------------------------------|
| Subclass w/keyword-only | No | Yes | Type checker error, but runtime
OK |
| Subclass matching base | No | No | Fine |
| Calls expecting keyword-only | No | No | Fine |
| Calls expecting positional | No (now allowed) | No | Improved
ergonomics |
| Decorators relying on kw-only | No | No (unless strict sig) | Only if
decorator is brittle, rare |
| Code generation/docs | No | No | Needs updating docs, not an actual
code break |
| Reflection-based invocation | No | No | Slight difference in behavior,
but not breaking |


Documentation and usage examples will be updated to reflect the improved
invocation style.

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

Relaxes the API signatures of all agent invocation methods.

<!-- 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-05-23 13:24:04 +00:00
3e771ec540 Python: Add missing index in Bedrock FunctionCallContent instantiation (#12203)
### Motivation and Context
The current implementation of `BedrockChatCompletion` does not correctly
initialize `FunctionCallContent` instances when using the Converse
Stream API, as the index is not set. As a result, when adding two
consecutive `FunctionCallContent` instances that belong to different
function calls, the `__add__` method does not raise a
`ContentAdditionException` exception, and the parameters are incorrectly
merged.

### Description
This PR ensures proper initialization of the index in
`FunctionCallContent` instances by using the `contentBlockIndex` value
returned by the Converse Stream API in both delta and start content
block messages. This prevents parameters from different function calls
from being merged.

See:
-
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ContentBlockDeltaEvent.html
-
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ContentBlockStartEvent.html

Closes #12202

### 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: Javier Cruz <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-05-23 03:58:40 +00:00
Tao Chen 7243188e92 Python: Use BaseModel instead of KernelBaseModel in samples (#12224)
### 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.
-->
It's unnecessary to use `KernelBaseModel` in the samples.

### Description

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


### 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-05-22 04:37:21 +00:00
Evan Mattson 0eec353504 Python: Add OpenAI's sequence_number attribute to unit tests based on their latest package (#12227)
### Motivation and Context

OpenAI release a new python package (1.81.0) which has some updates to
the underlying Pydantic models for the Responses API. We need to pull in
a new change for `ResponseOutputItemDoneEvent`,
`ResponseOutputItemAddedEvent`, and `ResponseTextDeltaEvent` for
streaming invocation which now has `sequence_number` attribute.

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

Bring in a change from OpenAI's Python SDK from v1.81.0 related to SK's
OpenAIResponsesAgent.

<!-- 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-05-22 04:20:29 +00:00
Evan Mattson c084b067de Python: Support structured outputs with Azure AI inference chat completion. (#12183)
### Motivation and Context

The Azure AI inference SDK released support for structured outputs for
chat completions (for models that support it). We had not brought this
into SK. This PR adds functionality and the ability to run the
structured output samples that exist today.

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

Adds functionality to handle structured outputs for the Azure AI
Inference Chat Completion calls.
- Fixes a bug within AzureAIInferenceChatCompletion where the wrong
isinstance check type is used. This prevented adding tool calls during
streaming invocation. Also properly add the `ai_model_id` from the
connector during message construction during streaming invocation,
- Adds unit tests for AzureAIInferenceChatCompletion structured outputs
- Closes #11952

<!-- 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-05-21 09:29:03 +00:00
kanchi 318e09232b Python: Add missing fields to AzureAIAgentSettings (#12211)
### Motivation and Context

Some fields were missing from `AzureAIAgentSettings`, which caused
errors during placeholder replacement in the declarative agent.

https://github.com/microsoft/semantic-kernel/blob/6efcc847c56d742a12dec871bd715319a599533c/python/semantic_kernel/agents/azure_ai/azure_ai_agent.py#L568-L575

### Description

- Add the missing fields to `AzureAIAgentSettings`.

### 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-05-21 09:06:53 +00:00
dependabot[bot] 16ccfba25d Python: Update redis[hiredis] requirement from ~=5.0 to >=5,<7 in /python (#12179)
Updates the requirements on
[redis[hiredis]](https://github.com/redis/redis-py) to permit the latest
version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/redis/redis-py/releases">redis[hiredis]'s
releases</a>.</em></p>
<blockquote>
<h2>6.1.0</h2>
<h1>Changes</h1>
<h2>🚀 New Features</h2>
<ul>
<li>Support for transactions in <code>RedisCluster</code> client (<a
href="https://redirect.github.com/redis/redis-py/issues/3611">#3611</a>)</li>
<li>Add equality and hashability to <code>Retry</code> and backoff
classes (<a
href="https://redirect.github.com/redis/redis-py/issues/3628">#3628</a>)</li>
</ul>
<h2>🐛 Bug Fixes</h2>
<ul>
<li>Fix RedisCluster <code>ssl_check_hostname</code> not set to
connections. For SSL verification with
<code>ssl_cert_reqs=&quot;none&quot;</code>, check_hostname is set to
<code>False</code> (<a
href="https://redirect.github.com/redis/redis-py/issues/3637">#3637</a>)</li>
<li>Prevent RuntimeError while reinitializing clusters - sync and async
(<a
href="https://redirect.github.com/redis/redis-py/issues/3633">#3633</a>)</li>
<li>Add equality and hashability to <code>Retry</code> and backoff
classes (<a
href="https://redirect.github.com/redis/redis-py/issues/3628">#3628</a>)
- fixes integration with Django RQ</li>
<li>Fix <code>AttributeError</code> on <code>ClusterPipeline</code> (<a
href="https://redirect.github.com/redis/redis-py/issues/3634">#3634</a>)</li>
</ul>
<h2>🧰 Maintenance</h2>
<ul>
<li>Updating the readme and lib version to contain the changes from the
latest stable release (<a
href="https://redirect.github.com/redis/redis-py/issues/3644">#3644</a>)</li>
<li>Export <code>REDIS_MAJOR_VERSION</code> correctly in run-tests (<a
href="https://redirect.github.com/redis/redis-py/issues/3642">#3642</a>)</li>
<li>Fix matrix in <code>hiredis-py-integration.yaml</code> (<a
href="https://redirect.github.com/redis/redis-py/issues/3641">#3641</a>)</li>
<li>Test against unstable hiredis-py (<a
href="https://redirect.github.com/redis/redis-py/issues/3617">#3617</a>)</li>
<li>Adding return types for the <code>RedisModuleCommands</code> class
(<a
href="https://redirect.github.com/redis/redis-py/issues/3632">#3632</a>)</li>
<li>Updating Redis 8 test image for GH pipeline (<a
href="https://redirect.github.com/redis/redis-py/issues/3639">#3639</a>)</li>
<li>Allow newer PyJWT versions (<a
href="https://redirect.github.com/redis/redis-py/issues/3636">#3636</a>)</li>
<li>Change type hints with possible <code>None</code> args or return
types to be annotated with <code>Optional</code> - includes commands in
<code>core.py</code> and json commands (<a
href="https://redirect.github.com/redis/redis-py/issues/3610">#3610</a>)</li>
</ul>
<h2>🙏 Special Thanks</h2>
<p>A big thank you to our collaborators at Scopely for their valuable
contributions to this release! Your support and improvements help move
the project forward — we appreciate it!</p>
<h2>Contributors</h2>
<p>We'd like to thank all the contributors who worked on this release!
<a
href="https://github.com/robertosantamaria-scopely"><code>@​robertosantamaria-scopely</code></a>
<a href="https://github.com/sentrivana"><code>@​sentrivana</code></a> <a
href="https://github.com/terencehonles"><code>@​terencehonles</code></a>
<a href="https://github.com/kesha1225"><code>@​kesha1225</code></a> <a
href="https://github.com/aberres"><code>@​aberres</code></a> <a
href="https://github.com/uglide"><code>@​uglide</code></a> <a
href="https://github.com/omerfeyzioglu"><code>@​omerfeyzioglu</code></a>
<a
href="https://github.com/petyaslavova"><code>@​petyaslavova</code></a>
<a
href="https://github.com/vladvildanov"><code>@​vladvildanov</code></a>
<a
href="https://github.com/andy-stark-redis"><code>@​andy-stark-redis</code></a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/redis/redis-py/commit/3331a424c1e65e1e8b6f025bd6a2a90a672e4a63"><code>3331a42</code></a>
Adding comment for the lib version in <strong>init</strong>.py (to force
ci pipeline execu...</li>
<li><a
href="https://github.com/redis/redis-py/commit/def589d362cfd42992841fa0cfe0a1aa8fc38794"><code>def589d</code></a>
Fix Readme formatting for Installation section</li>
<li><a
href="https://github.com/redis/redis-py/commit/0d28291d24d56fc6f95aa0a36f4f3d93a6835e04"><code>0d28291</code></a>
Updating the readme and lib version to contain the changes from the
latest st...</li>
<li><a
href="https://github.com/redis/redis-py/commit/e9f22ddcba13173f1a2b3010f4e2a339a5b7fa57"><code>e9f22dd</code></a>
Fix RedisCluster ssl_check_hostname not set to connections. For SSL
verifica...</li>
<li><a
href="https://github.com/redis/redis-py/commit/91be4a0ff39556d5e270897740369d0b1cf9e044"><code>91be4a0</code></a>
Multi exec on cluster (<a
href="https://redirect.github.com/redis/redis-py/issues/3611">#3611</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/02b2ab604f796b42465c75bd74d633f34f2d7cf7"><code>02b2ab6</code></a>
Export REDIS_MAJOR_VERSION correctly in run-tests (<a
href="https://redirect.github.com/redis/redis-py/issues/3642">#3642</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/92e2ff73e6ad3c1f9b437dd4dc15edf1131f477c"><code>92e2ff7</code></a>
Fix matrix in hiredis-py-integration.yaml (<a
href="https://redirect.github.com/redis/redis-py/issues/3641">#3641</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/7130e1ad913f51abc0de1886a52cfd6338e1beee"><code>7130e1a</code></a>
Test against unstable hiredis-py (<a
href="https://redirect.github.com/redis/redis-py/issues/3617">#3617</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/4fd1100dc3823d376a46d9efb6347f4c249eee7c"><code>4fd1100</code></a>
Adding return types for the RedisModuleCommands class (<a
href="https://redirect.github.com/redis/redis-py/issues/3632">#3632</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/e13c42b8f4a98228ca4d193253cbfda87f36f467"><code>e13c42b</code></a>
Prevent RuntimeError while reinitializing clusters - sync and async (<a
href="https://redirect.github.com/redis/redis-py/issues/3633">#3633</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/redis/redis-py/compare/v5.0.0...v6.1.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-05-20 11:51:14 +00:00
dependabot[bot] 4d58a67b53 Python: Bump google-cloud-aiplatform from 1.91.0 to 1.93.0 in /python (#12178)
Bumps
[google-cloud-aiplatform](https://github.com/googleapis/python-aiplatform)
from 1.91.0 to 1.93.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/googleapis/python-aiplatform/releases">google-cloud-aiplatform's
releases</a>.</em></p>
<blockquote>
<h2>v1.93.0</h2>
<h2><a
href="https://github.com/googleapis/python-aiplatform/compare/v1.92.0...v1.93.0">1.93.0</a>
(2025-05-15)</h2>
<h3>Features</h3>
<ul>
<li>A new value <code>NVIDIA_B200 &amp; NVIDIA_H200_141GB</code> is
added to enum <code>AcceleratorType</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Add <code>MultimodalDataset.toBigframes()</code> method to convert
dataset to a Bigframes Dataframe object and inspect the dataset in the
notebook. (<a
href="https://github.com/googleapis/python-aiplatform/commit/64dfdbcbf050b8e818a1d0c8c510fbba492247f8">64dfdbc</a>)</li>
<li>Add ANN feature for RagManagedDb (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Add EncryptionSpec for RagCorpus CMEK feature (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Add support for system paths in ModuleAgent (<a
href="https://github.com/googleapis/python-aiplatform/commit/8c95d3fdaf77a6a82cd5ca076d26ad0e7ec798d9">8c95d3f</a>)</li>
<li>Allow customers to set kms_key_name for context caching create
method (<a
href="https://github.com/googleapis/python-aiplatform/commit/c551cc63cc133b2c434e19ec510b6252bed7b7f5">c551cc6</a>)</li>
<li>GenAI - Release the Model Garden SDK to GA (<a
href="https://github.com/googleapis/python-aiplatform/commit/49c3418fdde0e7aca5d08cab24cb462548a017c5">49c3418</a>)</li>
<li>New field <code>additional_properties</code> is added to message
<code>.google.cloud.aiplatform.v1.Schema</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Populate agent_framework field in the RE spec. (<a
href="https://github.com/googleapis/python-aiplatform/commit/0a127fd26d10dbb81d33cbc9e7e1e12b457b9f27">0a127fd</a>)</li>
<li>RAG - Add ANN and KNN retrieval strategies for RagManagedDb in
preview (<a
href="https://github.com/googleapis/python-aiplatform/commit/8c0bf19fdd9f60c73ff6269713f64b2a0a6c75fb">8c0bf19</a>)</li>
<li>Support async stream query in agent engines and adk template. (<a
href="https://github.com/googleapis/python-aiplatform/commit/0c4f4a6a64bdc67e33724628cac530bf6bd388f4">0c4f4a6</a>)</li>
<li>Support Python 3.13 for reasoning engine. (<a
href="https://github.com/googleapis/python-aiplatform/commit/51b13e5b0169e65cf880c2da5a1bc2672f44ca24">51b13e5</a>)</li>
<li>Update v1 sdk to support llmparser in import file functions (<a
href="https://github.com/googleapis/python-aiplatform/commit/03a7861e0f9339c472f58f991b267fcda0e95245">03a7861</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Fix the type annotation for content dictionaries in AdkApp (<a
href="https://github.com/googleapis/python-aiplatform/commit/674beaaeffa203a1f4962f7afd66f1c959fb9e12">674beaa</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>Fix links and typos (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Remove comments for a non public feature (<a
href="https://redirect.github.com/googleapis/python-aiplatform/issues/5301">#5301</a>)
(<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Update doc publisher for Gemini docs (<a
href="https://github.com/googleapis/python-aiplatform/commit/6700e3dbd85fd6a7c0bcefe9d8d13dab438d0c81">6700e3d</a>)</li>
</ul>
<h2>v1.92.0</h2>
<h2><a
href="https://github.com/googleapis/python-aiplatform/compare/v1.91.0...v1.92.0">1.92.0</a>
(2025-05-08)</h2>
<h3>⚠ BREAKING CHANGES</h3>
<ul>
<li>Removed support for session resource paths that do not include
reasoning engine</li>
</ul>
<h3>Features</h3>
<ul>
<li>[vertexai] Added a concise option to
<code>OpenModel.list_deploy_options()</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/acc301a9742601cbb2439cc270f4faa6e8783a40">acc301a</a>)</li>
<li>[vertexai] Added system labels to <code>OpenModel.deploy()</code>
(<a
href="https://github.com/googleapis/python-aiplatform/commit/acc301a9742601cbb2439cc270f4faa6e8783a40">acc301a</a>)</li>
<li>A new field <code>system_labels</code> is added to message
<code>google.cloud.aiplatform.v1beta1.DeployRequest</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
<li>Add <code>enable_custom_service_account</code> parameter (must be
set to <code>True</code> for successful Persistent Resource). The
<code>service_account</code> parameter is retained for backward
compatibility. (<a
href="https://github.com/googleapis/python-aiplatform/commit/bf79bdf643c60e72b15f414dba964e9da2eb2d7f">bf79bdf</a>)</li>
<li>Add dedicated_endpoint_enabled and dedicated_endpoint_dns property.
(<a
href="https://github.com/googleapis/python-aiplatform/commit/32ee6d9d6be8824ea482964bfd3064ac0832aef5">32ee6d9</a>)</li>
<li>Add gemini_request_read_config field to AssembleDataRequest and
AssessDataRequest in aiplatform v1beta (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
<li>Add google.genai.types.Content as an allowed message type to ADK's
stream_query method (<a
href="https://github.com/googleapis/python-aiplatform/commit/6b131d134d93e43ad3cfde5c3deb43a1a007ef32">6b131d1</a>)</li>
<li>Adding ThinkingConfig to v1 client library (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/googleapis/python-aiplatform/blob/main/CHANGELOG.md">google-cloud-aiplatform's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/googleapis/python-aiplatform/compare/v1.92.0...v1.93.0">1.93.0</a>
(2025-05-15)</h2>
<h3>Features</h3>
<ul>
<li>A new value <code>NVIDIA_B200 &amp; NVIDIA_H200_141GB</code> is
added to enum <code>AcceleratorType</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Add <code>MultimodalDataset.toBigframes()</code> method to convert
dataset to a Bigframes Dataframe object and inspect the dataset in the
notebook. (<a
href="https://github.com/googleapis/python-aiplatform/commit/64dfdbcbf050b8e818a1d0c8c510fbba492247f8">64dfdbc</a>)</li>
<li>Add ANN feature for RagManagedDb (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Add EncryptionSpec for RagCorpus CMEK feature (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Add support for system paths in ModuleAgent (<a
href="https://github.com/googleapis/python-aiplatform/commit/8c95d3fdaf77a6a82cd5ca076d26ad0e7ec798d9">8c95d3f</a>)</li>
<li>Allow customers to set kms_key_name for context caching create
method (<a
href="https://github.com/googleapis/python-aiplatform/commit/c551cc63cc133b2c434e19ec510b6252bed7b7f5">c551cc6</a>)</li>
<li>GenAI - Release the Model Garden SDK to GA (<a
href="https://github.com/googleapis/python-aiplatform/commit/49c3418fdde0e7aca5d08cab24cb462548a017c5">49c3418</a>)</li>
<li>New field <code>additional_properties</code> is added to message
<code>.google.cloud.aiplatform.v1.Schema</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Populate agent_framework field in the RE spec. (<a
href="https://github.com/googleapis/python-aiplatform/commit/0a127fd26d10dbb81d33cbc9e7e1e12b457b9f27">0a127fd</a>)</li>
<li>RAG - Add ANN and KNN retrieval strategies for RagManagedDb in
preview (<a
href="https://github.com/googleapis/python-aiplatform/commit/8c0bf19fdd9f60c73ff6269713f64b2a0a6c75fb">8c0bf19</a>)</li>
<li>Support async stream query in agent engines and adk template. (<a
href="https://github.com/googleapis/python-aiplatform/commit/0c4f4a6a64bdc67e33724628cac530bf6bd388f4">0c4f4a6</a>)</li>
<li>Support Python 3.13 for reasoning engine. (<a
href="https://github.com/googleapis/python-aiplatform/commit/51b13e5b0169e65cf880c2da5a1bc2672f44ca24">51b13e5</a>)</li>
<li>Update v1 sdk to support llmparser in import file functions (<a
href="https://github.com/googleapis/python-aiplatform/commit/03a7861e0f9339c472f58f991b267fcda0e95245">03a7861</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Fix the type annotation for content dictionaries in AdkApp (<a
href="https://github.com/googleapis/python-aiplatform/commit/674beaaeffa203a1f4962f7afd66f1c959fb9e12">674beaa</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>Fix links and typos (<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Remove comments for a non public feature (<a
href="https://redirect.github.com/googleapis/python-aiplatform/issues/5301">#5301</a>)
(<a
href="https://github.com/googleapis/python-aiplatform/commit/02236be891c90dd6ceb45e79968715e144facdaa">02236be</a>)</li>
<li>Update doc publisher for Gemini docs (<a
href="https://github.com/googleapis/python-aiplatform/commit/6700e3dbd85fd6a7c0bcefe9d8d13dab438d0c81">6700e3d</a>)</li>
</ul>
<h2><a
href="https://github.com/googleapis/python-aiplatform/compare/v1.91.0...v1.92.0">1.92.0</a>
(2025-05-08)</h2>
<h3>⚠ BREAKING CHANGES</h3>
<ul>
<li>Removed support for session resource paths that do not include
reasoning engine</li>
</ul>
<h3>Features</h3>
<ul>
<li>[vertexai] Added a concise option to
<code>OpenModel.list_deploy_options()</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/acc301a9742601cbb2439cc270f4faa6e8783a40">acc301a</a>)</li>
<li>[vertexai] Added system labels to <code>OpenModel.deploy()</code>
(<a
href="https://github.com/googleapis/python-aiplatform/commit/acc301a9742601cbb2439cc270f4faa6e8783a40">acc301a</a>)</li>
<li>A new field <code>system_labels</code> is added to message
<code>google.cloud.aiplatform.v1beta1.DeployRequest</code> (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
<li>Add <code>enable_custom_service_account</code> parameter (must be
set to <code>True</code> for successful Persistent Resource). The
<code>service_account</code> parameter is retained for backward
compatibility. (<a
href="https://github.com/googleapis/python-aiplatform/commit/bf79bdf643c60e72b15f414dba964e9da2eb2d7f">bf79bdf</a>)</li>
<li>Add dedicated_endpoint_enabled and dedicated_endpoint_dns property.
(<a
href="https://github.com/googleapis/python-aiplatform/commit/32ee6d9d6be8824ea482964bfd3064ac0832aef5">32ee6d9</a>)</li>
<li>Add gemini_request_read_config field to AssembleDataRequest and
AssessDataRequest in aiplatform v1beta (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
<li>Add google.genai.types.Content as an allowed message type to ADK's
stream_query method (<a
href="https://github.com/googleapis/python-aiplatform/commit/6b131d134d93e43ad3cfde5c3deb43a1a007ef32">6b131d1</a>)</li>
<li>Adding ThinkingConfig to v1 client library (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
<li>Adding ThinkingConfig to v1beta1 client library (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
<li>Allow customers to set encryption_spec for context caching (<a
href="https://github.com/googleapis/python-aiplatform/commit/1f98f4ef509a54978afde0d36b5f85f3d7e709e5">1f98f4e</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/9f56f82ea35ba1070a323527cf84d8698356282e"><code>9f56f82</code></a>
chore(main): release 1.93.0 (<a
href="https://redirect.github.com/googleapis/python-aiplatform/issues/5307">#5307</a>)</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/6700e3dbd85fd6a7c0bcefe9d8d13dab438d0c81"><code>6700e3d</code></a>
docs: update doc publisher for Gemini docs</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/8c0bf19fdd9f60c73ff6269713f64b2a0a6c75fb"><code>8c0bf19</code></a>
feat: RAG - Add ANN and KNN retrieval strategies for RagManagedDb in
preview</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/0a127fd26d10dbb81d33cbc9e7e1e12b457b9f27"><code>0a127fd</code></a>
feat: Populate agent_framework field in the RE spec.</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/49c3418fdde0e7aca5d08cab24cb462548a017c5"><code>49c3418</code></a>
feat: GenAI - Release the Model Garden SDK to GA</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/51b13e5b0169e65cf880c2da5a1bc2672f44ca24"><code>51b13e5</code></a>
feat: Support Python 3.13 for reasoning engine.</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/a433de2b03f68f1d8f008c714206bc18c790d555"><code>a433de2</code></a>
chore: migrate to the read config field in multimodal dataset API
requests</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/c551cc63cc133b2c434e19ec510b6252bed7b7f5"><code>c551cc6</code></a>
feat: allow customers to set kms_key_name for context caching create
method</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/64dfdbcbf050b8e818a1d0c8c510fbba492247f8"><code>64dfdbc</code></a>
feat: Add <code>MultimodalDataset.toBigframes()</code> method to convert
dataset to a Bi...</li>
<li><a
href="https://github.com/googleapis/python-aiplatform/commit/0c4f4a6a64bdc67e33724628cac530bf6bd388f4"><code>0c4f4a6</code></a>
feat: Support async stream query in agent engines and adk template.</li>
<li>Additional commits viewable in <a
href="https://github.com/googleapis/python-aiplatform/compare/v1.91.0...v1.93.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google-cloud-aiplatform&package-manager=pip&previous-version=1.91.0&new-version=1.93.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-05-20 11:39:43 +00:00
dependabot[bot] 710977600a Python: Bump onnxruntime from 1.21.0 to 1.22.0 in /python (#12022)
Bumps [onnxruntime](https://github.com/microsoft/onnxruntime) from
1.21.0 to 1.22.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/microsoft/onnxruntime/releases">onnxruntime's
releases</a>.</em></p>
<blockquote>
<h2>ONNX Runtime v1.22</h2>
<h2>Announcements</h2>
<ul>
<li>This release introduces new API's for Model Editor, Auto EP
infrastructure, and AOT Compile</li>
<li>OnnxRuntime GPU packages require CUDA 12.x , packages built for CUDA
11.x are no longer published.</li>
</ul>
<h2>GenAI &amp; Advanced Model Features</h2>
<ul>
<li><strong>Constrained Decoding:</strong> Introduced new capabilities
for constrained decoding, offering more control over generative AI model
outputs.</li>
</ul>
<h2>Execution &amp; Core Optimizations</h2>
<h3>Core</h3>
<ul>
<li><strong>Auto EP Selection Infrastructure:</strong> Added
foundational infrastructure to enable automatic selection of Execution
Providers via selection policies, aiming to simplify configuration and
optimize performance. (Pull Request <a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24430">#24430</a>)</li>
<li><strong>Compile API:</strong> Introduced new APIs to support
explicit compilation of ONNX models.
<ul>
<li>See: <a
href="https://onnxruntime.ai/docs/api/c/struct_ort_compile_api.html">OrtCompileApi
Struct Reference</a> (Assuming a similar link structure for future
documentation)</li>
<li>See: <a
href="https://onnxruntime.ai/docs/api/c/struct_ort_ep_context.html">EP
Context Design</a> (Assuming a similar link structure for future
documentation)</li>
</ul>
</li>
<li><strong>Model Editor API</strong> api's for creating or editing ONNX
models
<ul>
<li>See: <a
href="https://onnxruntime.ai/docs/api/c/struct_ort_model_editor_api.html#details">OrtModelEditorApi</a></li>
</ul>
</li>
</ul>
<h3>Execution Provider (EP) Updates</h3>
<h4>CPU EP/MLAS</h4>
<ul>
<li><strong>KleidiAI Integration:</strong> Integrated KleidiAI into ONNX
Runtime/MLAS for enhanced performance on Arm architectures.</li>
<li><strong>MatMulNBits Support:</strong> Added support for
<code>MatMulNBits</code>, enabling matrix multiplication with weights
quantized to 8 bits.</li>
<li><strong>GroupQueryAttention optimizations and
enhancements</strong></li>
</ul>
<h4>OpenVINO EP</h4>
<ul>
<li>Added support up to OpenVINO 2025.1</li>
<li>Introduced Intel compiler level optimizations for QDQ models.</li>
<li>Added support to select Intel devices based on LUID</li>
<li>Load_config feature improvement to support AUTO, HETERO and MULTI
plugin.</li>
<li>misc bugfixes/optimizations</li>
<li>For detailed updates, refer to Pull Request <a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24394">#24394</a>:
<a
href="https://redirect.github.com/microsoft/onnxruntime/pull/24394">ONNXRuntime
OpenVINO - Release 1.22</a></li>
</ul>
<h4>QNN EP</h4>
<ul>
<li><strong>SDK Update:</strong> Added support for QNN SDK 2.33.2.</li>
<li>operator updates/support to Sum, Softmax, Upsample, Expand,
ScatterND, Einsum</li>
<li>QNN EP can be built as shared or static library.</li>
<li>enable QnnGpu backend</li>
<li>For detailed updates refer to <a
href="https://github.com/microsoft/onnxruntime/pulls?q=is%3Apr+qnn+ep+is%3Aclosed+label%3Aep%3AQNN">recent
QNN tagged PR's</a></li>
</ul>
<h4>TensorRT EP</h4>
<ul>
<li><strong>TensorRT Version:</strong> Added support for TensorRT 10.9.
<ul>
<li><strong>Note for onnx-tensorrt open-source parser users:</strong>
Please check <a
href="https://onnxruntime.ai/docs/build/eps.html#note-to-ort-1210-open-sourced-parser-users">here</a>
for specific requirements (Referencing 1.21 link as a placeholder, this
should be updated for 1.22).</li>
</ul>
</li>
<li><strong>New Features:</strong>
<ul>
<li>EP option to enable TRT Preview Feature</li>
<li>Support to load TensorRT V3 plugin</li>
</ul>
</li>
<li><strong>Bug Fixes:</strong>
<ul>
<li>Resolved an issue related to multithreading scenarios.</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/f217402897f40ebba457e2421bc0a4702771968e"><code>f217402</code></a>
Cherry pick fix for NuGet DML Release package Issue (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24696">#24696</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/6c8097a07e4f47e841e290d820a39b447c5a6259"><code>6c8097a</code></a>
Qnn nuget package update for arm64x (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24690">#24690</a>)
(<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24694">#24694</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/6b0f7c9c0dd02c415b2231487d429a1e3679133d"><code>6b0f7c9</code></a>
Revert &quot;Publish debug symbols for windows (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24643">#24643</a>)
(<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24651">#24651</a>)&quot;
(<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24668">#24668</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/8fbc5d7880707bc0c9decc5001f67881ee885f43"><code>8fbc5d7</code></a>
Publish debug symbols for windows (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24643">#24643</a>)
(<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24651">#24651</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/d08403c5b7fd04f2214560d6f965c0de854f6f13"><code>d08403c</code></a>
Add support for selection policy delegate (based on PR <a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24653">#24653</a>)
(<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24638">#24638</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/93f85fb7b295dca6cde78b5f3c41015423d7e33a"><code>93f85fb</code></a>
Cherry pick <a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24629">#24629</a>
(QNN prefer npu) into rel-1.22.0 (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24630">#24630</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/ab9141ee272f9ebd73dfba22a97d0d8d5ec36454"><code>ab9141e</code></a>
Cherry pick <a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24625">#24625</a>
into rel-1.22.0 (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24626">#24626</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/d66cff1da78951912bdffc7e97d47f5a93e6171f"><code>d66cff1</code></a>
Cherry-picks into rel-1.22.0 (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24624">#24624</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/cf92d982a6f6cabfdfafb36b4e9290e099ae982d"><code>cf92d98</code></a>
Cherry-picks into rel-1.22.0 (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24611">#24611</a>)</li>
<li><a
href="https://github.com/microsoft/onnxruntime/commit/ef546e93d713c5a9d03d678fc70d8bf2651b014e"><code>ef546e9</code></a>
Cherry-picks into rel-1.22.0 (<a
href="https://redirect.github.com/microsoft/onnxruntime/issues/24580">#24580</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/microsoft/onnxruntime/compare/v1.21.0...v1.22.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=onnxruntime&package-manager=pip&previous-version=1.21.0&new-version=1.22.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-05-20 07:30:53 +00:00
Evan MattsonandTao Chen c64e51c40e Python: Update the AzureAIAgent packages, types, and APIs based on Azure SDK's new code (#12084)
### Motivation and Context

The Azure AI Agent Service is moving to GA soon. As part of that,
they've made several changes in the underlying APIs, which require the
use of new packages, updated type imports and some new underlying APIs.
This PR updates the AzureAIAgent to use the latest Azure SDK's new code.

- The client's connection string has been replaced with an endpoint.
- The `AzureAIAgentSettings`'s `model_deployment_name` was updated to
`deployment_name`.
- Tools are now imported from `from azure.ai.agents.models` instead of
`from azure.ai.projects.models`.
- Declarative spec handling for AzureAIAgent was updated based on the
new APIs.
- Unit tests were updated.

<!-- 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 the AzureAIAgent related code, samples and tests based on the
Azure SDK's latest APIs.
- Closes #12177 

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

---------

Co-authored-by: Tao Chen <[email protected]>
2025-05-19 23:43:40 +00:00
Eduard van Valkenburg 03f0aba633 Python: added WebRTC support for Azure OpenAI Realtime (#12078)
### 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.
-->
Added support for WebRTC for Azure OpenAI Realtime models.

### 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-05-19 18:24:34 +00:00
Evan Mattson b88f05287a Python: Preserve Citation Title in AnnotationContent from Azure AI Foundry Annotations (#12152)
### Motivation and Context

When invoking an Azure AI Foundry agent via AzureAIAgent, url_citation
metadata such as the document filename (title) is omitted in the
resulting AnnotationContent. Only the url field is populated; the
filename (title) is lost, and no structured metadata is retained. This
breaks traceability and rich citation in downstream responses.

This PR updates the annotation mapping to include the title from
url_citation into the resulting AnnotationContent.

This PR also updates the content types to properly show the present
information either in the `to_dict()` call or `to_str` call, as well as
handling the attributes for the `from_element` class method.

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

Citations in responses returned via AzureAIAgent now retain the full
provenance information (url, title, etc.) as delivered by the underlying
agent, matching the behavior observed with direct AIProjectClient calls.
- Closes #12133 
- Adds further unit tests to validate functionality

<!-- 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-05-19 17:29:31 +00:00
Evan Mattson 519b607960 Python: Validate for missing or unexpected params from model (#12071)
### Motivation and Context

I've experienced times where even though we're sending the required
params to the model, for example `input_text`, the model is sending back
the tool call argument as `text`. Telling the model that we received an
unexpected param and/or are missing one helps it re-send the correct one
for function calling.

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

Improve the function calling path.

<!-- 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-05-19 05:13:27 +00:00
Eduard van ValkenburgandEvan Mattson 0634c30241 Python: marked planners deprecated and removed all related items (#12058)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
In line with our dotnet, marking all planners as deprecated, and
removing tests and samples using them.

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

---------

Co-authored-by: Evan Mattson <[email protected]>
2025-05-19 02:47:36 +00:00
Tao ChenandEvan Mattson d67f568d99 Python: Multi-agent orchestration: Magentic (#12104)
### 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.
-->
PR for Magentic multi-agent orchestration.
ADR:
https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0071-multi-agent-orchestration.md
Initial PR: https://github.com/microsoft/semantic-kernel/pull/11993

### Description

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

This PR includes the following:

1. Implementations for the magentic orchestrations
2. Unit tests and samples

### 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-05-16 21:53:43 +00:00
50a88b245f Python: Multiple new classes tests to improve code coverage (#12089)
### Motivation and Context

Improve code coverage in different classes.

### Description

Add unit tests for:

- ollama_chat_completion
- azure_cosmos_db_mongodb_store
- chroma utils
- redis utils
- process_actor
- step_actor
- process_builder

### Contribution Checklist

- [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: Gaudy Blanco <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-05-16 07:25:33 +00:00
Evan Mattson fbe0ce7a6e Python: Place upper-bound on azure-ai-projects until service is ready (#12107)
### Motivation and Context

Place upper-bound on azure-ai-projects until service is ready

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

Place upper-bound on azure-ai-projects until service is ready

<!-- 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-05-16 13:29:54 +09:00
Evan Mattson d7c2489a24 Python: Add MultiAgent Orchestration to README. (#12073)
### Motivation and Context

The new multi-agent orchestration samples are missing from the getting
started with agents README. Add them in with their descriptions. Also,
remove two unused intermediate message callback lists from two samples
that are no longer used.

<!-- 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 samples to README. Clean up some samples.

<!-- 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-05-15 17:14:30 +00:00
Evan Mattson 50cf782645 Python: Remove Copilot Studio Direct link from Pyproject.toml (#12068)
### Motivation and Context

The pyproject.toml currently references Microsoft Copilot Studio
packages that are only on test PyPI, and not yet available on the Public
PyPI repo. This breaks the ability to push the public SK package to
PyPI.

We will, until public PyPI packages are available, remove the extra from
our pyproject.toml and place explicit package install instructions in
the Copilot Studio Agent README.

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

Explicit instructions on how to install the necessary packages to use
the CopilotStudioAgent while the packages are on Test PyPI.

<!-- 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-05-15 00:50:48 +00:00
Evan Mattson 547c63105f Python: Bump Python version to 1.30.0 for a release. (#12066)
### Motivation and Context

Bump Python version to 1.30.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.30.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-05-15 08:12:23 +09:00
Tao Chen ee962943d6 Python: Multi-agent orchestration: Handoff (#12046)
### 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.
-->
PR for Handoff multi-agent orchestration.
ADR:
https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0071-multi-agent-orchestration.md
Initial PR: https://github.com/microsoft/semantic-kernel/pull/11993

### Description

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

This PR includes the following:

1. Implementations for the handoff orchestrations
2. Unit tests and samples

Follow up PRs will add the following:

- Magentic One

Contribution Check

### 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-05-14 22:50:56 +00:00
Eduard van Valkenburg 6115e8d7dc Python: fixes and updates for MCP (#12039)
### 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.
-->
Removes the two surpressed calls for extra info out of a MCP server,
since they seemed to hang every now and then.
Updated the package version spec
Added one of the samples as a integration test
Added:

- load_tools flag on the constructor, default = true
- load_prompt flag on the constructor, default = true
- request_timeout param, optional, default None

### Description

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

### Contribution Checklist

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

- [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-05-14 22:12:34 +00:00
Tao Chen d826ad8d5a Python: Multi-agent orchestration: Group Chat (#12045)
### 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.
-->
PR for Group Chat multi-agent orchestration.
ADR:
https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0071-multi-agent-orchestration.md
Initial PR: https://github.com/microsoft/semantic-kernel/pull/11993

### Description

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

1. Implementations for the group chat orchestrations
2. Unit tests and samples

Follow up PRs will add the following:

- Handoff
- Magentic One


### 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-05-14 21:45:37 +00:00
Evan Mattson ea3215ebb7 Python: Support Declarative Agent Spec for ChatCompletionAgent & AzureAIAgent (#11982)
### Motivation and Context

This is the first installment of a series of PRs related to adding
single agent declarative spec support.

SK .NET has had support for single agent declarative specs for a bit
now, and Python needs the functionality as well. This PR adds the core
abstractions and functionality to be able to define agents via a
declarative yaml spec.

Declarative specs require the use of a kernel, and if in the case of
function calling, require that any plugins defined in the spec already
be present in the kernel.

For naming, there are placeholder names that are camel case. This needs
to be the case so it can match .NET.

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

Provide declarative spec support for ChatCompletionAgent and
AzureAIAgent
- Adds many samples to show the use of declarative specs to handle
various AzureAIAgent + ChatCompletionAgent tools/plugins.
- Closes #11978

<!-- 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-05-13 23:14:36 +00:00
Eduard van Valkenburg 37800fff76 Python: add explicit typing extensions dep (#12040)
### 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.
-->
Turns out there are many dependencies that install typing-extensions,
but we don't install it by default, fixed here.
Closes #12035

### 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-05-13 17:20:56 +00:00
Tao ChenandEvan Mattson 6eff772c60 Python: Multi-agent orchestration: Concurrent + Sequential (#11993)
### 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.
-->
Initial PR for multi-agent orchestration.
ADR:
https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0071-multi-agent-orchestration.md


### Description
This is the initial PR for multi-agent orchestration. This PR includes
the following:
1. Base classes
2. Implementations for the concurrent and sequential orchestrations
3. Unit tests and samples

Follow up PRs will add the following:
- Group chat
- Handoff
- Magentic One

<!-- 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: Evan Mattson <[email protected]>
2025-05-13 16:28:09 +00:00
kanchi 904c10a11c Python: Add support for MCP Streamable HTTP transport (#12001)
### Motivation and Context

Added support for the new Streamable HTTP transport introduced in the
`2025-03-26` revision of MCP, which replaces SSE.

### Description

1. Bump the `mcp` library version to `1.8`
2. Introduced a new `MCPStreamableHttpPlugin` class

### 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-05-13 08:31:32 +00:00
Evan Mattson 4724dbc8f3 Python: Fix AzureAIAgent intermediate message ordering for invoke and invoke_stream (#12005)
### Motivation and Context

This PR fixes a core issue in `AzureAIAgent` where `FunctionCallContent`
and `FunctionResultContent` messages were not being emitted in the
correct order during `invoke()` and `invoke_stream()` execution.

- `invoke_stream`: tool messages are now drained and emitted after each
streamed assistant chunk, preserving causal ordering (tool call ->
result -> assistant reply).
- `invoke`: tool messages are emitted via callback immediately after the
non-streaming response is received, ensuring they precede the final
assistant message if applicable.

### Description

Updated samples to better show how the callbacks are used to receive the
intermediate messages in the proper order.
- Added unit tests to ensure proper coverage and message ordering.
- Closes #11999

<!-- 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-05-12 22:58:06 +00:00
Evan Mattson b07454aff8 Python: Fix OpenAIAssistantAgent/OpenAIResponsesAgent intermediate message ordering for invoke and invoke_stream (#12008)
### Motivation and Context

This PR fixes a core issue in `OpenAIAssistantAgent` and
`OpenAIResponsesAgent` where `FunctionCallContent` and
`FunctionResultContent` messages were not being emitted in the correct
order during `invoke()` and `invoke_stream()` execution.

- `invoke_stream`: tool messages are now drained and emitted after each
streamed assistant chunk, preserving causal ordering (tool call ->
result -> assistant reply).
- `invoke`: tool messages are emitted via callback immediately after the
non-streaming response is received, ensuring they precede the final
assistant message if applicable.

### Description

Updated samples to better show how the callbacks are used to receive the
intermediate messages in the proper order.
- Added unit tests to ensure proper coverage and message ordering.
- Closes #12007

### 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-05-12 22:45:43 +00:00
Evan Mattson fb2fc6b30c Python: Fix ChatCompletionAgent intermediate message ordering for invoke and invoke_stream (#12000)
### Motivation and Context

When using the `on_intermediate_message` callback, we are returning
messages to the caller in an incorrect order. While using function
calling, the order is:

1. Provide user input to agent that requires a tool call
2. FunctionCallContent chunks returned via callback
3. FunctionResultContent returned via callback
4. Final output (StreamingTextContent/TextContent) from agent returned
via invoke_stream/invoke

What we are really seeing is:
1. Provide user input to agent that requires a tool call
2. Final output (StreamingTextContent/TextContent) from agent returned
via invoke_stream/invoke
3. FunctionCallContent chunks returned via callback
4. FunctionResultContent returned via callback

The callback needs a bit of adjusting -- for the streaming case it must
emit messages as part of handling the AsyncGen response_list loop.

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

Fix the ordering of the intermediate callback so messages aren't
received out of order.
- Adds unit tests to check message order
- Adjusts some samples
- Closes #11998 

<!-- 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-05-12 07:45:08 +00:00
Evan Mattson fa919883c8 Python: Fix fallback logic overriding custom ChatHistory in ChatHistoryAgentThread (#11976)
### Motivation and Context

Fixes a bug where passing a valid `ChatHistoryReducer` into
`ChatHistoryAgentThread` would be silently overridden by a base
`ChatHistory` instance due to a falsy evaluation. There is now an
explicit `is not None` check to make sure the reducer behavior is
preserved.

Python is using the ChatHistory `__len__` override as part of the
truthiness check. The initial ChatHistoryReducer(ChatHistory) has no
messages when created, so it is evaluated as False.

<!-- 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 a bug where we overwrite a passed in ChatHistoryReducer object
with a base ChatHistory.
- Adds unit tests

<!-- 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-05-12 00:55:07 +00:00
Evan Mattson 1428275f2a Python: Pin ONNX Windows pkg to last available. (#12006)
### Motivation and Context

The last ONNX package version (1.22.0) only has Linux or MacOS
available. Windows has not been published. The latest Win available
package is 1.21.0. Pinning the Windows package version to 1.21.0 so that
we don't break the CI/CD pipeline.

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

Pin Win package to 1.21.0 so that we don't block the CI pipeline.

<!-- 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-05-12 09:47:59 +09:00
dependabot[bot]andEvan Mattson a8cdbd9d96 Python: Bump torch from 2.6.0 to 2.7.0 in /python (#11788)
Bumps [torch](https://github.com/pytorch/pytorch) from 2.6.0 to 2.7.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.7.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/#tracked-regressions">Tracked
Regressions</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/134179474539648ba7dee1317959529fbd0e7f89"><code>1341794</code></a>
Gracefully handle optree less than minimum version, part 2 (<a
href="https://redirect.github.com/pytorch/pytorch/issues/151323">#151323</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/073912749d667fcfb2de1c15e1e664dc0ccd3460"><code>0739127</code></a>
Gracefully handle optree less than minimum version (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150977">#150977</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/0c236f3c722abc8e76fc16fae90946af9a895ce5"><code>0c236f3</code></a>
Update triton wheel build, setuptools pin (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150953">#150953</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/c7ff78dfc0c38847bf5daa78ab8b3669e1734246"><code>c7ff78d</code></a>
Fix inplacing with multiple, fused uses (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150892">#150892</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/894909a6139ff38d056d3ca5cfa33a020c7602c1"><code>894909a</code></a>
Revert &quot;[CUDA] Only use vec128 if CUDA version is newer than
12.8&quot; (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150855">#150855</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/ef2b1390ed5fda1f50843bf5977e5f8cf5e40493"><code>ef2b139</code></a>
[Manylinux 2.28] Correct Linux aarch64 cuda binaries wheel name (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150820">#150820</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/3f236f19032ff6424160018c024478c83b6ad6b9"><code>3f236f1</code></a>
[CUDA] Only use vec128 if CUDA version is newer than 12.8 (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150818">#150818</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/35f1e7621254da1dcc8b24797059e9d010d49196"><code>35f1e76</code></a>
Reland of &quot;[ROCm] change preferred blas lib defaults (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150249">#150249</a>)&quot;&quot;
(<a
href="https://redirect.github.com/pytorch/pytorch/issues/150707">#150707</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/a6321d62273dd281a08b1c4ec87ce3edd5b330dc"><code>a6321d6</code></a>
Revert &quot;Dont exclude constant_pad_nd in prologue fusion&quot; (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150699">#150699</a>)</li>
<li><a
href="https://github.com/pytorch/pytorch/commit/1cc51c640a717335b7bc48c11e28a1f5391b99e1"><code>1cc51c6</code></a>
[CUDA][avgpool2d] Fix backward launch bounds again for
<code>sm100</code>, <code>sm120</code> (<a
href="https://redirect.github.com/pytorch/pytorch/issues/150">#150</a>...</li>
<li>Additional commits viewable in <a
href="https://github.com/pytorch/pytorch/compare/v2.6.0...v2.7.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.6.0&new-version=2.7.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>
Co-authored-by: Evan Mattson <[email protected]>
2025-05-09 03:48:51 +00:00
dependabot[bot]andEvan Mattson 243526b624 Python: Update pyarrow requirement from <20.0,>=12.0 to >=12.0,<21.0 in /python (#11785)
Updates the requirements on [pyarrow](https://github.com/apache/arrow)
to permit the latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/apache/arrow/releases">pyarrow's
releases</a>.</em></p>
<blockquote>
<h2>Apache Arrow 20.0.0</h2>
<p>Release Notes URL: <a
href="https://arrow.apache.org/release/20.0.0.html">https://arrow.apache.org/release/20.0.0.html</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/apache/arrow/commit/3ad0370a04ccdae638755b94c3c31c8760a11193"><code>3ad0370</code></a>
MINOR: [Release] Update versions for 20.0.0</li>
<li><a
href="https://github.com/apache/arrow/commit/e4aed0d61b05ef055379b11e0899161422d7be39"><code>e4aed0d</code></a>
MINOR: [Release] Update .deb/.rpm changelogs for 20.0.0</li>
<li><a
href="https://github.com/apache/arrow/commit/02f9dfbd25c4e2d827f89b05976fcdb46209fe75"><code>02f9dfb</code></a>
MINOR: [Release] Update CHANGELOG.md for 20.0.0</li>
<li><a
href="https://github.com/apache/arrow/commit/92c3e39f3901f0343c1e6c48c25b96aafaea101c"><code>92c3e39</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/46077">GH-46077</a>:
[CI][C++] Disable -Werror on macos-13 (<a
href="https://redirect.github.com/apache/arrow/issues/46106">#46106</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/2f82cd86b43cca0554b849fb095109fbaa18ec3e"><code>2f82cd8</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/46123">GH-46123</a>:
[C++] Undefined behavior in <code>compare_internal.cc</code> and
`light_array_...</li>
<li><a
href="https://github.com/apache/arrow/commit/af15118dd065facc6e9bbeb58af13c382351600e"><code>af15118</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/46159">GH-46159</a>:
[CI][C++] Stop using possibly missing boost/process/v2.hpp on
boost...</li>
<li><a
href="https://github.com/apache/arrow/commit/7a6eefe3ec64ea8da4563488dc300ec432252d4b"><code>7a6eefe</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/46169">GH-46169</a>:
[CI][R] Update R version to 4.5 due to 4.4 not being on APT
reposit...</li>
<li><a
href="https://github.com/apache/arrow/commit/5c1eb910e2654195d4719469ee7be4ab864e2cf3"><code>5c1eb91</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/46167">GH-46167</a>:
[R][CI] Update Artifacts for R 4.5 in task.yml (<a
href="https://redirect.github.com/apache/arrow/issues/46168">#46168</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/0f41ecc3f7ef551614fb43277b97814e22683fdb"><code>0f41ecc</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/45986">GH-45986</a>:
[C++] Update bundled GoogleTest (<a
href="https://redirect.github.com/apache/arrow/issues/45996">#45996</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/1e2aa39012961e85a719857f0089fa04ab9119b3"><code>1e2aa39</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/46075">GH-46075</a>:
[Release][CI] Fix binary verification (<a
href="https://redirect.github.com/apache/arrow/issues/46076">#46076</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/apache/arrow/compare/go/v12.0.0...apache-arrow-20.0.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>
Co-authored-by: Evan Mattson <[email protected]>
2025-05-09 01:45:17 +00:00