目次
この記事について
本記事は、Agent Builder を使用したデータストア参照型対話エージェントの作成に関する調査記録です。
やりたいこと
Agent Builder を用いたデータストア参照型対話エージェントの作成において、
データストアのファイル数が増加することで回答率が低下する問題への対処を進める。
前回の調査日記
あわせて読みたい


AI Agent開発日記 2025/04/19
この記事について 本記事は、Agent Builder を使用したデータストア参照型対話エージェントの作成に関する調査記録です。 やりたいこと Agent Builder を用いたデータス...
- やりたいこと
- 下記記事を参考に以下手順で拡張機能インストールを試みる
- Firebase Extensions のソースコードをGitHub などからローカルに持ってくる
- extension.yamlやpackage.jsonなどを最新バージョンに更新
- 拡張機能をdevレジストリに公開
- Firebaseプロジェクトにインストール
npm run build
実行時に、TypeScriptコンパイラによって下記のエラーが発生したので解決したい
- 下記記事を参考に以下手順で拡張機能インストールを試みる
- 現状
npm run build
実行時のエラーは、shipToElastic.ts
ファイルに Firestore のドキュメントパスが指定されていなかったことが原因だった。
ビルドの問題は解決したため、次は Firebase Functions へのデプロイを行う。
shipToElastic.ts
ファイルの修正箇所
// 修正前
export const handler = (client: any) => {
return async (
change: functions.Change<functions.firestore.DocumentSnapshot>
) => {
// 修正後
export const shipToElastic = functions.firestore
// functions.config().get('COLLECTION_PATH') を使用
.document(`${functions.config().get('COLLECTION_PATH')}/{documentId}`)
// change パラメータに型アノテーションを追加
.onWrite(async (change: functions.Change<functions.firestore.DocumentSnapshot>) => {
参照記事
Qiita


Firebase extensionsがemulatorを使ってlocalで動かせるようになったので試してみた - Qiita
こんにちは。virapture株式会社でCEOしながらラグナロク株式会社でもCKOとして働いているもぐめっとです。このあいだ初めてマーダーミステリーというのをやってみました。...
拡張機能
GitHub

GitHub - elastic/app-search-firestore-extension: An extension that syncs data from Google's [Cloud F...
An extension that syncs data from Google's [Cloud Firestore](https://firebase.google.com/products/firestore) to [Elastic App Search](https://www.elastic.co/...
npm run build時に発生したエラー
$ npm run build
> build
> cd functions && npm run build
> @elastic/app-search-firestore-extension@0.4.0 build
> tsc
src/shipToElastic.ts:67:40 - error TS2339: Property 'handler' does not exist on type 'typeof import("/app-search-firestore-extension/functions/node_modules/firebase-functions/lib/v2/index")'.
67 export const shipToElastic = functions.handler.firestore.document.onWrite(
~~~~~~~
Found 1 error in src/shipToElastic.ts:67