Skip to content

fix : fix submodel adapter - #1919

Merged
seefs001 merged 1 commit into
QuantumNous:alphafrom
seefs001:fix/submodel
Sep 29, 2025
Merged

fix : fix submodel adapter#1919
seefs001 merged 1 commit into
QuantumNous:alphafrom
seefs001:fix/submodel

Conversation

@seefs001

@seefs001 seefs001 commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Corrected request routing to use the channel-specific base URL, improving stability and preventing misrouted or failing calls in certain configurations.
  • Chores

    • Introduced explicit handling for Gemini chat requests, returning a clear “not supported” error to users until the endpoint is available, ensuring predictable behavior and clearer feedback.

@coderabbitai

coderabbitai Bot commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a new Adaptor method ConvertGeminiRequest that returns a not-supported error and modifies GetRequestURL to reference info.ChannelBaseUrl instead of info.BaseUrl. Both changes are confined to relay/channel/submodel/adaptor.go.

Changes

Cohort / File(s) Summary of Changes
Adaptor updates
relay/channel/submodel/adaptor.go
- Added ConvertGeminiRequest(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest) (any, error) returning a not-supported error
- Updated GetRequestURL to use info.ChannelBaseUrl instead of info.BaseUrl

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant Adaptor
  note over Client,Adaptor: Gemini request conversion flow (new method)
  Client->>Adaptor: ConvertGeminiRequest(ctx, info, geminiReq)
  Adaptor-->>Client: error "not supported"
  note over Adaptor: Endpoint not implemented
Loading
sequenceDiagram
  autonumber
  actor Caller
  participant Adaptor
  participant RelayInfo as RelayInfo (info)
  note over Caller,Adaptor: Request URL resolution (modified)
  Caller->>Adaptor: GetRequestURL(info)
  Adaptor->>RelayInfo: read ChannelBaseUrl
  Adaptor-->>Caller: URL built from info.ChannelBaseUrl
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I thump my paws on cables bright,
A stub today, no Gemini flight—
New paths point where channels lead,
BaseUrl swapped for Channel’s seed.
Soon I’ll hop from star to star,
For now: “Not yet!” from this bazaar. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83b2b07 and 76180b1.

📒 Files selected for processing (1)
  • relay/channel/submodel/adaptor.go (2 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seefs001
seefs001 merged commit 25a3896 into QuantumNous:alpha Sep 29, 2025
1 check was pending
@coderabbitai coderabbitai Bot mentioned this pull request Sep 30, 2025
x22x22 pushed a commit to x22x22/new-api that referenced this pull request Apr 24, 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.

1 participant