feat(provider): add modelscope#81
Conversation
📝 WalkthroughWalkthroughThis PR adds support for two new OpenAI-compatible providers: ModelScope (global) and ModelScope (CN). Changes include schema updates, Rust configuration entities, a new provider module with metadata and authentication, proxy request handling, and UI translations and type definitions. ChangesModelScope Provider Addition
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/gateway/providers/modelscope.rs (1)
22-45: ⚡ Quick winAdd item-level rustdoc for newly exported provider symbols.
The new public constants/structs are exported but currently undocumented. Please add
///docs forIDENTIFIER,CN_IDENTIFIER,ModelScopeProviderConfig,ModelScopeCnProviderConfig,ModelScope, andModelScopeCn.As per coding guidelines
**/*.rs: Use///for doc comments on public items in Rust.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/gateway/providers/modelscope.rs` around lines 22 - 45, Add item-level Rust doc comments (use ///) for the exported symbols IDENTIFIER, CN_IDENTIFIER, ModelScopeProviderConfig, ModelScopeCnProviderConfig, ModelScope, and ModelScopeCn: put a short one-line description above each constant and type explaining its purpose (e.g., IDENTIFIER and CN_IDENTIFIER are provider IDs for default and China endpoints), document the struct purpose for ModelScopeProviderConfig and ModelScopeCnProviderConfig and include docs on their public fields (api_key: API key string; api_base: optional custom base URL, mention the default base URLs DEFAULT_BASE_URL and DEFAULT_CN_BASE_URL), and add brief docs for the marker structs ModelScope and ModelScopeCn indicating they represent the respective providers. Ensure all comments use /// and appear immediately above the corresponding item.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/gateway/providers/modelscope.rs`:
- Around line 22-45: Add item-level Rust doc comments (use ///) for the exported
symbols IDENTIFIER, CN_IDENTIFIER, ModelScopeProviderConfig,
ModelScopeCnProviderConfig, ModelScope, and ModelScopeCn: put a short one-line
description above each constant and type explaining its purpose (e.g.,
IDENTIFIER and CN_IDENTIFIER are provider IDs for default and China endpoints),
document the struct purpose for ModelScopeProviderConfig and
ModelScopeCnProviderConfig and include docs on their public fields (api_key: API
key string; api_base: optional custom base URL, mention the default base URLs
DEFAULT_BASE_URL and DEFAULT_CN_BASE_URL), and add brief docs for the marker
structs ModelScope and ModelScopeCn indicating they represent the respective
providers. Ensure all comments use /// and appear immediately above the
corresponding item.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 14ead145-4fa5-43da-a69e-fe77a03ceca1
📒 Files selected for processing (8)
src/config/entities/providers-schema.jsonsrc/config/entities/providers.rssrc/gateway/providers/mod.rssrc/gateway/providers/modelscope.rssrc/proxy/provider.rsui/src/i18n/locales/en.jsonui/src/i18n/locales/zh-CN.jsonui/src/lib/api/types.ts
Summary by CodeRabbit