0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Github Actions+PR-Agent+Amazon Bedrock設定時のトラブル例

Posted at

概要

下記、Github ActionsへPR-Agentを設定し、プルリクエストの自動レビューを動作させる手順紹介記事をポストしました。

シンプルにするため、新規リポジトリでの設定を想定して記述していますが、実際は既存リポジトリへ導入することも多いと思います。
その場合にトラブルになった例として本記事を作成しています。

トラブル例

事象

アクションは実行されるが、下記のような表示になることがありました。
レビューが実行されていないようです。

image.png

PR Code Suggestions ✨
No code suggestions found for the PR.

ログ確認

下記のようなActionsログを確認できます。

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.

Error during LLM inference: litellm.AuthenticationError: AuthenticationError: OpenAIException - Incorrect API key provided: dummy_key. You can find your API key at https://platform.openai.com/account/api-keys

推察

詳細まで追えていませんが、こういうことかなという予測。

  • 基盤モデル利用においては BerriAI/litellm を使用している
  • LiteLLMとは、さまざまなLLMを共通のインターフェイスを使用して利用できるモジュール
  • 共通のインターフェイス=OpenAIのインターフェイス
  • デフォルトではOpenAIを利用するようになっている
  • OpenAI APIリクエストにおいて必要な APIキーが設定されていない
  • つまり、bedrock/Claudeを使用するように指示できていない

原因

使用モデルを指示する .pr_agent.toml が正しく評価できていないことが原因のようです。

プルリクエスト、つまりマージ対象ブランチのコミットに .pr_agent.toml のモデル部分の変更が含まれており、これが原因と考えています。

Github Actionsがリポジトリ内のファイル .pr_agent.toml を参照するのですが、mainなど、マージ先ブランチのファイルを参照するとすればよさそうです。

対応方法

.pr_agent.toml の変更については、コード変更とは別にマージしておく、というのが良さそうです。
Github管理上の設定ファイルであり、本来のコード変更とは別、としても違和感はないと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?