mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
dependabot/github_actions/github/codeql-action/init-4.37.9
205
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b371cc6c6f |
Python: update dependencies (#14360)
## Summary - update Transformers and related Hugging Face packages - refresh Python dependencies used by the MCP OAuth demo - regenerate the affected uv lockfiles - adapt the Hugging Face text completion connector to Transformers 5 - temporarily disable live tests that depend on the retired Assistants API ## Hugging Face connector Transformers 5 removes the `text2text-generation`, `summarization` and `translation` pipeline tasks, so `HuggingFaceTextCompletion` raised `KeyError: Unknown task text2text-generation` on construction. Those two tasks now use a small adapter built on `AutoModelForSeq2SeqLM` and `AutoTokenizer` that preserves what the removed pipelines did: - the same output keys (`summary_text` for summarization, `generated_text` otherwise), so the content mapping is unchanged - the model's task specific prefix (e.g. `summarize: `) is still prepended before tokenization - one record per generated sequence when `num_return_sequences > 1` - `model_kwargs` are shared with the tokenizer load, as `pipeline()` did - pipeline only options are dropped with a warning instead of reaching `generate()` `text-generation` keeps using `pipeline()`. There is no public API change. The previous unit tests mocked `pipeline()` and so did not catch the incompatibility. New tests cover the adapter, option routing, device placement, output mapping and prefix resolution. ## Temporarily disabled tests The OpenAI and Azure OpenAI Assistants API has been retired. Live requests now return HTTP 410 (`assistants_api_deprecated`) on Azure OpenAI and HTTP 404 on OpenAI, so these tests cannot exercise a functioning service. - all 30 parametrized cases in `tests/integration/agents/openai_assistant_agent/test_openai_assistant_agent_integration.py` are skipped at module level, before the live-service fixture runs - the `step1_openai_assistant` case in `tests/samples/test_concepts.py` is skipped unconditionally - the other concept samples are unchanged - all 103 tests under `tests/unit/agents/openai_assistant` remain enabled and passing The skips are intentionally limited to live tests for the retired API. Comments next to each skip include the migration guide and state that the skip should be removed after the agents and sample move to the replacement API. ## Validation - uv lock consistency checks - 35 Hugging Face unit tests pass - all 12 deliberate connector mutations used to assess regression coverage were detected by the unit tests - all 103 Assistants agent unit tests pass - 30 live Assistants integration cases and the one retired-API concept sample report as skipped before making service requests - the three text completion services used by the integration suite were exercised against their real models on Transformers 5, for both completion and streaming - Ruff check and formatting pass --------- Co-authored-by: Evan Mattson <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2d4dd29-0a9c-4f43-b2ce-243e19ec34b2 |
||
|
|
7481cd062b |
Fix cosmosdb vectorstore bug (#14182)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] 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 😄 |
||
|
|
83bffe197b |
Python: Add OpenAPI server URL validation (#14097)
## Summary - Add server URL validation for Python OpenAPI operation execution before outbound requests are made - Add execution settings for trusted allowed base URLs and private-network access - Pass operation arguments into server variable resolution and add regression coverage for substituted server hosts ## Testing - `uv run pytest tests/unit/connectors/openapi_plugin/test_server_url_validator.py tests/unit/connectors/openapi_plugin/test_openapi_runner.py tests/unit/connectors/openapi_plugin/test_openapi_manager.py tests/unit/connectors/openapi_plugin/test_sk_openapi.py` - `uv run pytest tests/integration/cross_language/test_cross_language.py -k openapi` - `uv run ruff check ...` - `uv run ruff format --check ...` --------- Co-authored-by: Copilot <[email protected]> |
||
|
|
83ff0a5aaa |
Python: fix(google-ai): skip api_key check when use_vertexai is True (#13607)
## Summary Fixes #13483 ### Motivation and Context When `use_vertexai=True`, users authenticate via Application Default Credentials (ADC) and don't need an API key. However, the initialization check for `api_key` runs unconditionally, blocking Vertex AI users with: ``` ServiceInitializationError: The API key is required when use_vertexai is False. ``` ### Description Guard the `api_key` validation with `not google_ai_settings.use_vertexai` in all three Google AI service classes: - `GoogleAIChatCompletion` - `GoogleAITextCompletion` - `GoogleAITextEmbedding` The error message already reads *"when use_vertexai is False"*, so the condition now matches the intent. ### Before / After ```python # Before — fails even with use_vertexai=True GoogleAIChatCompletion( use_vertexai=True, cloud_project_id="my-project", cloud_region="us-central1" ) # → ServiceInitializationError: The API key is required when use_vertexai is False. # After — works correctly GoogleAIChatCompletion( use_vertexai=True, cloud_project_id="my-project", cloud_region="us-central1" ) # → Initializes successfully, uses ADC for authentication ``` ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the [SK coding standards](https://github.com/microsoft/semantic-kernel/blob/main/python/README.md) --------- Co-authored-by: giulio-leone <[email protected]> Co-authored-by: giulio-leone <[email protected]> Co-authored-by: Copilot <[email protected]> |
||
|
|
3f6d72725f |
Python: Fix image integration tests that are now blocked due to bot policies (#13680)
### Motivation and Context Fix image integration tests that are now blocked due to bot policies <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Fix image integration tests that are now blocked due to bot policies <!-- 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 😄 |
||
|
|
72bc02551f |
Python: added allowed_domains to HttpPlugin (#13462)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Adds allowed_domains setup for HttpPlugin. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 |
||
|
|
d84363f477 |
Python: Migrate to new Google GenAI SDK (#13371)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Closes #12970, #13352 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Migrate Google AI connector to use the new Google AI SDK. 2. This PR also marks the VertexAI connector as deprecated in favor of the Google AI connector. With this update, if users wants to connect to a VertexAI project instead of a Google AI endpoint, they can do so with the Google AI connector. 3. This PR also adds the ability for users to provide a custom client to the Google AI connector (#13352). 4. This PR also marks `AzureTextCompletion` deprecated. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 |
||
|
|
b2cceb5985 |
.Net: Update OTel GenAI operation names (#13334)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> OTel GenAI operation names have the following updates: 1. `chat.completion` to `chat` 2. `text.completion` to `text_completion` ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> This PR updates those operation names ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 |
||
|
|
1f8fea2b49 |
Python: Fix ai connector integration tests (#13311)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Vertex AI and Bedrock integration tests have been failing. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. This PR fixes the vertex ai integration tests by upgrading the Google AI SDK version. 2. This PR fixes the Bedrock integration tests by upgrading the models. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: moonbox3 <[email protected]> |
||
|
|
18d9a8e8b2 |
Python: .Net: Updated encoding logic in prompt templates (#12983)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Resolves: https://github.com/microsoft/semantic-kernel/issues/11821 Today, the encoding of template arguments is performed only if argument type is `string`. In case of custom type, anonymous type or collection - the encoding is not performed. This PR contains changes to throw an exception in case if encoding is enabled but complex type is used. In case of complex type, the encoding should be performed manually according to business logic and automatic encoding should be explicitly disabled. This enforces stricter, but more secure template rendering rules. **Note**: this is a breaking change for customers who use Handlebars or Liquid template with complex type arguments. Code changes are required when initializing template arguments: ```diff var arguments = new KernelArguments() { { "customer", new { - firstName = userInput.FirstName, - lastName = userInput.LastName, + firstName = HttpUtility.HtmlEncode(userInput.FirstName), + lastName = HttpUtility.HtmlEncode(userInput.LastName), } } }; var templateFactory = new LiquidPromptTemplateFactory(); var promptTemplateConfig = new PromptTemplateConfig() { TemplateFormat = "liquid" + InputVariables = new() + { + // We set AllowDangerouslySetContent to 'true' because each property of this argument is encoded manually. + new() { Name = "customer", AllowDangerouslySetContent = true }, + } }; var promptTemplate = templateFactory.Create(promptTemplateConfig); var renderedPrompt = await promptTemplate.RenderAsync(kernel, arguments); ``` ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 |
||
|
|
2a47ba9b7d |
Python: Removed usage of DefaultAzureCredential (#12964)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> The usage of `DefaultAzureCredential` by default is unsafe and raises security issues. Instead, users should provide their own credential types such as `AzureCliCredential`, `ManagedIdentityCredential` and so on. More information here: https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.aio?view=azure-python In this PR: 1. Removed the usage of `DefaultAzureCredential` from authentication logic. 2. Replaced `DefaultAzureCredential` with `AzureCliCredential` in all examples. **Note**: this is breaking change for Azure users, who relies on `DefaultAzureCredential`. Users will need to update the code and pass the credential type of their choice by using `credential` parameter when initializing one of the Azure clients. Before: ```python chat_completion = AzureChatCompletion() ``` After: ```python chat_completion = AzureChatCompletion(credential=AzureCliCredential()) ``` ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 |
||
|
|
30391ade09 |
Python: AzureAI Agent int test update to pass (#12849)
### Motivation and Context The AzureAI Agent code interpreter is failing when asking it to use the code interpreter to create bar charts. Updating the unit test so that it uses the code interpreter and doesn't fail/block. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Update integration test while trying to understand the root cause of the failure. <!-- 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 😄 |
||
|
|
b74ea05540 |
Python: Improve orchestration exception handling (#12716)
### 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. --> Currently, exceptions that occur inside the orchestration actors are not properly surfaced to the caller as it happens. Fixes: https://github.com/microsoft/semantic-kernel/issues/12719 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> This PR addresses the issue by introducing a new exception_callback that is hidden from the user but will raise exceptions that occurs inside the orchestration actors to the caller. ### 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 😄 |
||
|
|
003cc4c010 |
Python: Feature python vector stores preb (#12271)
### 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. --> Overhaul of the VectorStores to get it matching with dotnet and the latest development there. Closes: - #11938 - #11598 - #11597 - #11517 - #10561 - #10391 - #9911 - #9892 - #10867 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Many changes, some highlights: - Moved from different vector fields types, to a single with a enum first VectorStoreField() - Renamed several items - Made embeddinggenerrator a part of the vector field spec and do automatic vectorization from there or from the same param on a collection - Adds hybrid search using the same setup - Removed the intermediate TextSeachVectorSearch object need, by allowing `create_search_function` directly on a collection Will write out full changes in a migration guide in the docs. ### 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 😄 |
||
|
|
4b23389f71 |
Python: Emit token usage with streaming chat completion agent. (#12416)
### Motivation and Context
The chat completion agent was not emitting token using during streaming
invocation because we were only allowing through `response.items`. In
the case of token usage, `response.items` is [] and the usage is
contained as part of the message's `metadata` dict. This PR fixes that
bug and allows for `response.items or response.metadata.get("usage")`.
Two new samples are added to the concepts/agents/chat_completion dir to
show how one can track token use for streaming and non-streaming agent
invocation. Token usage handling is also added to the chat completion
agent integration tests.
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
- Fixes a bug where we weren't emitting the streaming token usage for
the chat completion agent. Also now includes the `prompt_tokens_details`
and `completion_tokens_details` models that are returned, but not
previously handled.
- Adds new samples
- Updates integration tests to track token usage and make sure they're
non-zero.
- Closes #12411
<!-- 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 😄
|
||
|
|
ff1997047d |
Python: Support Declarative Spec for OpenAIAssistantAgent & OpenAIResponsesAgent (#12247)
### Motivation and Context This PR builds on the initial work/abstractions from #11982. The `AzureAssistantAgent` / `OpenAIAssistantAgent` as well as the `AzureResponsesAgent` / `OpenAIResponsesAgent` now support declarative specs. Several examples on how to declare the spec are shown in the respective dirs in `samples/concepts/agents`, as well as a simple getting started example for each agent type. To further simplify working with these two agents, the `setup_resources()` methods for each agent type have been marked with a deprecation tag. The new method to use is `OpenAIAssistantAgent.create_client()` or `OpenAIResponsesAgent.create_client()`. Further, when one needs to access the underlying setting's, it's simple to do so with a settings object and accessing the attribute. In the previous PR for the AzureAIAgent, it lacked support for templating - this is included in this current PR. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Bring in support for the declarative single agent spec for these agent types. - Add samples - Add unit tests - Add support for prompt templates for all current agent types - Closes #11979 <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄 |
||
|
|
c64e51c40e |
Python: Update the AzureAIAgent packages, types, and APIs based on Azure SDK's new code (#12084)
### Motivation and Context The Azure AI Agent Service is moving to GA soon. As part of that, they've made several changes in the underlying APIs, which require the use of new packages, updated type imports and some new underlying APIs. This PR updates the AzureAIAgent to use the latest Azure SDK's new code. - The client's connection string has been replaced with an endpoint. - The `AzureAIAgentSettings`'s `model_deployment_name` was updated to `deployment_name`. - Tools are now imported from `from azure.ai.agents.models` instead of `from azure.ai.projects.models`. - Declarative spec handling for AzureAIAgent was updated based on the new APIs. - Unit tests were updated. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Update the AzureAIAgent related code, samples and tests based on the Azure SDK's latest APIs. - Closes #12177 <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Tao Chen <[email protected]> |
||
|
|
0634c30241 |
Python: marked planners deprecated and removed all related items (#12058)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> In line with our dotnet, marking all planners as deprecated, and removing tests and samples using them. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Evan Mattson <[email protected]> |
||
|
|
7593c91176 |
Python: Disable Milvus memory store integration tests (#11920)
### 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 Milvus memory store integration tests have been failing, blocking some PR merges. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Temporarily skipping the Milvus memory store integration test. ### 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 😄 |
||
|
|
ab53559399 |
Python: Return thread id and run id in agent response metadata (#11744)
### 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 are currently not returning the thread id and run id from the Azure AI and Assistant agents. These properties will be useful for evaluation purposes. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Return the thread id and run id in the agent response metadata. ### 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 😄 |
||
|
|
2a5fa441e8 |
Python: Add ability to clone a kernel (#11680)
### 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. --> Currently, we don't have a dedicated method to create a clone of a kernel instance. Using `model_copy(deep=True)` will result in an error because some service clients aren't serializable. Being able to clone a kernel will be critical in many scenarios where developers don't want to mutate the original one that is attached to an agent or some other objects. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Create a clone method in the `Kernel` class that will return a new instance of the kernel with the same configuration, including the list of filters, plugins and the AI selector. It will also include the same list of services references. 2. Add unit tests and integration tests to ensure the new method works as expected. ### 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 😄 |
||
|
|
da1e1e5b63 |
Python: Fix Agent StreamingTextContent Yielding and Proper Handling of FunctionCallContent/FunctionResultContent (#11563)
### Motivation and Context This PR addresses an issue where responses during the `invoke_stream` call were not being properly filtered by content type. The bug caused the system to yield responses containing non-text content (i.e., FunctionCallContent or FunctionResultContent) directly, rather than routing them through the on_intermediate_message callback for specialized handling. The fix ensures that only responses exclusively composed of StreamingTextContent are yielded, while other function-related content types are passed to the appropriate callback. Additionally, the `ChatHistoryAgentThread` id property wasn't set - it was configuring a `_thread_id`, which the base class doesn't use. <!-- 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 - Properly yield expected content type `StreamingTextContent` from an agent `invoke_stream(...)` call. Other FCC or FRC types are yielded via the `on_intermediate_message` callback. - Fix `ChatHistoryAgentThread` id bug that was setting `_thread_id` instead of `_id`. - Update integration tests to make sure we receive the expected content types during function call invocations. - Closes #11561 - Closes #11535 <!-- 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 😄 |
||
|
|
12851923bc |
Python: allow settings to be created directly (#11468)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> I've always hated having to add the .create to a settings object, this removes that, you can just use the regular init, added benefit is that it has the proper fields in the docstrings for each implemented settings object! ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Adds a __new__ method to the base settings class, which takes the prefix and if supplied the env_file and encoding, then calls model_rebuild and then the init. ### 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 😄 |
||
|
|
81e89f0c22 |
Python: Improve agent integration tests (#11475)
### Motivation and Context The current integration tests for agents work fine; however, if any errors are encountered due to server-side hiccups, the instant failure cause the whole test run to fail. This PR creates an `agent_test_base` that provides some retry logic, as well as a standardized way for agent test classes to use the underlying methods/protocol. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Improve the agent integration tests. - The OpenAI Responses API is throwing 500s for file search right now. Adding `xfail` for the time being. Filed an [issue](https://github.com/openai/openai-python/issues/2298) on them. - Handle errors when calling for a response for the OpenAI Responses API -- throw a specific agent except or content exception, if received from Azure OpenAI. - Removed the `OpenAIResponsesAgent` `invoke` and `invoke_stream` web_search tests. We have coverage for `get_responses`. The web search is flaky sometimes. <!-- 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 😄 |
||
|
|
6551a860c7 |
Python: Add ChatCompletionAgent integration tests (#11430)
### Motivation and Context Add ChatCompletionAgent integration tests. The last set of agent integration tests that aren't available right now. Additionally, as part of creating the tests, it was discovered that we're yielding FunctionCallContent and FunctionResultContent, when we shouldn't be. To handle those content types, one needs to use the `on_intermediate_message` callback. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Adds ChatCompletionAgent integration tests. - Fix Responses Agent thread get_messages method to properly return input messages from the API. <!-- 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 😄 |
||
|
|
0ff97c7fe7 |
Python: add AzureAIAgent, OpenAIAssistant and OpenAIResponsesAgent Integration tests, AzureAIAgent FCC gen bug fix (#11394)
### Motivation and Context AzureAIAgents, OpenAIAssistantAgents, and OpenAIResponsesAgents previously were not covered by integration tests. Adding a set of integration tests to cover high-level usage of an AzureAIAgent and OpenAIAssistantAgents for `get_response`, `invoke`, and `invoke_stream`. As part of this work, a previous fix to typing caused a regression while generating FunctionCallContent for an AzureAIAgent. Fixing to use the correct instance check. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Adds integration tests for AzureAIAgent and OpenAIAssistantAgent. - Fixes #11393 - Bump version to 1.27.2 for bug fix release. - Remove unnecessary yield for function result content during streaming invocation - these types will be added if the `on_intermediate_message` callback is provided. <!-- 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 😄 |
||
|
|
94a78d15e2 |
Python: Add on_intermediate_message callback to the Agent abstraction (#11321)
### 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. --> Currently, our agents' `invoke` and `invoke_stream` have inconsistent behavior where the responses may contain different contents. For example, the chat completion agent (`invoke`) may return all content types generated by the agent including function call/result contents that are meant to be internal only, while the assistant agent doesn't return those contents. This creates confusion both for users and developers of SK of what an agent should return when working with agents. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> This PR standardizes the behavior of agents by adding an `on_intermediate_message ` parameter to the `invoke` and `invoke_stream` methods in the `Agent` abstraction. This parameter accepts a callback function that will be called whenever a new message is generated by the agent, except the last one that gets returned to the caller. This allows the caller to inspect what the agent did after a response is returned. In addition, this PR also converges on the behavior of the `invoke` and `invoke_stream` methods (respectively) to return the same content types from all agents, making it easier for users to work with agents ### 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 😄 |
||
|
|
f00dc80267 |
Python: Introducing support for using a MCP server as a plugin (#11334)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Adds MCP server configs and a function that turns the server into a plugin, with each tools of the server represented as a function. Adds a sample showing how to use that with a Github MCP server. Closes: #10785 and #11190 With special thanks to @nmoeller ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Nico Möller <[email protected]> |
||
|
|
a52d47e22f |
Python: restructed data folder and multiple improvements to vector stores (#11302)
### 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: - restructures the data folder, flattening the hierarchy - it adds overloads to the Get, Upsert, Delete methods, to allow batch as well, marks the batch versions as deprecated, closes #11301 - restructured the inheritance of VectorStoreRecordCollection, which now has a base that does record handling, which is shared with the VectorSearchBase for the serialization, and the search method mixins now subclass the VectorSearchBase so that there is one less parent direct parent, a full Collection will now inherit from VectorStoreRecordCollection and zero or more VectorSearch mixins, this is done to clean things up and in preparation of adding HybridSearch. - Also adds a convenience method to each search mixin to create a VectorStoreTextSearch directly, allowing folks to import one less concept, closes #11111 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Most of the code has been moved out of many files and folders, into a few files which make purpose and collaboration between the classes easier to understand. This is a breaking change: If you have implemented your own VectorStoreRecordCollection, make sure to: - Add `VectorStoreRecordCollection[TKey, TModel]` as superclass to the implementation - Remove `VectorSearchBase` as superclass from implementation - Set the SearchMixins to `[TKey, TModel]` instead of just `[TModel]` ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Evan Mattson <[email protected]> |
||
|
|
17e63a782b |
Python/.NET: Add a common agent invoke api. (#11116)
### Motivation and Context Being able to different invoke agents using a common API is useful to build higher level code on top of. ### Description Adding a common Invoke method with a common Thread object. ### 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: Ben Thomas <[email protected]> Co-authored-by: Evan Mattson <[email protected]> Co-authored-by: Tao Chen <[email protected]> Co-authored-by: Ben Thomas <[email protected]> Co-authored-by: Mark Wallace <[email protected]> Co-authored-by: Evan Mattson <[email protected]> |
||
|
|
acf5156848 |
Python: Introducing the Pinecone Connector (#10886)
### 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. --> Introducing the Pinecone Vector Store and Collection This also upgrades the dependencies to v6 Adding the ability to run with asyncio or GRPC TODO: - [x] Filtering - [x] Tests ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Adds PineconeStore and PineconeCollection Closes: #9928 ### 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 😄 |
||
|
|
191f595f7d |
Python: Remove custom separator in Bedrock tool call fully qualified name (#10826)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Closes #10619 Bedrock updated its rules on tool names. Previously, Bedrock disallowed "-" in tool names, which is the default plugin name and function name separator in SK. The solution was to use "_" as the separator. However, this introduced a bug where the translation between the SK fully qualified function names and the Bedrock tool names would fail if the function name had an underscore. Bedrock now allows "-" in tool names, so we can remove the custom logic and just use the default. Gemini also has rules on how tools are named. It doesn't recommend using "-". The solution was to use "_" just like Bedrock. To address the bug mentioned above, the solution is to use double underscores. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Remove Bedrock custom fully qualified function names. 2. Use double underscores for Gemini fully qualified function names. TODO: Add a guide for SK function/plugin naming conventions. ### 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 😄 |
||
|
|
e1184aea74 |
Python: Add embedding and text completion samples (#10797)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Closing https://github.com/microsoft/semantic-kernel/issues/9963 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Add text embedding and text completion samples. 2. Move the embedding generator base to a `semantic_kernel.connectors.ai`. ### 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 😄 |
||
|
|
e7beb6a143 |
Python: Update Cross Language Test to get raw request and now raw response (#10799)
### Motivation and Context In our cross language tests we were getting the raw request using a custom logging transport class. This didn't show how to get the raw HTTP response back after making the call to the OpenAI SDK. <!-- 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 cross language test to get the raw request and now the raw response. <!-- 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 😄 |
||
|
|
8fd6da2bd8 |
Python: Improve Bedrock service setup docs (#10772)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Closing: https://github.com/microsoft/semantic-kernel/issues/9910 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Add detailed instructions on how to setup one's environment to use Bedrock services, including models and agents. 2. Re-enable bedrock integration tests. 3. Some other cleanups. ### 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 😄 |
||
|
|
75453a1219 |
Python: Move to a thinner wrap for Bedrock Agent in Python (#10740)
### 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. --> Though the current Bedrock agent implementation uses a "thin wrap" approach, it still has some abstractions that we don't want to maintain. Just like what we have done for the other agents, we remove those abstractions. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Update the Bedrock agent abstraction to be thinner. 2. Update samples and tests. Note: The .Net implementation doesn't need to be updated as it was already using a thinner wrap. Note: This breaks the current usage pattern for Bedrock agents in Python. ### 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 😄 |
||
|
|
16d48bbe0b |
Python: lazy create stores in integration tests (#10705)
### 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. --> Moved the import and creation of the store into methods that get called when accessed only. ### 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 😄 |
||
|
|
536edaa585 |
Python: Introducing the Chroma Connector with the new vector store design (#10678)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Adds ChromaStore and ChromaConnector Closes: #9926 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Tao Chen <[email protected]> |
||
|
|
7bdf55028c |
Python: experimental py3.13 support (#10276)
### 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. --> Some small fixes in uv setup within actions Added experimental unit tests runs for py3.13 First typing improvement from pyright and pyright config. ### 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 😄 |
||
|
|
ce6002d9d2 |
Python: Add Bedrock agent integration tests (#10400)
### 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. --> Integration tests for Bedrock agents in Python ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Add integration tests for Bedrock agent integration in `python/tests/integration/agents/bedrock_agent`. 2. Restructure the agent concept samples folder. ### 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 😄 --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/semantic-kernel/pull/10400?shareId=42d1f5cd-0a90-48c3-810f-bb2a6744026e). |
||
|
|
3724e245be |
Python: Add vector search to Postgres connector (#10213)
### Motivation and Context Following up on #8951, this PR adds an implementation of `VectorSearchBase` to `PostgresCollection`. This implementation provides vectorized search and does not implement text search or vectorizable text search. Unit and integration tests are added, and the `python/samples/getting_started/third_party/postgres-memory.ipynb` notebook was expanded to include vector search in the example. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 |
||
|
|
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 😄 |
||
|
|
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]> |
||
|
|
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 😄 |
||
|
|
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 😄 |
||
|
|
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 😄 |
||
|
|
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 😄 |
||
|
|
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 😄 |
||
|
|
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 😄 |
||
|
|
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 😄 |