diff --git a/astrbot/core/provider/sources/openai_source.py b/astrbot/core/provider/sources/openai_source.py index 6e79cba61..83e696b91 100644 --- a/astrbot/core/provider/sources/openai_source.py +++ b/astrbot/core/provider/sources/openai_source.py @@ -1012,7 +1012,9 @@ class ProviderOpenAIOfficial(Provider): for part in message["content"]: if part.get("type") == "think": reasoning_content_present = True - reasoning_content += str(part.get("think")) + reasoning_content = (reasoning_content or "") + str( + part.get("think") + ) else: new_content.append(part) # Some providers (Grok, etc.) reject empty content lists.