Python: Update sessions python plugin to work with the correct endpoints
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.
- 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 #6934
Contribution Checklist
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone :smile:
Python 3.10 Test Coverage Report •
File Stmts Miss Cover Missing semantic_kernel/core_plugins/sessions_python_tool sessions_python_plugin.py 122 10 92% 116, 236–238, 270–272, 317–319 TOTAL 6519 763 88%
Python 3.10 Unit Test Overview
| Tests | Skipped | Failures | Errors | Time |
|---|---|---|---|---|
| 1558 | 1 :zzz: | 0 :x: | 0 :fire: | 24.498s :stopwatch: |