Repository navigation
feat: add GiteeAI provider support to Go API server - #15131
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughUpdates the Gitee provider config to set ChangesGitee Configuration Updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/entity/models/giteeai_test.go`:
- Around line 107-110: The handler in the test uses t.Fatalf inside the httptest
server goroutine when checking messages (the block that inspects
body["messages"] and the variable messages), which can abort only that
goroutine; change the t.Fatalf to t.Errorf and immediately return from the
handler so the parent test is reliably marked failed—i.e., in the handler that
parses body["messages"] and sets messages, replace t.Fatalf("messages=%v",
body["messages"]) with t.Errorf("messages=%v", body["messages"]) followed by
return.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8297c81d-fa9b-4a2d-83ae-8fd506334088
📒 Files selected for processing (4)
conf/models/giteeai.jsoninternal/entity/models/factory.gointernal/entity/models/giteeai.gointernal/entity/models/giteeai_test.go
|
Hi @Helios531, As far as I know, I suggest: "url": {
"default": "https://api.moark.ai/v1",
"china": "https://api.moark.com/v1",
"deprecated": "https://ai.gitee.com/v1"
}, |
|
hi, @Haruko386, can you review again, plz. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15131 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What problem does this PR solve?
Closes #15090.
Adds GiteeAI support to the Go model-provider layer so GiteeAI chat models can be routed through the Go API server using the same OpenAI-compatible chat, streaming, model listing, and connection-check flow used by other SaaS providers.
GiteeAI is implemented as a separate provider from the existing
giteeprovider.Type of change
Summary
https://ai.gitee.com/v1.giteeaiin the model factory separately fromgitee.[DONE]handling, and unsupported methods.What changed
ChatWithMessagesforPOST /chat/completions.ChatStreamlyWithSenderwith SSE parsing,deltaextraction,finish_reason,[DONE], and<think>tag handling.ListModelsforGET /models.CheckConnectionby delegating toListModels.no such methoderrors for unsupported embedding, rerank, image-to-text, ASR, and TTS paths.Tests