You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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
0 commit comments