🤖

TypeError: 'async_generator' object is not iterable

に公開

error message

tl;dr

  • Gemini Enterprise で Custom Agent を起動すると「質問への回答中にエラーが発生しました」というエラーが発生した
  • これは Gemini と ADK/Agent Engine の互換性の既知の問題であり、google-cloud-aiplatform のバージョンを 1.126.1 にダウングレードすることで解決した

コンテキスト

AI エージェントの導入に向けて検証を行なっている。限定公開に向けて Gemini Enterprise(以降、Gemini)を利用している。

事象

11月14日頃、Gemini で Custom Agent(Agent Engine Runtime 上のエージェント)を起動すると以下のエラーメッセージが表示された。

エラーメッセージ:
「質問への回答中にエラーが発生しました。しばらくしてからもう一度お試しください。」

なお、Agent Engine のプレイグラウンドでは正常に動作していた。

原因

これは既知の問題であり、Gemini と ADK/Agent Engine の互換性に問題があった。

サポートからの回答:

I have found that this is a known issue and the product team is currently working on the issue. In the meantime you can use the older version of the library 'google-cloud-aiplatform[adk,agent_engines]' i.e 1.126.1. This should resolve the issue you are currently facing.

対策

サポートのフィードバック通り、ライブラリのバージョンを 1.126.1 にダウングレードした。

requirements=[
    "google-adk>=1.15.1",
    "google-cloud-aiplatform[adk]==1.126.1",
],

Closing

ハンドルは自分で握る

何かを提供するためには、ある程度のコントロールが必要だと思う。今回は Gemini の問題だったが、今後も同様の問題が起こる可能性があるため、外部プラットフォームとの連携には注意が必要であることを再認識した。

GitHubで編集を提案

Discussion