-
Notifications
You must be signed in to change notification settings - Fork 61.1k
feat: Update moonshot models and fix for typo #6572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes update the Moonshot API base URL and significantly expand the list of supported Moonshot model names. The default models array is also updated to reflect this expanded set of models. No other logic or structural changes are introduced. Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
app/constant.tsOops! Something went wrong! :( ESLint: 8.49.0 TypeError: Cannot read properties of undefined (reading 'loc') ✨ Finishing Touches
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. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/constant.ts (1)
626-637
: Hard-coding the model list invites drift – fetch or cache from/v1/models
insteadKeeping this array in sync with Moonshot’s rapidly-evolving catalog will require repetitive PRs. Consider loading the model names at boot time (with a cached fallback) to stay current automatically:
-const moonshotModels = [ - "moonshot-v1-auto", - // … - "kimi-latest", -]; +// Prefer live data; fall back to a static list if the request fails. +const moonshotModels = await fetchMoonshotModels(MOONSHOT_BASE_URL) + .catch(() => [ + "moonshot-v1-auto", + // … + "kimi-latest", + ]);A tiny helper that requests
GET ${MOONSHOT_BASE_URL}/v1/models
, filtersid
, and caches the result would eliminate manual updates and reduce merge noise.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/constant.ts
(3 hunks)
🔇 Additional comments (2)
app/constant.ts (2)
28-28
: Base URL fix looks good – check for env overrides
MOONSHOT_BASE_URL
now points athttps://api.moonshot.ai
, matching the production endpoint. Verify that any environment-level override (e.g.MOONSHOT_BASE_URL
in deployment configs) is still respected elsewhere so the value isn’t silently hard-coded at runtime.
824-834
: No leftovermoonshotModes
references found after renameA global search for
moonshotModes
returned no hits, confirming that all usages have been updated tomoonshotModels
. Everything looks good here.
…onshot.ai/v1/models
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
api.moonshot.cntoapi.moonshot.ai
api.moonshot.ai/v1/models
📝 补充信息 | Additional Information
Summary by CodeRabbit
New Features
Chores