Skip to content

[Bug]: gemini-2.5-flash ERROR: argument of type 'NoneType' is not iterable #10933

@taoari

Description

@taoari

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (Language Policy).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

RAGFlow workspace code commit ID

v0.21.1

RAGFlow image version

v0.21.1

Other environment information

Actual behavior

Gemini model does not work with ERROR: argument of type 'NoneType' is not iterable

ragflow-server | Traceback (most recent call last):
ragflow-server | File "/ragflow/api/apps/conversation_app.py", line 223, in stream
ragflow-server | for ans in chat(dia, msg, True, **req):
ragflow-server | File "/ragflow/api/db/services/dialog_service.py", line 598, in chat
ragflow-server | for ans in chat_mdl.chat_streamly(prompt + prompt4citation, msg[1:], gen_conf):
ragflow-server | File "/ragflow/api/db/services/llm_service.py", line 255, in chat_streamly
ragflow-server | for txt in chat_partial(**use_kwargs):
ragflow-server | File "/ragflow/rag/llm/cv_model.py", line 673, in chat_streamly
ragflow-server | yield total_token_count_from_response(response)
ragflow-server | File "/ragflow/rag/utils/init.py", line 61, in total_token_count_from_response
ragflow-server | if 'usage' in resp and 'total_tokens' in resp['usage']:

Expected behavior

No response

Steps to reproduce

Add Gemini models with API key, and try in chat

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working, pull request that fix bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions