Skip to content
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

Add new models from OpenAI, Meta, and Google #960

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kmpenner
Copy link

@kmpenner kmpenner commented Jan 3, 2025

Added API models:

  • Gemini 2.0 Flash Exp
  • Gemini 2.0 Flash Thinking Experimental
  • Gemini Experimental 1206
  • OpenAI o1 preview
  • OpenAI o1-mini
  • Groq Llama 3.1 8b instant
  • Groq Llama 3.2 90b vision preview
  • Groq Llama 3.3 70b versatile

Summary by CodeRabbit

  • New Features

    • Added several new AI bot models from Google (Gemini), OpenAI, and Groq platforms.
  • Localization

    • Updated English and Chinese translation files to include names and descriptions for new AI models.

Copy link
Contributor

coderabbitai bot commented Jan 3, 2025

Walkthrough

This pull request introduces several new AI bot classes across different providers, including Google, OpenAI, and Groq. The new classes extend existing base bot classes and define specific model configurations with unique class names, logo filenames, and model identifiers. Additionally, localization files in English and Chinese are updated to include translations for these new bot models, enhancing internationalization support for the newly added AI bot instances.

Changes

File Changes
src/bots/google/ Added new bot classes: Gemini20FlashExpAPIBot, Gemini20FlashThinkingExp1219APIBot, GeminiExp1206APIBot, GeminiFlashThinkingExp1219APIBot, learnlm15ExpAPIBot
src/bots/groq/ Added new Llama bot classes: Llama318bGroqAPIBot, Llama3290bGroqAPIBot, Llama3370bGroqAPIBot
src/bots/openai/ Added new OpenAI bot classes: OpenAIAPIo1Bot, OpenAIAPIo1MiniBot
src/bots/index.js Updated to import and include new bot instances in all and botTags
src/i18n/locales/en.json Added localization entries for new bot models in English
src/i18n/locales/zh.json Added localization entries for new bot models in Chinese

Possibly related PRs

Poem

🤖 Bots hopping in, shiny and new,
From Gemini's flash to Llama's view
Languages dancing, models so bright
CodeRabbit's warren of AI delight! 🐰✨


📜 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 2dd6637 and 8060d48.

📒 Files selected for processing (1)
  • src/i18n/locales/zh.json (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/i18n/locales/zh.json

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (12)
src/bots/groq/Llama3.170bGroqAPIBot.js (2)

3-6: Potential naming inconsistency between file and class.

The file name includes "3.170b", while the class name and properties use 3.1-8b. Consider aligning them to avoid confusion for future maintainers.


7-9: Constructor is empty and unnecessary.

Since this constructor only calls super() with no additional logic, you can safely remove it to satisfy the noUselessConstructor lint rule and reduce boilerplate.

 export default class Llama318bGroqAPIBot extends GroqAPIBot {
   static _className = "Llama318bGroqAPIBot";
   static _logoFilename = "llama-3.1-8b-groq-logo.svg";
   static _model = "llama-3.1-8b-instant";
-  constructor() {
-    super();
-  }
 }
🧰 Tools
🪛 Biome (1.9.4)

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.18bGroqAPIBot.js (1)

7-9: Constructor is empty and unnecessary.

Since this constructor only calls super() and provides no additional functionality, consider removing it to adhere to the noUselessConstructor rule.

 export default class Llama318bGroqAPIBot extends GroqAPIBot {
   static _className = "Llama318bGroqAPIBot";
   static _logoFilename = "llama-3.1-8b-groq-logo.svg";
   static _model = "llama-3.1-8b-instant";
-  constructor() {
-    super();
-  }
 }
🧰 Tools
🪛 Biome (1.9.4)

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/GeminiExp1206APIBot.js (1)

8-10: Constructor is empty and unnecessary.

This constructor only invokes super() and offers no additional logic, so you can remove it to remain concise and pass lint checks.

export default class GeminiExp1206APIBot extends GeminiAPIBot {
  static _className = "GeminiExp1206APIBot";
  static _logoFilename = "gemini-exp-1206-logo.svg";
  static _model = "gemini-exp-1206";

-  constructor() {
-    super();
-  }
}
🧰 Tools
🪛 Biome (1.9.4)

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.370bGroqAPIBot.js (1)

7-9: Remove unnecessary constructor.

This constructor only invokes super() and can be safely removed. This aligns with clean code principles and passes the noUselessConstructor rule.

export default class Llama3370bGroqAPIBot extends GroqAPIBot {
  static _className = "Llama3370bGroqAPIBot";
  static _logoFilename = "llama-3.3-70b-groq-logo.svg";
  static _model = "llama-3.3-70b-versatile";
-  constructor() {
-    super();
-  }
}
🧰 Tools
🪛 Biome (1.9.4)

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.290bGroqAPIBot.js (1)

7-9: Unnecessary constructor.
The constructor merely calls super() with no additional logic, making it unnecessary.

  constructor() {
    super();
  }
-}
+}
🧰 Tools
🪛 Biome (1.9.4)

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/Gemini20FlashExpAPIBot.js (1)

8-10: Unnecessary constructor.
The empty constructor is not adding any functionality beyond the parent class.

  constructor() {
    super();
  }
-}
+}
🧰 Tools
🪛 Biome (1.9.4)

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/GeminiFlashThinkingExp1219APIBot.js (1)

8-10: Constructor could be removed.
Since the constructor only calls super(), it serves no additional purpose.

  constructor() {
    super();
  }
-}
+}
🧰 Tools
🪛 Biome (1.9.4)

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/Gemini20FlashThinkingExp1219APIBot.js (1)

8-10: No-op constructor.
Removing the empty constructor is recommended to simplify the class.

  constructor() {
    super();
  }
-}
+}
🧰 Tools
🪛 Biome (1.9.4)

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/openai/OpenAIAPIo1Bot.js (1)

9-11: Constructor retention

Although the constructor only calls super(), consider keeping it if your codebase conventions advise explicit constructors for clarity and future extensibility. Otherwise, removing it would silence the static analysis warning.

🧰 Tools
🪛 Biome (1.9.4)

[error] 9-11: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/i18n/locales/zh.json (2)

170-171: Consider translating model names to Chinese for consistency.

The Gemini model names are kept in English while other models in the file have Chinese translations. Consider translating "Flash Exp" and "Experimental" to maintain consistency with the rest of the file.


306-308: Consider translating technical terms for better localization.

Terms like "vision preview" and "versatile" could be translated to Chinese for better user experience, following the localization pattern used elsewhere in the file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fe4abe and 2dd6637.

⛔ Files ignored due to path filters (10)
  • public/bots/gemini-2.0-flash-exp-logo.svg is excluded by !**/*.svg
  • public/bots/gemini-2.0-flash-thinking-exp-1219-logo.svg is excluded by !**/*.svg
  • public/bots/gemini-exp-1206-logo.svg is excluded by !**/*.svg
  • public/bots/llama-3.1-70b-groq-logo.svg is excluded by !**/*.svg
  • public/bots/llama-3.1-8b-groq-logo.svg is excluded by !**/*.svg
  • public/bots/llama-3.2-90b-groq-logo.svg is excluded by !**/*.svg
  • public/bots/llama-3.3-70b-groq-logo.svg is excluded by !**/*.svg
  • public/bots/meta-logo.svg is excluded by !**/*.svg
  • public/bots/openai-o1-logo.svg is excluded by !**/*.svg
  • public/bots/openai-o1-mini-logo.svg is excluded by !**/*.svg
📒 Files selected for processing (14)
  • src/bots/google/Gemini20FlashExpAPIBot.js (1 hunks)
  • src/bots/google/Gemini20FlashThinkingExp1219APIBot.js (1 hunks)
  • src/bots/google/GeminiExp1206APIBot.js (1 hunks)
  • src/bots/google/GeminiFlashThinkingExp1219APIBot.js (1 hunks)
  • src/bots/google/learnlm15ExpAPIBot.js (1 hunks)
  • src/bots/groq/Llama3.170bGroqAPIBot.js (1 hunks)
  • src/bots/groq/Llama3.18bGroqAPIBot.js (1 hunks)
  • src/bots/groq/Llama3.290bGroqAPIBot.js (1 hunks)
  • src/bots/groq/Llama3.370bGroqAPIBot.js (1 hunks)
  • src/bots/index.js (7 hunks)
  • src/bots/openai/OpenAIAPIo1Bot.js (1 hunks)
  • src/bots/openai/OpenAIAPIo1MiniBot.js (1 hunks)
  • src/i18n/locales/en.json (3 hunks)
  • src/i18n/locales/zh.json (3 hunks)
🧰 Additional context used
📓 Learnings (1)
src/bots/openai/OpenAIAPIo1Bot.js (1)
Learnt from: cesaryuan
PR: ai-shifu/ChatALL#893
File: src/bots/openai/OpenAIAPI4oMiniBot.js:9-11
Timestamp: 2024-11-12T08:31:11.436Z
Learning: In the codebase, it's standard practice to include constructors in bot classes, even if they only call `super()`.
🪛 Biome (1.9.4)
src/bots/openai/OpenAIAPIo1Bot.js

[error] 9-11: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/GeminiFlashThinkingExp1219APIBot.js

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/learnlm15ExpAPIBot.js

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.170bGroqAPIBot.js

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.18bGroqAPIBot.js

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.370bGroqAPIBot.js

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/GeminiExp1206APIBot.js

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/Gemini20FlashExpAPIBot.js

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/groq/Llama3.290bGroqAPIBot.js

[error] 7-9: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/openai/OpenAIAPIo1MiniBot.js

[error] 9-11: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/google/Gemini20FlashThinkingExp1219APIBot.js

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

🔇 Additional comments (19)
src/bots/groq/Llama3.290bGroqAPIBot.js (2)

1-2: Imports look fine.
No issues with the import statement or file structure.


4-6: Consistent naming convention.
The class name and static properties clearly follow the established naming scheme for Groq bot classes.

src/bots/google/Gemini20FlashExpAPIBot.js (2)

1-2: Imports look fine.
No issues with the import statement or file structure.


4-6: Descriptive naming.
The naming of _className, _logoFilename, and _model is descriptive, following the pattern for Gemini bots.

src/bots/google/GeminiFlashThinkingExp1219APIBot.js (2)

1-2: File creation.
File structure and import statement appear consistent with other Gemini bots.


4-6: Model identifiers are precise.
Properties _className, _logoFilename, and _model align with the naming convention for experimental Gemini bots.

src/bots/google/Gemini20FlashThinkingExp1219APIBot.js (2)

1-2: Import usage confirmed.
Importing the correct base class with no issues.


4-6: Aligns with naming guidelines.
Class name and static properties are consistent with other Gemini-based API bots.

src/bots/google/learnlm15ExpAPIBot.js (1)

8-10: Constructor clarity vs. static analysis hint

Static analysis flags the constructor as unnecessary. However, based on the project's learnings and patterns, constructors are often retained for clarity and potential future extension. It is safe to leave this constructor in place, as it aligns with the codebase’s convention.

🧰 Tools
🪛 Biome (1.9.4)

[error] 8-10: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/openai/OpenAIAPIo1MiniBot.js (1)

9-11: Constructor usage convention

Same as the other bot classes, you may keep this constructor for consistency with your existing bot classes’ style and potential expansions, despite the linter marking it as unnecessary.

🧰 Tools
🪛 Biome (1.9.4)

[error] 9-11: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/bots/index.js (9)

5-7: Consistent naming and file references

Imports for the new Gemini bots look consistent with existing naming schemes. Good job keeping naming alignment.


26-27: OpenAI bots successfully added

Imports for the new OpenAI bots maintain code structure consistency. No issues found.


40-42: Groq Llama bots import

The naming convention follows the existing patterns. No concerns here.


132-134: Gemini bots added to the collection

Adding the Gemini bots to the all array is properly done. Code is consistent with the initialization pattern.


148-149: OpenAI Bot additions

These lines correctly register the new OpenAI bots in the all array, ensuring they are discoverable.


156-158: Groq Llama bots in the all array

The Llama3 bots are properly instantiated and appended. This maintains a coherent registration approach.


302-304: API list updated with Gemini bots

Placing these Gemini bots in the api list is consistent with their classification. No issues detected.


310-310: API list updated with new OpenAI bots

The new OpenAIAPIo1Bot and OpenAIAPIo1MiniBot are included in the api array. Properly categorized.

Also applies to: 312-312


330-332: Groq Llama bots in the API category

These lines effectively group the new Groq Llama bots under api, aligning with the existing codebase structure.

src/i18n/locales/zh.json Outdated Show resolved Hide resolved
Comment on lines +170 to +172
"gemini-20-flash-exp": "Gemini 2.0 Flash Experimental",
"gemini-20-flash-thinking-exp-1219": "Gemini 2.0 Flash Thinking Experimental",
"gemini-exp-1206": "Gemini Experimental 1206",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Verify model name consistency with Chinese localization.

The Chinese localization is missing the entry for "gemini-20-flash-thinking-exp-1219". This should be added to maintain feature parity between languages.

Add the following entry to the Chinese localization file:

     "gemini-20-flash-exp": "Gemini 2.0 Flash Exp",
+    "gemini-20-flash-thinking-exp-1219": "Gemini 2.0 Flash Thinking Exp",
     "gemini-exp-1206": "Gemini Experimental 1206",

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +310 to +312
"llama-31-8b-instant": "Llama 3.1 8b instant",
"llama-32-90b-vision-preview": "Llama 3.2 90b vision preview",
"llama-33-70b-versatile": "Llama 3.3 70b versatile",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Model identifier inconsistencies found in localization files

There are mismatches between the model identifiers in the implementation files and the localization files:

  • Implementation uses llama-3.1-8b-instant but en.json has llama-31-8b-instant
  • Implementation uses llama-3.2-90b-vision-preview but en.json has llama-32-90b-vision-preview
  • Implementation uses llama-3.3-70b-versatile but en.json has llama-33-70b-versatile

The keys in the localization files should match exactly with the _model identifiers used in the bot implementation files to ensure proper functionality.

🔗 Analysis chain

Verify model identifiers match the PR objectives.

The model identifiers in the localization files differ slightly from those mentioned in the PR objectives:

  • "Llama 3.1 8b instant" vs "Groq Llama 3.1 8b instant"
  • "Llama 3.2 90b vision preview" matches
  • "Llama 3.3 70b versatile" matches

Run this script to verify model identifiers in the codebase:


Let me gather more information about the model identifiers.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for model identifiers in bot implementation files
rg -i "llama.*3\.[123].*[78]0b" --type js

Length of output: 310


Script:

#!/bin/bash
# Search for all Llama 3.x model references
rg -i "llama.*3\.[123]" --type js -A 2

# Also check for model identifiers in JSON files
rg -i "llama.*3\.[123]" --type json

Length of output: 2179

@PeterDaveHello PeterDaveHello requested a review from Copilot January 3, 2025 15:37

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 15 out of 24 changed files in this pull request and generated no comments.

Files not reviewed (9)
  • src/i18n/locales/en.json: Language not supported
  • src/i18n/locales/zh.json: Language not supported
  • src/bots/google/Gemini20FlashThinkingExp1219APIBot.js: Evaluated as low risk
  • src/bots/google/GeminiFlashThinkingExp1219APIBot.js: Evaluated as low risk
  • src/bots/groq/Llama3.170bGroqAPIBot.js: Evaluated as low risk
  • src/bots/google/Gemini20FlashExpAPIBot.js: Evaluated as low risk
  • src/bots/google/GeminiExp1206APIBot.js: Evaluated as low risk
  • src/bots/google/learnlm15ExpAPIBot.js: Evaluated as low risk
  • src/bots/groq/Llama3.18bGroqAPIBot.js: Evaluated as low risk
Comments suppressed due to low confidence (1)

src/bots/index.js:3

  • [nitpick] The method name getClassname should be getClassName to maintain consistency in naming conventions.
return all.find((bot) => bot.getClassname() === className);
Copy link
Collaborator

@PeterDaveHello PeterDaveHello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmpenner, thanks for being interested in contributing. Would you please separate those different bots to ensure the review process won't be too complicated, especially since a draft PR like #958 is in progress?

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

2 participants