microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
401 stars 172 forks source link

[Feature request]: TeamsAttachmentDownloader cannot download file attachments and audios. #1202

Open XiaofuHuang opened 7 months ago

XiaofuHuang commented 7 months ago

Language

Javascript/Typescript

Version

latest

Description

There are a lot of kinds of attachments in Teams. For example:

  1. Inline image: copy and paste directly into the send box image
  2. Attachment Files: upload via the "Upload from this device" menu or through drag-and-drop actions. image
  3. Voice: Recorded on Teams mobile by pressing a microphone icon button. image ......

Currently, TeamsAttachmentDownloader in teams-ai SDK only supports the download of inline images.

https://github.com/microsoft/teams-ai/blob/913423b84528e30749f03805459546e29b0e292d/js/packages/teams-ai/src/TeamsAttachmentDownloader.ts#L76 The TeamsAttachmentDownloader relies on the contentUrl to download files. But it doesn't work for attachment files.

Can TeamsAttachmentDownloader be extended to support the download of other attachment types?

Reproduction Steps

1. Upload file in Teams
2. The `teams-ai` SDK throw an error
Stevenic commented 7 months ago

Yeah I only implemented images because that’s all that OpenAI supports. Adding support for any type of attachment was what I envisioned I just ran out of time.