googleapis / googleapis/python-genai

Unrelated error shown when trying to use a reversed content list

Aperta
#1,272 10 commenti 0 reazioni 1 assegnatario Rivendicata da @Venkaiahbabuneelam Vedi su GitHub
priority: p3 type: bug
Lingua principale
Python
Stelle
4k
Fork
1k
Merge medio
2g 12h
PR unite (30g)
41

Descrizione

#### Environment details

- Programming language: Python
- OS: Linux
- Language runtime version: 3.12.3
- Package version: google-genai[aiohttp] 1.30.0

#### Steps to reproduce

1. Create a list of `Content`.
2. Reverse the list with `contents = reversed(contents)`.
3. Pass the reversed contents to `models.generate_content(...)`.

I've gotten the errors `ValueError: file uri and mime_type are required.` and `ValueError: contents are required.` when doing this, when the actual error is that `models.generate_content(...)` apparently doesn't support a `list_reverseiterator` object. Using `contents = list(reversed(contents))` fixed the issue.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.