Skip to content

Commit

Permalink
[PY] fix: Remove unpacking to list for file downloads (#1851)
Browse files Browse the repository at this point in the history
## Linked issues

closes: #1852

## Details

Unpacking doesn't work for array.append. Which means that for non-single
files, input_files.append(*files) fails with:
`on_turn_error] unhandled error: list.append() takes exactly one
argument (0 given)`

Here we append file-by-file

#### Change details

> Describe your changes, with screenshots and code snippets as
appropriate

**code snippets**:

**screenshots**:

## 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
  • Loading branch information
heyitsaamir authored Jul 17, 2024
1 parent 665c720 commit 1282a07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/packages/ai/teams/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ async def _handle_file_downloads(self, context: TurnContext, state):
input_files = state.temp.input_files if state.temp.input_files else []
for file_downloader in self._options.file_downloaders:
files = await file_downloader.download_files(context)
input_files.append(*files)
input_files.extend(files)
state.temp.input_files = input_files

async def _run_ai_chain(self, context: TurnContext, state):
Expand Down

0 comments on commit 1282a07

Please sign in to comment.