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

TypeError: argument of type 'Part' is not iterable #274

Closed
Trishanu123 opened this issue Sep 7, 2024 · 4 comments
Closed

TypeError: argument of type 'Part' is not iterable #274

Trishanu123 opened this issue Sep 7, 2024 · 4 comments
Assignees
Labels
component:other Issues unrelated to examples/quickstarts status:awaiting response Awaiting a response from the author status:stale Issue/PR is marked for closure due to inactivity type:help Support-related issues

Comments

@Trishanu123
Copy link

Description of the bug:

I am getting a error of "Part" when i try running the code.

Actual vs expected behavior:

import google.generativeai as genai
import os

genai.configure(api_key=os.environ["API_KEY"])
model = genai.GenerativeModel('gemini-1.0-pro-latest')
response = model.generate_content("The opposite of hot is")
print(response.text)

Above is the code I am trying to run. But it's throwing me a error "TypeError: argument of type 'Part' is not iterable"

Any other information you'd like to share?

No response

@gmKeshari
Copy link

Hi @Trishanu123. I replicated the same code in colab, it is not throwing any error. Can you try the notebook below (Save your api in colab secrets as "GeminiAPI") :

https://colab.sandbox.google.com/gist/gmKeshari/098b50f1c17fc794e05541d2d9e7c8a7/try_errors.ipynb

Also, I tried with your exact same code, it's working. If it's not working for you then try to upgrade google-generativeai using below command :

pip install --upgrade google-generativeai

Hope, this will resolve your issue.

@gmKeshari gmKeshari self-assigned this Sep 9, 2024
@gmKeshari gmKeshari added status:awaiting response Awaiting a response from the author type:help Support-related issues component:other Issues unrelated to examples/quickstarts labels Sep 9, 2024
@Alexisloyolamend3z
Copy link

Hola

Copy link

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

@github-actions github-actions bot added the status:stale Issue/PR is marked for closure due to inactivity label Sep 25, 2024
Copy link

github-actions bot commented Oct 8, 2024

This issue was closed because it has been inactive for 27 days. Please post a new issue if you need further assistance. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:other Issues unrelated to examples/quickstarts status:awaiting response Awaiting a response from the author status:stale Issue/PR is marked for closure due to inactivity type:help Support-related issues
Projects
None yet
Development

No branches or pull requests

3 participants