Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented May 23, 2025

各プロバイダーの利用LLMを増やし、マルチモーダル対応を拡張

変更内容

マルチモーダル対応の拡張

  • xaiopenrouterをマルチモーダル対応サービスに追加

各プロバイダーの最新LLMモデルを追加

  • Perplexity: llama-3.1シリーズのモデルを追加
  • Fireworks: llama-v3p1シリーズとmixtral-8x22b-instructモデルを追加
  • OpenRouter: 主要なマルチモーダル対応モデルを追加
  • Groq: llama-3.1シリーズのモデルを追加

デフォルトモデルの更新

  • Groq: llama-3.3-70b-versatileに更新
  • Cohere: command-r-plus-08-2024に更新
  • Perplexity: llama-3.1-sonar-large-128k-onlineに更新

ドキュメントの更新

  • マルチモーダル対応ドキュメント(日本語版と英語版)を更新し、xAIとOpenRouterの対応を追加

関連情報

タグ

  • devin

Summary by CodeRabbit

  • 新機能

    • xAIおよびOpenRouterのマルチモーダルAIサービス対応を追加しました。
    • 各AIサービスで利用可能な最新モデルやバリエーションを拡充しました。
    • APIキー管理にxAIとOpenRouter用の項目を追加しました。
    • マルチモーダル対応モデルの判定を行うユーティリティ関数を導入し、UIや機能の判定ロジックを統一しました。
  • ドキュメント

    • マルチモーダルAIのサポート対象サービスとモデル一覧を最新情報に更新しました。

Co-Authored-By: ニケちゃん / nikechan <o3nike.teg.14@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented May 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aituber-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2025 2:26pm

@coderabbitai
Copy link

coderabbitai bot commented May 23, 2025

"""

Walkthrough

この変更では、複数のAIサービスのモデルリストとデフォルトモデルが拡張・更新されました。新しいサービス「xai」と「openrouter」が追加され、対応するAPIキー設定とドキュメントも更新されています。コードの制御フローや関数シグネチャの変更はありません。さらに、マルチモーダル対応モデルの判定ロジックを共通ユーティリティ関数に集約し、複数コンポーネントでの判定方法を統一しています。

Changes

ファイル群 変更概要
src/features/constants/aiModels.ts 各AIサービス(groq、perplexity、fireworks、openrouter)のモデルリストに新しいモデルを追加し、デフォルトモデルも更新。Google Gemini 2.5プレビューモデルも追加。マルチモーダル対応モデルの配列と型エイリアスを新設。
src/features/stores/settings.ts multiModalAIServicesに「xai」と「openrouter」を追加し、APIKeys型に新しいキー(xaiKey、openrouterKey)を追加。設定ストアの初期値と永続化ロジックも対応。
website/document/en/guide/ai/multimodal.md
website/document/guide/ai/multimodal.md
マルチモーダルAIサポートのドキュメントを更新し、「xAI」と「OpenRouter」のサービスおよび対応モデルを追加。環境変数の説明も拡張。
src/features/utils/multimodal.ts 現在選択中のAIモデルがマルチモーダル対応か判定するユーティリティ関数 isCurrentModelMultiModal を新規追加。
src/components/menu.tsx
src/components/settings/modelProvider.tsx
src/components/settings/slide.tsx
src/components/settings/slideConvert.tsx
src/features/slide/slideAIHelpers.ts
src/components/settings/youtube.tsx
複数コンポーネント・関数でのマルチモーダル判定ロジックを、直接配列のメンバーシップ判定から isCurrentModelMultiModal 関数呼び出しに変更。既存の配列参照はコメントアウト。
src/pages/api/convertSlide.ts createSlideLine関数内のaiServiceConfigに新たに「xai」と「openrouter」を追加し、空の関数を割り当て。
src/pages/api/services/vercelAi.ts 「xai」と「openrouter」のサービス生成ロジックを、専用SDK呼び出しからOpenAI互換のcreateOpenAI関数によるbaseURL指定の呼び出しに変更。

Possibly related PRs

  • tegnike/aituber-kit#389: 「openrouter」サービスのAIモデル定義やAPIキー設定の追加など、本PRと同様に「openrouter」対応を拡充しているため密接に関連。
  • tegnike/aituber-kit#375: AIモデルリストの一元管理を導入し、関連コンポーネントを更新。今回の変更と同じファイルやロジックを扱い密接に関連。
  • tegnike/aituber-kit#150: Vercel AI SDKを用いたAIサービス統合の基盤を提供し、本PRのサービス生成ロジック変更と関連。

Suggested labels

devin
"""

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-05-23T14_25_44_124Z-debug-0.log


📜 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 d37b6cd and dc07e45.

📒 Files selected for processing (3)
  • src/components/menu.tsx (3 hunks)
  • src/pages/api/convertSlide.ts (1 hunks)
  • src/pages/api/services/vercelAi.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/menu.tsx
🔇 Additional comments (5)
src/pages/api/convertSlide.ts (1)

168-169: 新しいAIサービスの追加が適切に行われています

xaiopenrouterのサービスキーがaiServiceConfigオブジェクトに追加されています。既存のazureキーと同様に空のオブジェクトを返す実装となっていますが、これは意図通りの実装でしょうか?

この実装によりマルチモーダル対応の拡張がサポートされますが、具体的な処理は他の場所(おそらくvercelAi.ts)で行われていると思われます。

src/pages/api/services/vercelAi.ts (4)

4-4: 不要なインポートの適切なコメントアウト

@ai-sdk/xaiからのcreateXaiのインポートがコメントアウトされています。これは以下の実装でcreateOpenAIを使用するアプローチに変更されたためと思われ、適切な修正です。


12-12: 不要なインポートの適切なコメントアウト

@openrouter/ai-sdk-providerからのcreateOpenRouterのインポートがコメントアウトされています。これは以下の実装でcreateOpenAIを使用するアプローチに変更されたためと思われ、適切な修正です。


30-34: xAIサービスの実装が適切に行われています

xaiサービスがcreateOpenAIを使用して実装されています。専用SDKの代わりに、カスタムベースURLを指定したOpenAI互換クライアントを使用する方法は、コードの一貫性と保守性を高めるのに役立ちます。

https://api.xai.com/v1というエンドポイントを使用して、xAIのAPIにアクセスしている実装は適切です。


50-54: OpenRouterサービスの実装が適切に行われています

openrouterサービスがcreateOpenAIを使用して実装されています。専用SDKの代わりに、カスタムベースURLを指定したOpenAI互換クライアントを使用する方法は、コードの一貫性と保守性を高めるのに役立ちます。

https://openrouter.ai/api/v1というエンドポイントを使用して、OpenRouterのAPIにアクセスしている実装は適切です。

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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

@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: 0

🧹 Nitpick comments (2)
src/components/settings/slide.tsx (2)

73-78: マルチモーダル対応の判定ロジックを改善

マルチモーダル対応の判定を直接 multiModalAIServices リストと照合する代わりに、一元化された isCurrentModelMultiModal() 関数を使用するように変更されています。コメントアウトされた古いコードは、変更の履歴を残す目的があるかもしれませんが、将来的にはクリーンアップすることを検討してください。

  disabled={
-            // !multiModalAIServices.includes(
-            //   selectAIService as multiModalAIServiceKey
-            // )
            !isCurrentModelMultiModal()
  }

128-133: SlideConvert コンポーネントの条件付きレンダリングを更新

同様に、SlideConvert コンポーネントの条件付きレンダリングも isCurrentModelMultiModal() 関数を使用するように変更されています。この変更により、マルチモーダル対応の判定ロジックが一元化され、将来的なモデル追加時の保守が容易になります。

-          {/* multiModalAIServices.includes(
-            selectAIService as multiModalAIServiceKey
-          ) && */}
           {isCurrentModelMultiModal() && (
             <SlideConvert onFolderUpdate={handleFolderUpdate} />
           )}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ba25659 and 5342128.

📒 Files selected for processing (7)
  • src/components/menu.tsx (2 hunks)
  • src/components/settings/modelProvider.tsx (2 hunks)
  • src/components/settings/slide.tsx (3 hunks)
  • src/components/settings/slideConvert.tsx (2 hunks)
  • src/features/constants/aiModels.ts (4 hunks)
  • src/features/slide/slideAIHelpers.ts (2 hunks)
  • src/features/utils/multimodal.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/features/utils/multimodal.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/features/constants/aiModels.ts
🧰 Additional context used
🧬 Code Graph Analysis (5)
src/components/settings/slide.tsx (1)
src/features/utils/multimodal.ts (1)
  • isCurrentModelMultiModal (8-13)
src/components/settings/slideConvert.tsx (1)
src/features/utils/multimodal.ts (1)
  • isCurrentModelMultiModal (8-13)
src/features/slide/slideAIHelpers.ts (1)
src/features/utils/multimodal.ts (1)
  • isCurrentModelMultiModal (8-13)
src/components/menu.tsx (1)
src/features/utils/multimodal.ts (1)
  • isCurrentModelMultiModal (8-13)
src/components/settings/modelProvider.tsx (1)
src/features/constants/aiModels.ts (2)
  • defaultModels (129-151)
  • multiModalModels (264-289)
🔇 Additional comments (9)
src/components/menu.tsx (2)

18-18: マルチモーダル検出ロジックの集約のための新しいインポートを追加

新しいユーティリティ関数 isCurrentModelMultiModal をインポートして、マルチモーダル検出ロジックを集約しています。これにより、マルチモーダルモデルの判定が統一され、コードの保守性が向上します。


233-237: マルチモーダル判定ロジックを改善

AIサービスの直接チェックからモデルベースのチェックに変更されています。これは良い改善で、より正確にマルチモーダル機能をサポートするモデルを識別できるようになります。

-multiModalAIServices.includes(
-  selectAIService as multiModalAIServiceKey
-)
+isCurrentModelMultiModal()

この変更により、xAIやOpenRouterなどの新しいサービスを含む、さまざまなプロバイダーのマルチモーダル対応モデルをより柔軟にサポートできるようになります。

src/components/settings/slideConvert.tsx (2)

10-10: マルチモーダル検出用ユーティリティのインポート追加

isCurrentModelMultiModal 関数をインポートすることで、スライド変換機能においてもマルチモーダル対応の判定ロジックが統一されています。


46-47: サービスベースからモデルベースのマルチモーダル検証に改善

以前はAIサービスがマルチモーダル対応かを直接チェックしていましたが、現在選択されているモデルがマルチモーダル対応かをチェックするように変更されています。

-if (!multiModalAIServices.includes(aiService)) {
+if (!isCurrentModelMultiModal()) {

この変更により、xAIやOpenRouterなどの新しいサービスを含む、より多くのマルチモーダル対応モデルに対応できるようになります。また、アプリケーション全体でマルチモーダル対応の判定ロジックが一貫するようになりました。

src/features/slide/slideAIHelpers.ts (2)

5-5: マルチモーダル判定用ユーティリティのインポート追加

isCurrentModelMultiModal 関数をインポートすることで、スライド関連のAIヘルパー機能においてもマルチモーダル対応の判定ロジックが統一されています。


15-16: マルチモーダル対応チェックロジックの改善

AIサービスの直接チェックからモデルベースのチェックに変更されています。

-// if (!multiModalAIServices.includes(aiService)) {
+if (!isCurrentModelMultiModal()) {

この変更により、関数のバリデーションロジックがよりモデル中心になり、xAIやOpenRouterなどの新しいサービスや、それらが提供する最新のマルチモーダル対応モデルをより適切にサポートできるようになります。

src/components/settings/modelProvider.tsx (2)

10-10: マルチモーダルモデルのインポート変更

multiModalAIServices の代わりに multiModalModels をインポートすることで、サービスベースからモデルベースのマルチモーダル判定に移行しています。これにより、より細かなマルチモーダル機能の制御が可能になります。


141-144: マルチモーダル判定ロジックの改善

AIサービスの直接チェックから、そのサービスのデフォルトモデルがマルチモーダル対応かをチェックするよう変更されています。

+const newModel = defaultModels[newService]
+const isMultiModal = multiModalModels.includes(newModel as any)
+
+if (!isMultiModal) {

この変更により、xAIやOpenRouterなどの新しいサービスの追加に伴い、それらのデフォルトモデルがマルチモーダル対応かどうかを正確に判断できるようになります。これはPRの目的である「各プロバイダーの利用LLMを増やし、マルチモーダル対応を拡張」に合致しています。

src/components/settings/slide.tsx (1)

10-10: 新しいユーティリティ関数のインポートを追加

マルチモーダル対応の判定を一元化するために、専用のユーティリティ関数をインポートしています。この変更は、コードの保守性を向上させる良い取り組みです。

Co-Authored-By: ニケちゃん / nikechan <o3nike.teg.14@gmail.com>
Co-Authored-By: ニケちゃん / nikechan <o3nike.teg.14@gmail.com>
@tegnike tegnike closed this May 27, 2025
@tegnike tegnike deleted the devin/1748004927-add-llm-multimodal branch June 4, 2025 19:26
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