mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context There were changes made to the ACA upload file API that weren't made in the Python SDK. This caused the file upload to error out. The ACA team also passed along their docs and advice to update to a certain API version, and what changes that brings. <!-- 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 #6494 Closes #6509 - Properly handle the file upload's response body as it now contains a `$values` attribute and then a list of key-value pairs. - Also properly construct the `remote_file_path` by checking if it includes `/mnt/data/` and if not, appending it to the front of the `remote_file_path`. - Update to use ACA API version 2024-02-02. This means the API version needs to be included with all requests. Adding API version to requests, and adding session ID to all requests. - Removed the ability to pass in a BufferedReader to the upload file function since the LLM doesn't know how to handle that. As is done in dotnet, allow the user to specify a local_file_path which the model can handle, to upload a file. - Update unit tests <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄