feat: enable thinking mode on ali thinking model - #1519
Conversation
WalkthroughThe changes introduce dynamic handling for the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AliAdaptor
participant RelayInfo
Client->>AliAdaptor: ConvertOpenAIRequest(request)
AliAdaptor->>AliAdaptor: Check if model contains "thinking"
alt Model contains "thinking"
AliAdaptor->>AliAdaptor: Set EnableThinking = true
AliAdaptor->>AliAdaptor: Set Stream = true, info.IsStream = true
else Model does not contain "thinking"
AliAdaptor->>AliAdaptor: Normal logic
end
AliAdaptor->>RelayInfo: GenRelayInfo(ctx)
RelayInfo->>RelayInfo: If startTime == 0, set to time.Now()
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: claude models handle "-thinking" variants differently from gemini models. for claude models, only th...Applied to files:
📚 Learning: in relay/channel/gemini/relay-gemini.go, the thinking budget calculation logic (including the maxout...Applied to files:
📚 Learning: gin.context implements context.context interface since gin v1.8.0, providing the methods deadline(),...Applied to files:
🔇 Additional comments (4)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
希望能支持魔搭渠道的qwen3-thinking模型,魔搭渠道的设置和阿里是一样的,但是不能用阿里的供应商设置魔搭的地址,所以有一样的问题 |
…nking-test feat: enable thinking mode on ali thinking model
渠道测试支持qwen3-thinking模型
docs: https://bailian.console.aliyun.com/?tab=api#/api/?type=model&url=2712216
qwen3-thinking需要EnableThinking, 并且支持流模式
否则报错: InternalError.Algo.InvalidParameter: The value of the enable_thinking parameter is restricted to True.
修复前:


修复后:
Summary by CodeRabbit
Bug Fixes
New Features