Commit Graph
858 Commits
Author SHA1 Message Date
Evan Mattson 1a84cb64b2 Python: prompt template config and kernel args support for agents (#10298)
### Motivation and Context

To bring the SK Python framework closer to .Net parity, we need to
support the ability to specify a prompt template config and kernel
arguments for ChatCompletion Agents as well as for Assistant Agents.

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

This PR adds support for:
- being able to specify a prompt template config for SK agents.
- allows kernel arguments to be passed to the agent as well as during
invoke - invoke args, similar to other kwargs, take precedence over
agent level config.
- adds test coverage
- creates agent templating samples for both ChatCompletionAgents and
OpenAI/AzureAssistantAgents
- closes #8022 
- closes #8699

<!-- 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-01-28 04:41:16 +00:00
Evan Mattson 5098ba39a8 Python: Improve handling for kernel plugin from file. (#10286)
### Motivation and Context

This PR addresses an issue in the `KernelPlugin.from_directory()` method
where classes without any `@kernel_function` decorated methods are still
being initialized during plugin loading.

The fix makes sure that only classes with at least one
`@kernel_function` decorated method are instantiated and included as
plugins. Classes without `@kernel_function` methods are now skipped
entirely.

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

This PR:
- Updates the `from_python_file` to inspect each class for
`@kernel_function` decorated methods before instantiation.
- Updates the `add_plugin` method `plugin_name` to make sure it is
indeed a string, per the type hint.
   - Adds a unit test to exercise the new behavior
- Closes #10280

<!-- 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-01-24 18:00:28 +00:00
Evan Mattson 4d29656780 Python: Introduce the chat history reducer (#10190)
### Motivation and Context

The SK Python framework has been missing the ability to configure a chat
history reducer of type `ChatHistoryTruncationReducer` and
`ChatHistorySummarizationReducer` which have existed in the .Net SK
Agent framework for some time.

The goal of this PR is to introduce the chat history reducers and allow
them for use for not only the agent framework, but also anything else
that uses a chat history (chat completion, for example). The
ChatHistoryReducer extends the ChatHistory class, and so it's simple to
include a reducer and logic to reduce messages as one manages the chat
history either in an agent framework setting or in a chat completion
setting.

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

This PR:
- Introduces the chat history reducer functionality in Python -- both
the `ChatHistoryTruncationReducer` and
`ChatHistorySummarizationReducer`.
- Add unit tests for code coverage.
- Adds a sample `Chat Completion History Reducer` to show how to
configure both reducers and what each parameter does.
- Add chat completion samples showing how to manage a chat history
reducer, including how to specify that function call content and
function result content should be part of the summarization payload.
- Updates the Agent SelectionStrategy, KernelFunctionSelectionStrategy
and KernelFunctionTermination strategy to use the reducer.
- Additionally updates the classes above to use a new `select_agent`
abstract method so that one can define an initial agent to run in a
particular scenario.
- Removes the deprecated `FunctionCallBehavior` class, and removes some
nasty circular dependencies that we had lurking in the code base for
some time. This `FunctionCallBehavior` has been marked with a
deprecation warning for 6+ months now. All samples and docs have moved
over to use `FunctionChoiceBehavior` - developers using
`FunctionCallBehavior` should have had enough time to switch.
- Closes #7969
- Closes #10102

<!-- 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-01-23 22:30:54 +00:00
Eduard van Valkenburg e44f70d9d6 Python: bug fixes from graphrag insights (#10270)
### 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.
-->
Based on insights from the graphrag team, several bug fixes related to
data and model validators.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
For all cases of model_validator in before mode, there is no guarantee
that the data passed is a dict,
especially when a model is used as a field in another model, then a
string is passed to the before validator.
So in those cases we check before doing logic, otherwise just pass it on
and let Pydantic handle the invalid data.

Some small logic fixes in the vector store model decorator:
- updated docstring with the right exceptions
- additional checks on attributes
- additional checks on VectorFields with tests

### 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-01-23 20:22:29 +00:00
Tao ChenandEvan Mattson 6ecfdcfda9 Python: Add agent invocation spans (#10255)
### 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.
-->
Address feature request:
https://github.com/microsoft/semantic-kernel/issues/10174

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
This pull request introduces a new decorator for tracing agent
invocations and applies it to various methods in the
`ChatCompletionAgent` and `OpenAIAssistantAgent` classes. Additionally,
it includes new unit tests to ensure the decorator is correctly applied
and functions as expected.

### Key Changes:

**Decorator Implementation:**
* Added a new `trace_agent_invocation` decorator in
`python/semantic_kernel/utils/telemetry/agent_diagnostics/decorators.py`
to trace agent invocations using OpenTelemetry.

**Decorator Application:**
* Applied the `trace_agent_invocation` decorator to the `invoke` and
`invoke_stream` methods in `ChatCompletionAgent`
(`python/semantic_kernel/agents/chat_completion/chat_completion_agent.py`).
[[1]](diffhunk://#diff-0f0a27c107368504c4347c88528b7b4234dcead1919005bcae13f5d16d6cf26dR19)
[[2]](diffhunk://#diff-0f0a27c107368504c4347c88528b7b4234dcead1919005bcae13f5d16d6cf26dR80)
[[3]](diffhunk://#diff-0f0a27c107368504c4347c88528b7b4234dcead1919005bcae13f5d16d6cf26dR134)
* Applied the `trace_agent_invocation` decorator to the `invoke` and
`invoke_stream` methods in `OpenAIAssistantAgent`
(`python/semantic_kernel/agents/open_ai/open_ai_assistant_base.py`).
[[1]](diffhunk://#diff-70e75c57136d3a90d045af4b8d59fb8e8101251d7c5126458bb5d9e6c36556a4R46)
[[2]](diffhunk://#diff-70e75c57136d3a90d045af4b8d59fb8e8101251d7c5126458bb5d9e6c36556a4R608)
[[3]](diffhunk://#diff-70e75c57136d3a90d045af4b8d59fb8e8101251d7c5126458bb5d9e6c36556a4R861)

### 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-01-22 16:26:18 +09:00
Evan Mattson b1216a0d9c Python: Bump Python version to 1.19.0 for a release. (#10254)
### Motivation and Context

Bump Python version to 1.19.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.19.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-01-22 02:51:51 +00:00
Evan Mattson 3a7f2a3b73 Python: Grab function_name from kwargs if present in ProcessStepEdgeBuilder (#10245)
### Motivation and Context

In the ProcessStepEdgeBuilder, we allow one to pass in a target of type
`"ProcessFunctionTargetBuilder | ProcessStepBuilder"`. If the target
`isinstance(target, ProcessStepBuilder)`, we construct the
`ProcessFunctionTargetBuilder`. We weren't grabbing the `function_name`
from the kwargs if it was presented, resulting in an exception that the
function_name needs to be provided because multiple kernel functions
exist.

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

This PR:
- correctly passes in the `function_name` kwargs, if present.
- Adds a unit test to exercise 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-01-21 22:50:46 +00:00
Evan Mattson 6ceba22758 Python: improve Makefile uv installation logic (#10246)
### Motivation and Context

Today, If a user runs `make install`, and the uv installation is not
found, the current flow is to return `exit 1` to force the user to
restart their shell.

These changes update the Makefile to better handle the case where uv is
not installed. The Makefile now uses a “second make invocation” approach
with a CONTINUE variable to avoid re-installing uv in the newly spawned
shell. If `uv` isn’t found, it installs `uv`, then executes a new shell
which immediately calls `make install CONTINUE=1`, allowing the rest of
the steps to continue in an environment that now has `uv` on the PATH.

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

This PR:
- Updates the make file to provide cleaner logic on handling the `make
install` when `uv` isn't present.
- Closes #9067

<!-- 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-01-21 22:16:10 +00:00
dependabot[bot] 5b9c2457c0 Python: Update pyarrow requirement from <19.0,>=12.0 to >=12.0,<20.0 in /python (#10243)
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 19.0.0</h2>
<p>Release Notes URL: <a
href="https://arrow.apache.org/release/19.0.0.html">https://arrow.apache.org/release/19.0.0.html</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/apache/arrow/commit/a999eaccb12378f9e4e9ab758f18edc25b0991e5"><code>a999eac</code></a>
MINOR: [Release] Update versions for 19.0.0</li>
<li><a
href="https://github.com/apache/arrow/commit/f6b7bc80c698854d174a41735e3a62bfb133c797"><code>f6b7bc8</code></a>
MINOR: [Release] Update .deb/.rpm changelogs for 19.0.0</li>
<li><a
href="https://github.com/apache/arrow/commit/848fde3793d148fb5729eaddc20849d01c6b0c9e"><code>848fde3</code></a>
MINOR: [Release] Update CHANGELOG.md for 19.0.0</li>
<li><a
href="https://github.com/apache/arrow/commit/8677e33380ef79f3344d667be4e74a42d7c4b810"><code>8677e33</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/45175">GH-45175</a>:
[Python] Honor the strings_to_categorical keyword in to_pandas for
...</li>
<li><a
href="https://github.com/apache/arrow/commit/f41f59066b79fbf59719e68ef0f908afd6c5218c"><code>f41f590</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/45166">GH-45166</a>:
[CI][C++] Upgrade Alpine Linux to 3.18 from 3.16 (<a
href="https://redirect.github.com/apache/arrow/issues/45168">#45168</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/8cff21f4f2829806a0dde11a6899a0f13290553d"><code>8cff21f</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/45178">GH-45178</a>:
[CI] Remove clcache related codes (<a
href="https://redirect.github.com/apache/arrow/issues/45182">#45182</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/777797e1b142d5f386e3bda873e8f8b32b2d2da1"><code>777797e</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/45183">GH-45183</a>:
[C++][Release] Add llvm-dev back to setup-ubuntu.sh (<a
href="https://redirect.github.com/apache/arrow/issues/45184">#45184</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/14dc66d505eae0126dd0dc43887dd42788c6fbe3"><code>14dc66d</code></a>
MINOR: [C#] Bump coverlet.collector from 6.0.2 to 6.0.3 in /csharp (<a
href="https://redirect.github.com/apache/arrow/issues/45179">#45179</a>)</li>
<li><a
href="https://github.com/apache/arrow/commit/a931affa1766be1f98979228ca6ab124aa7f793c"><code>a931aff</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/45073">GH-45073</a>:
[C++][Parquet] Fix generation of repetition levels for encryption
t...</li>
<li><a
href="https://github.com/apache/arrow/commit/ada8750917cd2ec2ae8a605d2673d78ef04c82e4"><code>ada8750</code></a>
<a
href="https://redirect.github.com/apache/arrow/issues/44563">GH-44563</a>:
[C++] <code>FunctionOptions::{Serialize,Deserialize}()</code> return an
error ...</li>
<li>Additional commits viewable in <a
href="https://github.com/apache/arrow/compare/go/v12.0.0...apache-arrow-19.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>
2025-01-21 07:44:08 +00:00
Evan MattsonandEduard van Valkenburg 71e5040a78 Python: Update sort step method for assistant invoke. (#10191)
### Motivation and Context

At times, when the (Azure) OpenAI Assistant Agent makes a tool call,
that tool call's creation timestamp is coming after the message creation
timestamp (the message creation being the text that the assistant
responds with). Currently in our code, if we have a tool call
(`FunctionCallContent`), we first yield that, and then we make a call to
get completed steps, to then yield more content like
`FunctionResultContent` and `TextContent`. There will be two steps (or
more, depending upon the number of tool calls).

Right now we sort the completed steps in this way:

```python
completed_steps_to_process: list[RunStep] = sorted(
    [s for s in steps if s.completed_at is not None and s.id not in processed_step_ids],
    key=lambda s: s.created_at,
)
```
When there are no failures, it's because the tool call was created
before the final message content (as has been since this assistant was
first coded). However, it appears that processing on the server-side can
cause fluctuations in when the steps are created/processed. When we have
a failure, we now have the message_creation (`TextContent`) yielded
before the `FunctionResultContent`, which if sent to an (Azure) OpenAI
Chat Completion endpoint will break with a 400 because of the gap in the
ordering between the `FunctionCallContent` and the
`FunctionResultContent`:

```
FunctionCallContent
TextContent # this should follow `FunctionResultContent` (and it does during times when we don't see a 400)
FunctionResultContent
```

The 400 error isn't 100% repeatable because of server-side processing,
so we will get the correct ordering:

```
FunctionCallContent
FunctionResultContent
TextContent
```

This PR updates the ordering of how we sort of the completed steps -- if
we have a step_type == "tool_calls" and "message_creation", we sort to
allow for "tool_calls" to come first, and any ties are broken by the
step.completed_at timestamp. With this update, we no longer receive 400s
because the ordering of the content types is correct when sending to an
OpenAI model.

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

This PR:
- Updates the way we sort completed messages during an assistant invoke.
- Adds logging for the assistant invoke method at the `info` level.
- Closes #10141

<!-- 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: Eduard van Valkenburg <[email protected]>
2025-01-20 19:29:13 +00:00
Eduard van Valkenburg 5b65e6ab24 .Net: Python: fix pre-commit version (#10235)
### 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.
-->
fix of uv version in pre-commit, fix for redis link

### 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-01-20 16:46:39 +01:00
2e4455b202 Python: Feat/Add DEVELOPER role for openai o1 (#10033)
### Motivation and Context

Currently, the OpenAI O1 model introduces a new role "developer".
However, passing the conventional "system" role results in an error. To
address this issue, the following changes are proposed.

### Description

1. **Add a Method to the `ChatHistory` Class**  
- Implement a method to handle role conversion or substitution logic for
compatibility with the O1 model.

2. **Expand the `AuthorRole` Enum**  
   - Add `"developer"` as a new value to the `AuthorRole` enum.

3. **Improve Developer Experience (UX)**  
- If the `"system"` role is mistakenly passed, the logic should
internally convert it to `"developer"` for better UX.
- However, since all models other than O1 still use `"system"`, simply
adding support for the `"developer"` role seems to be the most optimal
solution at this point.

- Closes: #10032 

### Background

- The O1 model no longer supports the `"system"` role, causing errors
when it is passed.
- The introduction of the `"developer"` role must be integrated in a way
that preserves compatibility with other models.

### Usage

```python
import asyncio

from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
from semantic_kernel.connectors.ai.open_ai.prompt_execution_settings.azure_chat_prompt_execution_settings import (
    AzureChatPromptExecutionSettings,
)
from semantic_kernel.connectors.ai.open_ai.services.azure_chat_completion import AzureChatCompletion
from semantic_kernel.contents.chat_history import ChatHistory
from semantic_kernel.kernel import Kernel

async def main():
    kernel = Kernel()
    service_id = "azure-openai"
    kernel.add_service(
        service=AzureChatCompletion(
            service_id=service_id,
            api_key=*********,
            endpoint=*********,
            deployment_name="o1",
            api_version="2024-12-01-preview",
        )
    )

    settings = kernel.get_prompt_execution_settings_from_service_id(service_id=service_id)

    if isinstance(settings, AzureChatPromptExecutionSettings):
        settings.function_choice_behavior = FunctionChoiceBehavior.Auto(auto_invoke=True)

    service = kernel.get_service(service_id=service_id)

    if not isinstance(service, AzureChatCompletion):
        raise Exception("Invalid Value")

    history = ChatHistory()
    history.add_developer_message("You are a helpful assistant.")
    history.add_user_message("hello")

    result = await service.get_chat_message_contents(chat_history=history, settings=settings, kernel=kernel)

    if not result:
        raise Exception("result is None")

    print(result[0].content)

if __name__ == "__main__":
    asyncio.run(main())
```

### Contribution Checklist

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

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

---------

Co-authored-by: Tao Chen <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
2025-01-15 07:24:56 +00:00
Tao Chen bf45719275 Python: Update gen_ai traces and logs (#10173)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
The gen_ai semantic convention has gone through some updates since we
started generating telemetry for gen_ai operations. We would like to
align with the latest conventions, and most importantly allow our users
to visualize the gen_ai traces on the Azure AI Foundry Tracing UI, which
relies on the gen_ai conventions.

### Description

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

1. Updates the gen_ai telemetry module to align with the latest gen_ai
convention so that all AI connectors generate telemetry data that can be
visualized on Azure AI Foundry.
2. Unit tests for the update.

> Note that this is a breaking change as this feature is still
experimental. Anyone who is relying on the previous gen_ai conventions
should also update.

### 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-01-14 18:00:05 +00:00
Evan Mattson 22cfbd5cf8 Python: Bump Python version to 1.18.2 for a release. (#10171)
### Motivation and Context

Bump Python version to 1.18.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.18.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-01-13 19:44:14 +00:00
Evan Mattson 3e4d8fc008 Python: Provide full list of samples in concepts README. (#10161)
### Motivation and Context

Provide the full list of samples including hyperlinks in the
samples/concepts/README.md file instead of only the type of sample.

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

This PR:
- Provides the full list of samples including hyperlinks in the
samples/concepts/README.md file instead of only the type of sample.
- Renames the "structured_output" folder to be "structured_outputs"
which is the name OpenAI uses.
- Closes #6928

<!-- 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-01-13 18:50:09 +00:00
Evan Mattson fac32057d3 Python: Configure top_p and temp for assistant agents if configured (#10163)
### Motivation and Context

The assistant agent class was storing top_p and temp, but never sending
it during agent creation.

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

Send the top_p and temp params if configured while creating an assistant
agent.
- Closes #10162

<!-- 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-01-13 17:59:26 +00:00
Evan Mattson 9b794532f1 Python: Bump Python version to 1.18.1 for a release. (#10146)
### Motivation and Context

Bump Python version to 1.18.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.18.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-01-09 22:33:09 +00:00
Evan Mattson 12b6b8264f Python: Improve agent retrieval by passing necessary kwargs. Add unit tests. (#10116)
### Motivation and Context

The assistant retrieval methods for OpenAI and AzureOpenAI didn't
propagate the api_key or client, if specified. For AzureOpenAI, it's
also important to propagate more settings info.

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

This PR:
- improves the handling for retrieving an agent by making sure we pass
along specified keyword arguments
- adds unit tests to ensure the new functionality works as expected

<!-- 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-01-09 11:39:52 +00:00
Evan Mattson f5f38c7289 Python: Upgrade AOAI api version to latest GA: 2024-10-21 (#10118)
### Motivation and Context

The current DEFAULT_AZURE_API_VERSION is stale at 2024-06-01. The
[latest GA API
VERSION](https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation#latest-ga-api-release)
is 2024-10-21.

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

This PR upgrades the DEFAULT_AZURE_API_VERSION to be the latest GA
2024-10-21. This default version is used if an api_version is not
supplied to the AzureChatCompletion constructor.
- Closes #10117

<!-- 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-01-09 10:55:34 +00:00
Tao Chen 4882550306 Python: Fix function call content argument parsing (#10132)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This PR includes changes to improve the handling of JSON parsing when it
fails to be parsed as it is in function call arguments by adding a
regular expression for preprocessing JSON strings to remove single
quotes only when they are not escaped.

### Description

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

Enhancements to JSON parsing:

*
[`python/semantic_kernel/contents/function_call_content.py`](diffhunk://#diff-1f5f27eade7117045bc9e62d66ebef5c93047142cdb4fd0115b0ff8eadf2f69cL152-R164):
Modified `parse_arguments` method to preprocess JSON strings by
replacing single quotes with double quotes, except for escaped single
quotes. Added a debug log for invalid JSON.

Test file updates:

*
[`python/tests/unit/contents/test_function_call_content.py`](diffhunk://#diff-6e891b3044d5bf5caa7abc97a44ef11ce291aba01fa8032ab1104773f4545c9dR135-R148):
Added new tests for parsing single-quoted JSON strings. Renamed the test
file from `test_function_call.py` to `test_function_call_content.py`.

### 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-01-09 10:47:09 +00:00
Tao Chen dcad32e503 Python: Temporarily xFail some google ai integration tests to unblock (#10136)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This pull request includes updates to the test cases in the
`python/tests/integration/completions/test_chat_completion_with_function_calling.py`
and
`python/tests/integration/completions/test_chat_completion_with_image_input_text_output.py`
files. The changes primarily address the handling of Google AI API
issues by adding markers to the tests.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
*
[`python/tests/integration/completions/test_chat_completion_with_function_calling.py`](diffhunk://#diff-530ae449ac82bcd42280dcf440a135e38acc53a5362940fdbb64edfdc4300abcL506-R512):
Added `xfail` markers to multiple test cases to handle temporary
failures due to Google AI API issues related to function calling not
being enabled for models/gemini-1.5-flash.
[[1]](diffhunk://#diff-530ae449ac82bcd42280dcf440a135e38acc53a5362940fdbb64edfdc4300abcL506-R512)
[[2]](diffhunk://#diff-530ae449ac82bcd42280dcf440a135e38acc53a5362940fdbb64edfdc4300abcL526-R538)
[[3]](diffhunk://#diff-530ae449ac82bcd42280dcf440a135e38acc53a5362940fdbb64edfdc4300abcL572-R590)
*
[`python/tests/integration/completions/test_chat_completion_with_image_input_text_output.py`](diffhunk://#diff-9c1b24d0f91106612c3b55b1f63122811cf4d3cb6dbc6908e50b8a3804bd42ecL186-R192):
Added an `xfail` marker to handle temporary failure due to Google AI API
issues related to image input modality not being enabled for
models/gemini-1.5-flash.

### 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-01-09 10:30:06 +00:00
Evan Mattson 8a00172f68 Python: Bump Python version to 1.18.0 for a release. (#10115)
### Motivation and Context

Bump Python version to 1.18.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.18.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-01-07 21:54:31 +00:00
Evan Mattson 0d8e3fd3af Python: Remove OpenAI plugin. Update OpenAPI exec params to use direct predicate reference (#10095)
### Motivation and Context

Dotnet had long removed the OpenAI plugin from its code base, and Python
did not follow at the time. We had previously provided deprecation
messages around using the OpenAI plugin and to switch to the OpenAPI
plugin. We are now removing the OpenAI plugin from the SK Python SDK.

Additionally, there was a forward reference created without specifying
the direct predicate context reference in the
OpenAPIFunctionExecutionParameters. This put the burden on the dev to
have to perform a model rebuild once the import was added. This PR
cleans up the `OperationSelectionPredicateContext` import, which is now
direct and via the sub-module and not via the parent module, which
causes the __init__.py to load all dependencies (which is unnecessary).

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

This PR:
- removes the unsupported OpenAI plugin (previously marked as
deprecated)
- fixes the `OperationSelectionPredicateContext` import to allow a user
to create the func exec params without receiving a pydantic error.
- updates unit tests to remove references to OpenAI plugin.

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

### Contribution Checklist

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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-01-07 21:53:31 +00:00
AndreeaDan27 9299088d47 Python: Update README.md (#10028)
prompt_template_config needs PromptTemplateConfig type but req_settings
is PromptExecutionSettings type which seems to be accepted better by
prompt_execution_settings

### 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?
  It throws an error otherwise
  3. What problem does it solve?
AttributeError: 'AzureChatPromptExecutionSettings' object has no
attribute 'execution_settings'
  4. What scenario does it contribute to?
  5. If it fixes an open issue, please link to the issue here.
  It's a README fix :) 

### Description

prompt_template_config needs PromptTemplateConfig type but req_settings
is PromptExecutionSettings type which seems to be accepted better by
prompt_execution_settings

Changed to prompt_execution_settings=req_settings instead of
prompt_template_config=req_settings,

### 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-01-07 19:16:26 +00:00
dependabot[bot] ef9d46cf79 Python: Update chromadb requirement from <0.6,>=0.5 to >=0.5,<0.7 in /python (#10042)
Updates the requirements on
[chromadb](https://github.com/chroma-core/chroma) to permit the latest
version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/chroma-core/chroma/releases">chromadb's
releases</a>.</em></p>
<blockquote>
<h2>0.6.0</h2>
<p>Version: <code>0.6.0</code>
Git ref: <code>refs/tags/0.6.0</code>
Build Date: <code>2024-12-30T22:03</code>
PIP Package: <code>chroma-0.6.0.tar.gz</code>
Github Container Registry Image:
<code>ghcr.io/chroma-core/chroma:0.6.0</code>
DockerHub Image: <code>chromadb/chroma:0.6.0</code></p>
<h2>What's Changed</h2>
<ul>
<li>[ENH] Implement K Means by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3159">chroma-core/chroma#3159</a></li>
<li>[ENH] Implement append by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3182">chroma-core/chroma#3182</a></li>
<li>[ENH] SPANN: Implement update and delete by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3185">chroma-core/chroma#3185</a></li>
<li>[ENH] Full garbage collection by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3194">chroma-core/chroma#3194</a></li>
<li>[CHORE] switch chroma-load away from tonic by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3250">chroma-core/chroma#3250</a></li>
<li>[BLD]: publish Helm chart to ECR by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3246">chroma-core/chroma#3246</a></li>
<li>[BLD]: fix Helm package directory in workflow by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3251">chroma-core/chroma#3251</a></li>
<li>[ENH] Introduce spann segment reader by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3212">chroma-core/chroma#3212</a></li>
<li>[ENH] rng_query_operator by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3213">chroma-core/chroma#3213</a></li>
<li>[BUG] Instantiate http client for chroma-load tracing. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3254">chroma-core/chroma#3254</a></li>
<li>[ENH] Fetch posting list operator by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3214">chroma-core/chroma#3214</a></li>
<li>[ENH] Brute force distances for a posting list operator by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3215">chroma-core/chroma#3215</a></li>
<li>[ENH] spann_merge_operator by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3218">chroma-core/chroma#3218</a></li>
<li>[ENH] spann query orchestrator by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3219">chroma-core/chroma#3219</a></li>
<li>[ENH] Return better error from Sysdb for flush compaction. by <a
href="https://github.com/rohitcpbot"><code>@​rohitcpbot</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3244">chroma-core/chroma#3244</a></li>
<li>[BLD]: invalidate the layer cache for git clone hnswlib when there's
a new commit to the repo by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3258">chroma-core/chroma#3258</a></li>
<li>[ENH] Use tasks for concurrency. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3257">chroma-core/chroma#3257</a></li>
<li>[BUG] empty commit to trip CI cache by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3263">chroma-core/chroma#3263</a></li>
<li>chore: fix function name in comment by <a
href="https://github.com/clonefetch"><code>@​clonefetch</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3266">chroma-core/chroma#3266</a></li>
<li>[ENH] Upsert and a synthetic data set. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3253">chroma-core/chroma#3253</a></li>
<li>[BLD] trigger hosted release workflow by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3270">chroma-core/chroma#3270</a></li>
<li>[DOC] Fix Vercel build failures by <a
href="https://github.com/itaismith"><code>@​itaismith</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3272">chroma-core/chroma#3272</a></li>
<li>[ENH] SPANN: Bug fixes and benchmark by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3275">chroma-core/chroma#3275</a></li>
<li>[BLD]: use Depot to build chromadb image by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3273">chroma-core/chroma#3273</a></li>
<li>[BLD]: add Depot CLI setup step to fix build by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3279">chroma-core/chroma#3279</a></li>
<li>[ENH] Sinusoid and sawtooth load patterns for chroma-load. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3262">chroma-core/chroma#3262</a></li>
<li>[DOC] Document chroma-load by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3269">chroma-core/chroma#3269</a></li>
<li>[ENH] chroma-load can save and restore running workloads to survive
restarts. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3278">chroma-core/chroma#3278</a></li>
<li>[BLD] Sync internal log service changes to OSS by <a
href="https://github.com/eculver"><code>@​eculver</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3274">chroma-core/chroma#3274</a></li>
<li>[ENH] Metrics-only support. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3282">chroma-core/chroma#3282</a></li>
<li>[BLD] Remove the release-hosted workflow as it's no longer needed by
<a href="https://github.com/eculver"><code>@​eculver</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3283">chroma-core/chroma#3283</a></li>
<li>[CHORE] Remove a useless and expensive log line. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3289">chroma-core/chroma#3289</a></li>
<li>[CLN] Cleanup query node after pushdown by <a
href="https://github.com/Sicheng-Pan"><code>@​Sicheng-Pan</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3280">chroma-core/chroma#3280</a></li>
<li>[CLN] Deprecate PullLogsOperator by <a
href="https://github.com/Sicheng-Pan"><code>@​Sicheng-Pan</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3281">chroma-core/chroma#3281</a></li>
<li>[DOC] Fix vercel build fail by <a
href="https://github.com/itaismith"><code>@​itaismith</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3288">chroma-core/chroma#3288</a></li>
<li>[ENH] Batched GC by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3293">chroma-core/chroma#3293</a></li>
<li>[ENH] Parameterized queries. by <a
href="https://github.com/rescrv"><code>@​rescrv</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3299">chroma-core/chroma#3299</a></li>
<li>[BLD]: update deploy workflows by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3294">chroma-core/chroma#3294</a></li>
<li>[ENH] Remove log messages in happy hot paths by <a
href="https://github.com/sanketkedia"><code>@​sanketkedia</code></a> in
<a
href="https://redirect.github.com/chroma-core/chroma/pull/3300">chroma-core/chroma#3300</a></li>
<li>[BLD]: fix hotfix workflow by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3301">chroma-core/chroma#3301</a></li>
<li>[ENH]: stricter release/* &amp; rc/* branch trigger by <a
href="https://github.com/codetheweb"><code>@​codetheweb</code></a> in <a
href="https://redirect.github.com/chroma-core/chroma/pull/3303">chroma-core/chroma#3303</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/chroma-core/chroma/commit/5422fce1281902e12a31aef24ab1e47b4cf3e286"><code>5422fce</code></a>
[RELEASE] 0.6.0 (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3367">#3367</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/46423f8312e1fd8e9cf18b839e4dc02c3b149409"><code>46423f8</code></a>
[CHORE] REVERT: Make everything except chroma <code>INFO</code>. Make
chroma <code>DEBUG</code>.&quot;...</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/4cae3cc002747e5750a40adc7273e2b310f0a365"><code>4cae3cc</code></a>
[ENH]: make log materialization result <code>Send</code> (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3242">#3242</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/86d6d27dea96928a1a3bc8d2db5df0a04044d1ae"><code>86d6d27</code></a>
[ENH] Bump to the latest chromadb-rs pr. (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3349">#3349</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/c67dd8d86781b9881b5bf74b9edf2dc779809300"><code>c67dd8d</code></a>
[BLD]: add workflow that warns if the Helm chart was modified without
bumping...</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/0fd6022d2b2f018035139f2d95e88cc4ebe998e7"><code>0fd6022</code></a>
[BLD]: use lower core count for Python cluster tests (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3304">#3304</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/448827996cc396052adcc3afb4395204ef4cd606"><code>4488279</code></a>
[ENH] Add NAC to the write path (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3341">#3341</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/e279b76e0a226340a8540f8f1890a8cbea83e091"><code>e279b76</code></a>
[ENH] Ignore proto files generated by Go (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3347">#3347</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/e98f9300369a90c514eeab2a37629f8df9847575"><code>e98f930</code></a>
[CLN] Implement Orchestrator trait and cleanups (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3342">#3342</a>)</li>
<li><a
href="https://github.com/chroma-core/chroma/commit/a311d30eadb83b07f775e906d3c90fea0dffd78c"><code>a311d30</code></a>
[ENH] Use an improved chroma cloud client for chroma-load (<a
href="https://redirect.github.com/chroma-core/chroma/issues/3343">#3343</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/chroma-core/chroma/compare/0.5.0...0.6.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-07 18:44:53 +00:00
Evan Mattson 5830081902 Python: Improve azure assistant agent settings and retrieval operations. (#10063)
### Motivation and Context

The AzureAssistantAgent retrieval path was not handling the optional
ad_token. The agent constructor was handling it, to a degree, but there
were improvements to make and a helper function to introduce so that we
remove some code duplication.

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

This PR:
- Cleans up the code used to create the azure settings for an azure
assistant agent by introducing a helper function to streamline the logic
- Allows the AzureAssistantAgent.retrieve() method to use an ad_token,
if desired.
- Adds unit tests for the new logic. Other unit tests are still passing
after the refactor.

<!-- 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-01-07 18:34:46 +00:00
Evan Mattson 3f166941ee Python: Agent content generation for function call content should be assistant role (#10096)
### Motivation and Context

The (Azure)OpenAIAssistant content generation for function call content
was specifying the tool role instead of an assistant role. This was
causing an issue in the `.to_dict()` method in `chat_message_content`
because a `TOOL` role should only have `FunctionResultContent`.

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

This PR fixes the AuthorRole to be ASSISTANT instead of TOOL for
function call content, which matches how it's handled in the chat
completion case.
- Adds a specific unit test for test coverage (previous test coverage
was indirect and didn't catch this)
- Closes #10075

<!-- 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-01-07 18:00:26 +00:00
Eduard van Valkenburg ab18831580 Python: change order used to check variants in (de)ser steps (#10051)
### Motivation and Context

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

### 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-01-06 21:29:56 +00:00
Mark Wallace 85e6e5d598 Python: .Net: Add function calling with AzureAIInference sample (#9954)
### Motivation and Context

- Closes #9933 

### Description

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

### Contribution Checklist

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

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2025-01-06 13:54:54 +00:00
John Aziz 6200d8113b Python: Fix pydantic alias issue (#10027)
### Motivation and Context
fix #10026

### Description

This PR removes the alias as pydantic requires the usage of the alias
when initializing the class not the original name which prevents this
code from working.

```py
cosmosdb_settings = AzureCosmosDBSettings.create(
                env_file_path=env_file_path,
                connection_string=cosmos_connstr,
            )
```

### 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-01-05 13:39:20 +00:00
Evan Mattson 926a59095b Python: Bump Python version to 1.17.1 for a release. (#10018)
### Motivation and Context

Bump Python version to 1.17.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.17.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 😄
2024-12-19 16:03:18 +00:00
Nico MöllerandEduard van Valkenburg 8b389b8231 Python: Upgrade Minimum Onnx Version to enable MacOS Unit Tests (#9981)
Closes : #9979

enabled test cases for mac os
upgraded uv.lock file

### Motivation and Context

Using version 0.4.0 did not provide a pip package for MacOS, which
forced us to disabled Unit Tests on MacOs
With version 0.5.0 available we can enable the unit Tests for MacOS.

Using Version 0.5.0 will enable following features for users :

1. Phi3.5 and Phi3.5 MoE
2. MacOS Support without Building the Code from Source
3. LoRa Adapter Swapping

### 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: Eduard van Valkenburg <[email protected]>
2024-12-19 09:34:05 +00:00
Eduard van Valkenburg 3bab8486f5 Python: improved text_search folder testing (#9984)
### 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 unit tests to up the test coverage across the data folder
Also redoes exceptions for everything vector.

This does introduce some breaking changes on the exceptions returned by
the different methods for vector stores, they are still marked
experimental and this will go a long way in moving towards release.

Closes #9485 

### 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 😄
2024-12-19 08:47:12 +00:00
Evan Mattson 36701a2c73 Python: Include a function_invoke_attempt index with Streaming CMC (#10009)
### Motivation and Context

During auto function calling, we're yielding all messages back without
any indication as to which invocation index they are related to. This
information could be helpful to the caller to understand in which order
message chunks were received during the auto function invocation loop.

Depending upon the behavior of auto function calling, the
`request_index` iterates up to the `maximum_auto_invoke_attempts`. The
caller doesn't know today which function auto invoke attempt they're
currently on -- so simply handing all yielded messages can be confusing.
In a new PR, we will handle adding the `request_index` (perhaps with a
different name) to make it easier to know which streaming message chunks
to concatenate, which should help reduce the confusion down the line.

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

This PR adds:
- The `function_invoke_attempt` attribute to the
`StreamingChatMessageContent` class. This can help callers/users track
which streaming chat message chunks belong to which auto function
invocation attempt.
- A new keyword argument was added to the
`_inner_get_streaming_chat_message_contents` to allow the
`function_invoke_attempt` int to be passed through to the
`StreamingChatMessageContent` creation in each AI Service. This
**additive** keyword argument should not break existing.
- Updates unit tests
- Creates four new samples to showcase auto function calling: streaming
auto invoke / manual invoke (print tool calls), and non-streaming auto
invoke / manual invoke (print tool calls). These samples allow one to
specify the AI service that supports function calling, as listed in the
samples.
- Closes #10006 

<!-- 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 😄
2024-12-19 08:13:00 +00:00
Tao Chen f50117f75a Python: Fix Anthropic parallel tool call (#10005)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
When using the Anthropic connector with function calling, it's possible
that the model will request multiple functions in a single request. This
is referred to as [`parallel tool
use`](https://docs.anthropic.com/en/docs/build-with-claude/tool-use#disabling-parallel-tool-use)
by Anthropic.

When the model requests multiple functions, it expects the tool results
to be included in a single user message to be passed back to the model.
Right now, the Anthropic connector parses the tool results into multiple
user messages, which causes the model to throw an error.

This is a possible regression introduced by this PR:
https://github.com/microsoft/semantic-kernel/pull/9938

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Fix the Anthropic connector to handle parallel tool calls.
2. Add unit tests to ensure that future changes don't break this
functionality.
3. Enable integration test on Anthropic since we have a service endpoint
now.
4. Refactoring.

### 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 😄
2024-12-19 05:16:21 +00:00
Evan Mattson 16690ed857 Python: Yield FunctionResultContent in streaming chat completion path. Update tests. (#9974)
### Motivation and Context

Currently, if using SK's Python streaming chat completion path, we only
yield the following content types: `StreamingChatMessageContent` and
`FunctionCallContent`. We are not yielding `FunctionResultContent` which
is valuable for some use cases.

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

This PR updates the code to yield `FunctionResultContent` if it exists
in the streaming chat completion path. When we merge the function call
result content together into a `StreamingChatMessageContent` type, we
check if that message has items (which are of type
`FunctionResultContent`) and if so, we yield them. The filter path still
works because once they're yielded, we break out of the function calling
loop.

We need to include the `ai_model_id` if it exists for the current
PromptExecutionSettings because if performing a `reduce` operation to
add two streaming chat message chunks together, the
`StreamingChatMessageContent` that has the function results will break
if the `ai_model_id` is not set (the error is thrown in the `__add__`
override for the `StreamingChatMessageContent`.

Some unit tests that cover function calling were also updated -- during
the test, the test JSON function args were breaking in the `json.loads`
call because they contained single quotes and not double. We're now
sanitizing the args, just in case, so we don't break there.

This PR fixes:
- #9408
- #9968 

<!-- 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 😄
2024-12-18 01:09:25 +00:00
Tao Chen 4a21254fe8 Python: Anthropic function calling fixes (#9938)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
The current implementation of the Anthropic connector relies on the
`inner_content`s in chat messages to prepare the chat history for the
Anthropic client. This will only work when the chat history is created
by the Anthropic connector. This won't work if the chat history has been
processed by other connectors, or if it is hardcoded as in testing.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Prepare the chat history for the Anthropic client by parsing the
actual Semantic Kernel item types.
2. Fix tests for the Anthropic connector.


### 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 😄
2024-12-16 22:51:22 +00:00
Evan MattsonandEduard van Valkenburg b42720890d Python: FunctionResultContent hash fix to handle lists/sets (#9978)
### Motivation and Context

Currently, the hash function in `FunctionResultContent` does not
properly handle types of list or set. Adding the proper handling to turn
these into a tuple, and then the hash function works properly.

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

This PR:
- Makes sure the FunctionResultContent `__hash__` method can properly
handle mutable types like lists or sets
- Adds tests to ensure the new behavior works as expected
- Ensures the create message content method can handle lists or sets
when generating the content and the model can only accept a string.
- Fixes #9977

<!-- 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: Eduard van Valkenburg <[email protected]>
2024-12-16 22:14:22 +00:00
Eduard van Valkenburg 62a50f32cf Python: Qdrant - fix in filter and 100% test coverage (#9982)
### 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.
-->
There was a small error in the filter creation logic, and improved test
coverage for Qdrant.

### 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 😄
2024-12-16 19:14:36 +00:00
Tao Chen 7531abfc2a Python: Deprecated retry_mechanism (#9965)
### 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 Python, we have the `retry_mechanism` property in the kernel but it's
never used.

Address: https://github.com/microsoft/semantic-kernel/issues/9015

### Description
1. Deprecate the retry_mechanism field.
2. Add a sample showing how to perform retries with the kernel using
filter.

<!-- 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 😄
2024-12-13 22:22:58 +00:00
Eduard van Valkenburg b1f4769ba5 Python: updated pydantic 2.10.3 works again (#9923)
### 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.
-->
Manual update to pydantic requirement, they fixed the incompatibility in
10.3 (10.<3 was broken).

We need one more fix in Pydantic 2.10, which should come in 2.10.4:
https://github.com/pydantic/pydantic/issues/10910
this is the issue: https://github.com/pydantic/pydantic/issues/11024
Comes into play with some of the vector stores.

So excluded 2.10 smaller then 2.10.4.

Closes #9788

### 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 😄
2024-12-12 21:08:46 +00:00
Mark WallaceandTao Chen c2895a3749 Python: Add store and metadata properties to OpenAIPromptExecutionSettings (#9946)
### Motivation and Context

Closes #9918 

### Description

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

### Contribution Checklist

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

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

---------

Co-authored-by: Tao Chen <[email protected]>
2024-12-11 21:52:21 +00:00
dependabot[bot] 494590fc91 Python: Update pymilvus requirement from <2.5,>=2.3 to >=2.3,<2.6 in /python (#9864)
Updates the requirements on
[pymilvus](https://github.com/milvus-io/pymilvus) to permit the latest
version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/milvus-io/pymilvus/releases">pymilvus's
releases</a>.</em></p>
<blockquote>
<h2>PyMilvus 2.5.0 Release Notes</h2>
<p>New features:</p>
<ul>
<li>Report cost in the dml and dql request by <a
href="https://github.com/SimFG"><code>@​SimFG</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2055">milvus-io/pymilvus#2055</a></li>
<li>feat: Support major compaction in ManualCompaction by <a
href="https://github.com/wayblink"><code>@​wayblink</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2015">milvus-io/pymilvus#2015</a></li>
<li>Support Milvus Lite by <a
href="https://github.com/junjiejiangjjj"><code>@​junjiejiangjjj</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2073">milvus-io/pymilvus#2073</a></li>
<li>Enable set_properties and describe_database api by <a
href="https://github.com/weiliu1031"><code>@​weiliu1031</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2082">milvus-io/pymilvus#2082</a></li>
<li>Allowing search iterator on sparse float vector field by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2104">milvus-io/pymilvus#2104</a></li>
<li>Accept list of single row scipy.sparse object as input for
insert/search by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2111">milvus-io/pymilvus#2111</a></li>
<li>Support float16/bfloat16/sparse vector for bulkwriter by <a
href="https://github.com/yhmo"><code>@​yhmo</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2127">milvus-io/pymilvus#2127</a></li>
<li>Support group_size parameter for search_group_by by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2130">milvus-io/pymilvus#2130</a></li>
<li>Upsert support autoid by <a
href="https://github.com/smellthemoon"><code>@​smellthemoon</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2173">milvus-io/pymilvus#2173</a></li>
<li>Expose reduce_stop_for_best to users(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2181">#2181</a>)
by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2183">milvus-io/pymilvus#2183</a></li>
<li>Bulkinsert supports importing binlog by <a
href="https://github.com/yhmo"><code>@​yhmo</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2222">milvus-io/pymilvus#2222</a></li>
<li>Add page_retain_order param during search with offset by <a
href="https://github.com/PwzXxm"><code>@​PwzXxm</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2229">milvus-io/pymilvus#2229</a></li>
<li>Support load with Field Partial load by <a
href="https://github.com/congqixia"><code>@​congqixia</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2228">milvus-io/pymilvus#2228</a></li>
<li>Support null and default value by <a
href="https://github.com/smellthemoon"><code>@​smellthemoon</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2234">milvus-io/pymilvus#2234</a></li>
<li>Support the mmap_enable param in the field schema by <a
href="https://github.com/SimFG"><code>@​SimFG</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2238">milvus-io/pymilvus#2238</a></li>
<li>Add strict_group_size and rank_group_scorer for hybrid_search(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2253">#2253</a>)
by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2254">milvus-io/pymilvus#2254</a></li>
<li>Load configuration without altering the environment by <a
href="https://github.com/laipz8200"><code>@​laipz8200</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2192">milvus-io/pymilvus#2192</a></li>
<li>Update proto to get is_sorted field for GetQuerySegmentInfo by <a
href="https://github.com/xiaocai2333"><code>@​xiaocai2333</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2280">milvus-io/pymilvus#2280</a></li>
<li>Support mvcc and break-down-continue for iterator(<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2278">#2278</a>)
by <a
href="https://github.com/MrPresent-Han"><code>@​MrPresent-Han</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2279">milvus-io/pymilvus#2279</a></li>
<li>Support new Function feature by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2257">milvus-io/pymilvus#2257</a></li>
<li>Supports filling elements through templates for expression by <a
href="https://github.com/xiaocai2333"><code>@​xiaocai2333</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2317">milvus-io/pymilvus#2317</a></li>
<li>Add compact, get_server_version and flush api by <a
href="https://github.com/czs007"><code>@​czs007</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2326">milvus-io/pymilvus#2326</a></li>
</ul>
<p>Enhancements</p>
<ul>
<li>Upgrade the bulkWriter cloud API call from v1 to v2 by <a
href="https://github.com/lentitude2tk"><code>@​lentitude2tk</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2245">milvus-io/pymilvus#2245</a></li>
<li>enhance: tidy dependencies in tests by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/1996">milvus-io/pymilvus#1996</a></li>
<li>Update sparse+dense hybrid search example by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2005">milvus-io/pymilvus#2005</a></li>
<li>Support UDS by <a
href="https://github.com/junjiejiangjjj"><code>@​junjiejiangjjj</code></a>
in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2023">milvus-io/pymilvus#2023</a></li>
<li>enhance: Update hello_hybrid_sparse_dense.py example to include BGE
reranker by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2028">milvus-io/pymilvus#2028</a></li>
<li>enhance: add resource group declarative api by <a
href="https://github.com/chyezh"><code>@​chyezh</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2002">milvus-io/pymilvus#2002</a></li>
<li>enhance: Make bulk_writer's requirments optional by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2086">milvus-io/pymilvus#2086</a></li>
<li>Added grpc as a valid protocol for uri by <a
href="https://github.com/brunocfnba"><code>@​brunocfnba</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2090">milvus-io/pymilvus#2090</a></li>
<li>enhance: print search result more elegantly by <a
href="https://github.com/longjiquan"><code>@​longjiquan</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2123">milvus-io/pymilvus#2123</a></li>
<li>enhance: Check PyMilvus on Windows platform by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2136">milvus-io/pymilvus#2136</a></li>
<li>Export indexed rows for describe_index by <a
href="https://github.com/xiaocai2333"><code>@​xiaocai2333</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2148">milvus-io/pymilvus#2148</a></li>
<li>Add database operations to MilvusClient by <a
href="https://github.com/ashkrisk"><code>@​ashkrisk</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2152">milvus-io/pymilvus#2152</a></li>
<li>enhance: enable setting properties during create database by <a
href="https://github.com/weiliu1031"><code>@​weiliu1031</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2168">milvus-io/pymilvus#2168</a></li>
<li>enhance: hide zero values when printing by <a
href="https://github.com/SimFG"><code>@​SimFG</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2200">milvus-io/pymilvus#2200</a></li>
<li>enhance: use info level for retry message by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2212">milvus-io/pymilvus#2212</a></li>
<li>enhance: Make load parameter naming normal by <a
href="https://github.com/congqixia"><code>@​congqixia</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2243">milvus-io/pymilvus#2243</a></li>
<li>enhance: add bitmap index example by <a
href="https://github.com/zhagnlu"><code>@​zhagnlu</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2376">milvus-io/pymilvus#2376</a></li>
</ul>
<p>Bug fixes</p>
<ul>
<li>fix: Remove np.view for floatvector by <a
href="https://github.com/XuanYang-cn"><code>@​XuanYang-cn</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2048">milvus-io/pymilvus#2048</a></li>
<li>fix: pass offset parameter for hybrid search to server by <a
href="https://github.com/czs007"><code>@​czs007</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2051">milvus-io/pymilvus#2051</a></li>
<li>Change sparse related errors to ParamError by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2066">milvus-io/pymilvus#2066</a></li>
<li>modified example_tls1.py through MilvusClient by <a
href="https://github.com/nish112022"><code>@​nish112022</code></a> in <a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2065">milvus-io/pymilvus#2065</a></li>
<li>remove scipy dependency for sparse while still supporting scipy
sparse matrix by <a
href="https://github.com/zhengbuqian"><code>@​zhengbuqian</code></a> in
<a
href="https://redirect.github.com/milvus-io/pymilvus/pull/2074">milvus-io/pymilvus#2074</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/73d039428f3e5cd9c02505c02ea6dde7484e1802"><code>73d0394</code></a>
fix: when insert do not add function output field to dynamic field (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2382">#2382</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/dd629dd47df35057a71a89ca807308b83e178eea"><code>dd629dd</code></a>
enhance: Prepare to release 2.5.0 (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2379">#2379</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/15374f63556ae0b5a40a3b09d17fdeb5076eb19a"><code>15374f6</code></a>
enhance: Enhance log messages when Connect with server failed (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2377">#2377</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/a086a9d95f9534d0c8a4d3e9303d13860a22fd99"><code>a086a9d</code></a>
enhance: format list privilege group result (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2372">#2372</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/b7c6fd27ee1bbf7ba0709ef2bdc1a13ce61f053a"><code>b7c6fd2</code></a>
enhance: add bitmap index example (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2376">#2376</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/46f12b21c80efdfc718bc2ef86d867b710a06f1c"><code>46f12b2</code></a>
Add default values to Pop to prevent exceptions (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2373">#2373</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/89cf1a9a5285f1923a138032984c38c0334ec8eb"><code>89cf1a9</code></a>
fix: cannot pass consistency level for delete (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2350">#2350</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/c10d61a1db61f454e8f14319b39ad8eb2702227d"><code>c10d61a</code></a>
fix: RBAC fix privilege group orm (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2366">#2366</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/99bea06ac773fa8ad36cc77f27d339831ff1ba69"><code>99bea06</code></a>
Correct grammar (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2365">#2365</a>)</li>
<li><a
href="https://github.com/milvus-io/pymilvus/commit/4b4924686f36f36aafdb29ab694e42ce0c798eea"><code>4b49246</code></a>
enhance: RBAC grant v2 api (<a
href="https://redirect.github.com/milvus-io/pymilvus/issues/2361">#2361</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/milvus-io/pymilvus/compare/v2.3.0...v2.5.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>
2024-12-10 07:53:49 +00:00
Tao ChenandEvan Mattson 31ec20ee22 Python: Adjust tool limit per request (#9894)
### 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.
-->
We have set incorrect limits on the number of tools that can be provided
to the AI services per request.

### Description

1. This PR removes the limits and will have requests fail on the service
side if there is any limit.
2. Add unit tests for prompt execution settings of some services that
are previously lacking such tests.
3. Fix the test coverage workflow.

<!-- 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]>
2024-12-10 07:52:24 +00:00
Evan Mattson ceae00c32c Python: Include the sessions plugin status key in return value (#9904)
### Motivation and Context

The Python sessions plugin (ACA) includes a `status` now in their result
once code is executed. This looks to have been added recently as we
weren't including it in the original return string. This PR adds that.

<!-- 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 the `status` key value to the return string.
- Fixes Python bug for #9902 

<!-- 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 😄
2024-12-09 21:52:17 +00:00
Eduard van Valkenburg 87967ac233 Python: enable ollama streaming tool calls (#9890)
### 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.
-->

Ollama has enabled streaming tool calling, and so we add that too!
See release notes: https://github.com/ollama/ollama/releases/tag/v0.4.6

Also encountered a bug when passing generic PromptExecutionSettings to
all ChatCompletions with Function calling enabled, the
_verify_function_choice_settings often check if something is a type of
PES matching the service, that is not the case and throws even though it
should work (for instance when using a yaml based function), this fixes
that as well by casting in the public methods of chat completion base.

### 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 😄
2024-12-09 15:58:57 +00:00
Evan Mattson 7479657d93 Python: Introduce agent name field regex (#9887)
### Motivation and Context

The agent name Pydantic field currently does not have any pattern regex
config. If a user creates an agent with an incorrect name (something
other than `0-9A-Za-z_-`) they will get a 400. To validate and error out
earlier, we're introducing the regex check when the field is validated.

Note, this is a non-breaking change because an invalid name errors out
further down in the processing -- we're adding this regex check so that
it can help a user/dev understand earlier in the processing that they
need to update their agent name.

<!-- 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 the regex field validation for the agent name as `AGENT_NAME_REGEX =
r"^[0-9A-Za-z_-]+$"`. Unlike the SK plugin/function names, this name can
contain a `-`. Updates unit tests.
- Closes #9340 

<!-- 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 😄
2024-12-06 01:16:34 +00:00
Evan Mattson d5169949f7 Python: Bump Python version to 1.17.0 for a release. (#9885)
### Motivation and Context

Bump Python version to 1.17.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.17.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 😄
2024-12-05 02:26:38 +00:00
Tao Chen 30b67ec715 Python: Raise exceptions when services are not set up in integration test workflow (#9874)
### 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.
-->
Our integration tests should encompass all test cases unless a case is
explicitly marked as skipped or expected to fail (xfail). Currently, our
setup permits test cases to be skipped if the required environment
variables are not configured. While this approach is beneficial for
local testing—since not all developers have access to all necessary
resources - it presents challenges in our pipeline. In this environment,
changes to environment variables can lead to test cases being skipped
without notice, potentially allowing issues to go undetected until a
specific connector is reported as problematic.

### Description

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

The `is_service_setup_for_testing` now also reads the `raise_if_not_set`
argument from an environment variable
(`INTEGRATION_TEST_SERVICE_SETUP_EXCEPTION`). When
`INTEGRATION_TEST_SERVICE_SETUP_EXCEPTION` is not set nor the argument
is not passed in, the method will not raise, allowing people to run the
integration tests locally.

When `INTEGRATION_TEST_SERVICE_SETUP_EXCEPTION` is set or
`raise_if_not_set` is explicitly set to true, test collection will fail.

`INTEGRATION_TEST_SERVICE_SETUP_EXCEPTION` is set to true in our
pipeline environment.

### 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 😄
2024-12-03 21:08:04 +00:00
Eduard van Valkenburg e0042afa80 Python: graduate filters, add exception during addition and some cleanup (#9856)
### Motivation and Context

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

This includes some updates to the docstrings.
And adds a specific Exception for errors during adding or removing of
filters.

Closes #9838 
Fixes #9641 

### 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 😄
2024-12-03 17:40:01 +00:00