-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C#] feat:
AssistantsPlanner
file upload and download support (#1945)
## Linked issues fixes #1919 ## Details * `AssistantsPlanner` now supports passing in attached files and images within the user message. Files will be uploaded through the OpenAI/Azure OpenAI `Files` API and the `file_id` is attached to the message. * `AssistantsPlanner` now supports downloading files and images generated in a single run. Only image files are attached to the outgoing activity as a list of `Attachments` in the `PredictedSayCommand` default action. #### Change details * Created an `AssistantsMessage` class that extends `ChatMessage`. It stores a single `MessageContent` and files generated with in it in the `AttachedFiles` property. * Added a `FileClient` field to the `AssistantsPlanner`. It wraps around the `Files` api. * Added `FileName` field in `InputFile.cs` class. A filename is required to upload a file to `Files` api. **Samples Updates** * `OrderBot` is now configured with the `file_search` tool. A vector store is created, and the `menu.pdf` file is uploaded to it and the store is attached to the assistant on creation. Users can ask for the menu items or prices and the assistant will be using the `file_search` tool under the hood to get that information. * `MathBot` has no updates - but it can be used to get the assistant to generate a png image of a graph. ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
- Loading branch information
Showing
16 changed files
with
463 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.