Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] feat: AssistantsPlanner file upload and download support #1945

Merged
merged 22 commits into from
Sep 9, 2024

Conversation

singhk97
Copy link
Collaborator

@singhk97 singhk97 commented Aug 23, 2024

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

  • 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

@singhk97 singhk97 changed the title [C#] feat: AssistantsPlanner file upload and download support [WIP] [C#] feat: AssistantsPlanner file upload and download support Aug 23, 2024
@singhk97 singhk97 changed the title [WIP] [C#] feat: AssistantsPlanner file upload and download support [C#] feat: AssistantsPlanner file upload and download support Aug 26, 2024
@corinagum corinagum merged commit dc986b5 into main Sep 9, 2024
16 checks passed
@corinagum corinagum deleted the kavin/c#-assistants-file-upload-download branch September 9, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat]: Add file upload and download support for AssistantsPlanner
3 participants