Skip to content

fix: handle both reasoning_content and reasoning attributes#410

Closed
majiayu000 wants to merge 2 commits intomindverse:developfrom
majiayu000:fix/reasoning-content-attribute
Closed

fix: handle both reasoning_content and reasoning attributes#410
majiayu000 wants to merge 2 commits intomindverse:developfrom
majiayu000:fix/reasoning-content-attribute

Conversation

@majiayu000
Copy link
Copy Markdown

Summary

Fix AttributeError: 'ChatCompletionMessage' object has no attribute 'reasoning_content' when using DeepSeek R1 API.

Changes

  • Use getattr() with fallback to handle both reasoning_content and reasoning attribute names
  • Applied to 3 files: selfqa_generator.py, preference_QA_generate.py, diversity_data_generator.py

Related Issues

Fixes #370, #327

Signed-off-by: majiayu000 1835304752@qq.com

yingapple and others added 2 commits September 19, 2025 11:31
Fix AttributeError when using DeepSeek R1 API which returns
'reasoning' attribute instead of 'reasoning_content'.

Use getattr with fallback to support both attribute names for
backward compatibility with different API versions.

Fixes mindverse#370, mindverse#327

Signed-off-by: majiayu000 <1835304752@qq.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 4, 2026

CLA assistant check
All committers have signed the CLA.

@majiayu000
Copy link
Copy Markdown
Author

Closing this PR due to extended inactivity. Happy to reopen if there's still interest — feel free to comment.

@majiayu000 majiayu000 closed this Mar 20, 2026
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

Successfully merging this pull request may close these issues.

3 participants