2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【VSCode】GitHub Copilot ChatでWeb検索を使用する方法

Last updated at Posted at 2024-10-31

Web Search for Copilotを使用する

Web Search for Copilotという拡張機能を導入するとGitHub Copilot ChatでWeb検索を使用して最新の情報が取得できるようになります。

拡張機能をインストール

以下のページの「インストール」をクリックして拡張機能をインストールします。

TavilyのAPIキーを取得する

を使用するにはTavilyまたはBingのAPIキーが必要です。
今回はデフォルトで設定されているTavilyを使用します。
まず、Tavilyにサインアップします。
サインアップすると以下の画面が表示され、TavilyのAPIを取得できます。

スクリーンショット 2024-10-31 18.54.33.png

APIキーを登録する

初めて@websearchを記述してGitHub Copilot Chatを使用した際に以下のようにAPIキーの入力欄が表示されます。

スクリーンショット 2024-10-31 14.12.41.png

上記で取得したAPIキーを入力して登録します。

以上で導入は完了です。
試しに「Next.jsの最新バージョンは何ですか」と質問すると2024年10月時点では15である旨の回答が得られました。

スクリーンショット 2024-10-31 18.27.29.png

GitHub Copilotの設定を変更する

GitHub Copilotの設定を変更することで拡張機能なしでBingでのWeb検索が利用可能になります。
GitHub Copilotの設定画面の「Copilot access to Bing」を「Enabled」に変更します。

スクリーンショット 2024-10-31 19.40.17.png

拡張機能を使用する場合と同様に「Next.jsの最新バージョンは何ですか」と質問すると以下のような回答でした。

スクリーンショット 2024-10-31 19.38.24.png

質問の仕方を変えたところ正しい情報を得られました。

スクリーンショット 2024-10-31 19.38.32.png

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?