Open
Conversation
- Uncomment thinking control code in doubao_cache_llm.py - Add thinking_enabled config field (default: false) in env.py - Pass CONFIG.thinking_enabled through llm_complete() call chain - Add thinking_enable param to openai_model_llm.py to prevent errors Usage: set `thinking_enabled: true/false` in config.yaml or env var `MEMOBASE_THINKING_ENABLED=true/false` Co-Authored-By: Claude Opus 4.6 <[email protected]>
…tions context.completions.create is a separate Volcengine API that may not support the thinking parameter. Passing it could cause API errors on the primary cached-context path which Memobase uses most frequently. Split thinking_kwargs out so it only applies to chat.completions.create calls, leaving context.completions.create unaffected. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…Scope)
For DashScope/Qwen3 models, disable thinking via
extra_body={"enable_thinking": False}, which is the DashScope
native format for controlling deep thinking mode.
This ensures thinking can be disabled regardless of llm_style:
- doubao_cache: kwargs["thinking"] = {"type": "disabled"}
- openai: extra_body={"enable_thinking": False}
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- None (default): don't interfere, let API use its own default - True: explicitly enable thinking - False: explicitly disable thinking This is model-agnostic: works for any provider without hardcoding model names. Only injects thinking params when user explicitly configures thinking_enabled in config.yaml. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Both doubao_cache_complete() and openai_complete() now default thinking_enable=None, matching CONFIG.thinking_enabled=None. Prevents inconsistent behavior if functions are called directly without the thinking_enable argument. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
added 2 commits
April 14, 2026 20:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thinking_enabledconfig option (Optional[bool]) to control LLM thinking mode viaconfig.yamlnull= no intervention (API default),true= enable,false= disablechat.completionsonly) and OpenAI-compatible providers (DashScope/Qwen viaextra_body.enable_thinking)Changes
env.py: Addthinking_enabled: Optional[bool] = Noneconfig fieldllms/__init__.py: PassCONFIG.thinking_enabledto LLM factory callsdoubao_cache_llm.py: Injectthinkingparam only forchat.completions, skipcontext.completionsopenai_model_llm.py: Injectextra_body.enable_thinkingfor DashScope/QwenTest plan
thinking_enabled: null— API uses default behaviorthinking_enabled: true— thinking enabledthinking_enabled: false— thinking disabledcontext.completionspath does not receive thinking param