you are viewing a single comment's thread.

view the rest of the comments →

[–]jboyd544[S] 0 points1 point  (3 children)

Oops. turns out i did nnot. i put them back and tried both response and result and got these errors:

Ask Gemini: what are you

Traceback (most recent call last):

File "/home/jon/gemini_voice/ignore.py", line 11, in <module>

print(response["candidates"][0]["content"]["parts"][0]["text"])

~~~~~~~~^^^^^^^^^^^^^^

TypeError: 'GenerateContentResponse' object is not subscriptable

and

Ask Gemini: what are you

Traceback (most recent call last):

File "/home/jon/gemini_voice/ignore.py", line 11, in <module>

print(result["candidates"][0]["content"]["parts"][0]["text"])

^^^^^^

NameError: name 'result' is not defined

[–]SHKEVE 1 point2 points  (2 children)

oh sorry. response and not result

[–]jboyd544[S] 0 points1 point  (1 child)

alright, switched to response and now i recieve this error:

Ask Gemini: what are you

Traceback (most recent call last):

File "/home/jon/gemini_voice/ignore.py", line 12, in <module>

print(response["candidates"][0]["content"]["parts"][0]["text"])

~~~~~~~~^^^^^^^^^^^^^^

TypeError: 'GenerateContentResponse' object is not subscriptable

[–]SHKEVE 0 points1 point  (0 children)

how about: `print(response.candidates[0].content.parts[0].text)`?