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のwikiでチャットボット作りたい

Last updated at Posted at 2024-08-18

この記事では、GitHubのWikiを使用して、Agent Builderを活用したチャットボットを構築する方法を紹介します

wikiはこちらを使用します

過去記事で使用したリポジトリのものです

データ準備

wikiをcloneするコマンドはwikiの右下らへんにあります

git clone https://github.com/babu-ch/santa.wiki.git

cd santa.wiki

// 今は.mdが対応してないのでtxtに変換する
for file in *.md; do mv "$file" "${file%.md}.txt"; done

// フォルダごと上げたいので.gitは消す
rm -rf .git/

storage

cloud storageにフォルダごとアップします

Agent Builderの設定

Agent Builderでアプリを作成→チャット

言語設定を忘れずに

データストアの設定は、データストアを作成→Cloud Storage

先程上げたフォルダを指定する
非構造化ドキュメントにチェックしてください

するとDialogFlowのTest Agentから質問できるようになっています(ストアの反映に時間がかかります)

答えられない場合データストアでエラーがないか、インポート中じゃないかを確認してください

以下のエラーは、最初markdown形式のままアップしてエラーになっていた時のやつです

prompt変えてみる

今のままだと味気ないのでちょっとプロンプトを設定してみます

AgentSettings->GenerativeAI->Data store modelなんたらかんたらを変更する

modelをgemini1.5にして、promptはほぼサンプルのデータを使用し、以下2行を追加

+   The answer MUST be in Japanese. // ここはEnglishだったとこをJapaneseに置換しただけ
+   Please answer humorously using emojis.

プロンプトのサンプルはこちらにあります

絵文字を交えて答えてくれるようになりました

おわり

細かい手順は以下の記事のが分かりやすいです!

簡単に作れてすごいですね :astonished:

slack連携して使ってみるのも便利そうですよね

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?