fix: vertex thinkingbudget in name - #1251
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Adaptor
Caller->>Adaptor: Init(UpstreamModelName)
Adaptor->>Adaptor: switch on UpstreamModelName prefix/substring
Adaptor-->>Caller: Set RequestMode or error
Caller->>Adaptor: GetRequestURL(OriginModelName, UpstreamModelName)
alt UpstreamModelName contains "-thinking-"
Adaptor->>Adaptor: Split UpstreamModelName at "-thinking-"
Adaptor->>Adaptor: Use first segment as UpstreamModelName
else UpstreamModelName ends with "-thinking"
Adaptor->>Adaptor: Trim "-thinking" suffix
else UpstreamModelName ends with "-nothinking"
Adaptor->>Adaptor: Trim "-nothinking" suffix
end
Adaptor->>Adaptor: switch on RequestMode
alt RequestModeClaude and Region == "global"
Adaptor->>Adaptor: Build special global Claude URL
else
Adaptor->>Adaptor: Build URL based on mode
end
Adaptor-->>Caller: Return URL or error
Caller->>Adaptor: ConvertOpenAIRequest(request)
Adaptor->>Adaptor: switch on RequestMode to convert request or return error
Adaptor-->>Caller: Converted request or error
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🪛 golangci-lint (1.64.8)relay/channel/vertex/adaptor.go154-154: expected '}', found 'default' (typecheck) 🔇 Additional comments (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
relay/channel/vertex/adaptor.go (2)
86-94: Consider extracting the “thinking-suffix” trimming into a shared helper
relay/channel/gemini/adaptor.goand this file now share identical suffix-stripping logic.
Duplicating this code in multiple adaptors invites divergence and makes future fixes harder. A small utility (e.g.relay/common/modelname.TrimThinkingSuffix(...)) would centralise the behaviour and unit tests.This refactor can be done separately but is strongly recommended.
86-87: Non-English inline commentThe codebase appears predominantly English; keeping comments consistent aids readability for all contributors.
- // 与relay/channel/gemini/adaptor.go 中的逻辑保持一致 + // Keep logic consistent with relay/channel/gemini/adaptor.go
b1602c3 to
615b804
Compare
之前适配的时候忘了移除vertex渠道发送的后缀
Summary by CodeRabbit