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

This response is not simple text.Use the result.parts accessor or the full result.candidates[index].content.parts lookup instead. #8

Open
whmc76 opened this issue Jan 22, 2024 · 4 comments

Comments

@whmc76
Copy link

whmc76 commented Jan 22, 2024

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\execution.py", line 155, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\execution.py", line 85, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\execution.py", line 78, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Gemini\GeminiAPINode.py", line 92, in generate_content
textoutput = response.text
^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai\types\generation_types.py", line 328, in text
raise ValueError(
ValueError: The response.text quick accessor only works for simple (single-Part) text responses. This response is not simple text.Use the result.parts accessor or the full result.candidates[index].content.parts lookup instead.

@jags111
Copy link

jags111 commented Jan 23, 2024

I am having same issue and any recommendations for same. Please advise.. or is some thing changed in the workflow when using the text prompt outputs

@whmc76
Copy link
Author

whmc76 commented Jan 23, 2024

Maybe it's because of the long input? I reduced the length of the input text and it can be used, but I still want to be unrestricted, after all, it seems that the api supports it.

I am having same issue and any recommendations for same. Please advise.. or is some thing changed in the workflow when using the text prompt outputs

@jags111
Copy link

jags111 commented Jan 23, 2024

got it to work with changed input params or prompts

@OliverCrosby
Copy link

What did you have to change?

I wonder if the error is because sometimes gemini thinks you're asking it to generate an image, which it would do instead of returning with text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants