-
Notifications
You must be signed in to change notification settings - Fork 60.7k
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
Fix model icon on SiliconFlow #6190
Fix model icon on SiliconFlow #6190
Conversation
@jackalcooper is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe update refactors the LLM icon selection in the emoji component. The conditions checking the model name now use .toLowerCase().includes instead of startsWith, allowing for case-insensitive and substring matching. This modification applies to the "llama", "deepseek", and "glm" cases. No changes were made to exported or public entities. Changes
Sequence Diagram(s)sequenceDiagram
participant C as Emoji Component
participant M as ModelName
participant I as Icon Selector
C->>M: Receive model name input
alt modelName contains "llama"
C->>I: Return llama icon
else alt modelName contains "deepseek"
C->>I: Return deepseek icon
else alt modelName contains "glm"
C->>I: Return glm icon
else
C->>I: Return default icon
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
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 (3)
app/components/emoji.tsx (3)
69-69
: Remove redundant toLowerCase() call.The
modelName
is already converted to lowercase on line 52, making thistoLowerCase()
call unnecessary.- } else if (modelName.toLowerCase().includes("llama")) { + } else if (modelName.includes("llama")) {
73-73
: Remove redundant toLowerCase() call.The
modelName
is already converted to lowercase on line 52, making thistoLowerCase()
call unnecessary.- } else if (modelName.toLowerCase().includes("deepseek")) { + } else if (modelName.includes("deepseek")) {
88-88
: Remove redundant toLowerCase() call.The
modelName
is already converted to lowercase on line 52, making thistoLowerCase()
call unnecessary.- modelName.toLowerCase().includes("glm") || + modelName.includes("glm") ||
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
app/components/emoji.tsx
(2 hunks)
π Additional comments (2)
app/components/emoji.tsx (2)
88-91
: Consider consistent matching strategy.The condition mixes different matching strategies:
includes()
for "glm"startsWith()
for "cogview-" and "cogvideox-"Consider using the same matching strategy for consistency, unless there's a specific reason for the difference.
Could you clarify if there's a reason for using different matching strategies in this condition?
69-92
: Verify substring matching priority.The change from
startsWith
toincludes
could lead to multiple matches for model names containing multiple keywords (e.g., "llama-glm" would match both the "llama" and "glm" conditions). The icon shown would depend on the order of the conditions.Consider:
- Documenting the expected behavior for such cases
- Adding test cases for model names that could match multiple conditions
Would you like me to help create test cases for these edge cases?
π» εζ΄η±»ε | Change Type
Summary by CodeRabbit