Skip to content

Conversation

@moonbox3
Copy link
Collaborator

@moonbox3 moonbox3 commented Jul 2, 2024

Motivation and Context

The Sessions Python Plugin was working properly, but some users reported that the endpoints needed updating. We had made previous updates to the plugin, but they didn't account for the update API endpoints and request body changes shown here.

Description

This PR updates the plugin tool to work with the documented endpoints and request bodies. The unit tests were also updated. The concept sample for the Azure Python sessions plugin was tested with all methods to: execute code, upload multiple files, list files, and download them.

Contribution Checklist

@moonbox3 moonbox3 requested a review from a team as a code owner July 2, 2024 23:57
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Jul 2, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jul 2, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/core_plugins/sessions_python_tool
   sessions_python_plugin.py1221092%116, 236–238, 270–272, 317–319
TOTAL651976388% 

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1558 1 💤 0 ❌ 0 🔥 24.498s ⏱️

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of missing raise froms, otherwise good to go

@moonbox3 moonbox3 requested a review from eavanvalkenburg July 3, 2024 13:28
@moonbox3 moonbox3 enabled auto-merge July 3, 2024 14:38
@moonbox3 moonbox3 added this pull request to the merge queue Jul 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 4, 2024
@moonbox3 moonbox3 enabled auto-merge July 4, 2024 11:37
@moonbox3 moonbox3 added this pull request to the merge queue Jul 4, 2024
Merged via the queue into microsoft:main with commit 007e3da Jul 4, 2024
@moonbox3 moonbox3 deleted the fix_sessions_tool branch July 4, 2024 12:02
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
…nts (microsoft#7070)

### Motivation and Context

The Sessions Python Plugin was working properly, but some users reported
that the endpoints needed updating. We had made previous updates to the
plugin, but they didn't account for the update API endpoints and request
body changes shown
[here](https://learn.microsoft.com/en-us/azure/container-apps/sessions-code-interpreter).

<!-- 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 plugin tool to work with the documented endpoints
and request bodies. The unit tests were also updated. The concept sample
for the Azure Python sessions plugin was tested with all methods to:
execute code, upload multiple files, list files, and download them.
- Additionally, improve error handling for each of the function calls so
the proper error message is surfaced to the user via SK exceptions.
- Fix path building and making sure the sessions endpoint is converted
to a string from the Pydantic https type.
- Closes microsoft#6934 

<!-- 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 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Python: Bug: ‎Python's SessionsPythonTool is using wrong REST data and endpoints for Azure Container Apps Sessions

4 participants