Amazon BedrockのGPTモデル向けWeb SearchをGPT-5.6 Lunaで試してみた
はじめに
2026年8月4日、Amazon BedrockでOpenAI GPTモデル向けのWeb Searchツールが一般提供されました。
Web Searchは、OpenAI Responses API互換のtoolsパラメータで有効化するサーバーサイドの組み込みツールです。執筆時点では、検索はAmazonが運用するWebインデックスとキャッシュから提供され、リクエストデータはAWS境界の外に出ません。レスポンスにはソースのURLとページタイトルが引用として付きます。
本記事では、GPT-5.6 LunaでWeb Searchを利用し、日本語での回答とソース引用の取得を確認します。Mantleエンドポイントの使い方と必要なIAM設定は以下の記事で扱っています。
検証内容
検証環境
| 項目 | 値 |
|---|---|
| リージョン | us-east-1 |
| エンドポイント | https://bedrock-mantle.us-east-1.api.aws/openai/v1 |
| モデル | openai.gpt-5.6-luna |
| Python | 3.12 |
| openai | 2.40.0 |
| aws-bedrock-token-generator | 1.1.0 |
執筆時点でWeb Searchが使えるリージョンはus-east-1、us-east-2、us-west-2です。対応モデルはGPT-5.4、GPT-5.5、GPT-5.6(Sol/Terra/Luna)です。最新のリージョン・モデル対応状況は公式ドキュメントを確認してください。
Web Searchの有効化
tools=[{"type": "web_search"}]を追加するだけで有効になります。本記事では検索ソースを明示するためexternal_web_access: Falseを併記しています。
from openai import OpenAI
from aws_bedrock_token_generator import provide_token
REGION = "us-east-1"
MODEL = "openai.gpt-5.6-luna"
BASE_URL = f"https://bedrock-mantle.{REGION}.api.aws/openai/v1"
client = OpenAI(base_url=BASE_URL, api_key=provide_token(region=REGION))
response = client.responses.create(
model=MODEL,
instructions="あなたは親切なアシスタントです。必ず日本語で回答してください。",
input="週間aws 2026",
tools=[{"type": "web_search", "external_web_access": False}],
)
external_web_accessパラメータは検索ソースを制御します。将来のリリースで外部Webからの取得が可能になる可能性があるとドキュメントに記載されていますが、現時点ではこの値を指定してもBedrockのWebインデックスとキャッシュから取得されます。
Today, retrieval is served entirely from the Amazon Bedrock web index and cache, so no request data leaves the AWS boundary even when this permission is granted. In a future release, this configuration may allow search and fetch to retrieve content from the live external web.
https://docs.aws.amazon.com/bedrock/latest/userguide/web-search.html
instructionsパラメータで日本語回答を指定しています。今回の検証では省略した場合に日本語以外の言語で回答が返ってきたため、明示的に指定しました。執筆時点でOpenAI Responses APIには専用の言語指定パラメータは見当たりません。
実行結果
2パターンのクエリで検証しました。
| パターン | クエリ | 目的 |
|---|---|---|
| 1 | 「週間aws 2026」 | シンプルなクエリ |
| 2 | 「bedrock mantle GPT モデルを Lambdaレイヤで実行する方法を教えて」 | 技術的な質問 |
パターン1: シンプルなクエリ
「Web Searchの有効化」で示したコードをそのまま実行しました。
検索クエリの展開
ユーザーの入力「週間aws 2026」を、モデルは複数の検索クエリに展開して検索を実行します。response.outputのweb_search_callを見ると、この展開過程が確認できます。
{
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "週間AWS 2026",
"queries": ["週間AWS 2026", "AWS 週間 2026 日本", "週刊AWS 2026"]
}
}
追加の検索ではsite:制限が付与され、AWSの公式ドメインに絞った検索が行われます。
{
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
"queries": [
"site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
"site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8/3週\"",
"site:aws.amazon.com/jp/blogs/news/ \"週刊AWS\" \"2026/7/27週\""
]
}
}
最終回答とソース引用
検索結果をもとに生成された回答は、response.outputのmessageブロックに含まれます。annotationsにurl_citationとして参照元が付きます(1件のみ抜粋)。
{
"type": "message",
"phase": "final_answer",
"content": [
{
"type": "output_text",
"text": "「**週刊AWS 2026**」をお探しなら...",
"annotations": [
{
"type": "url_citation",
"title": "週刊AWS | Amazon Web Services ブログ",
"url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
"start_index": 41,
"end_index": 124
}
]
}
]
}
start_indexとend_indexは回答テキスト内の該当箇所を示します。引用を取り出すコードは以下のとおりです。
for item in response.output:
if item.type == "message":
for block in item.content:
if block.type == "output_text":
for ann in block.annotations:
if ann.type == "url_citation":
print(f"{ann.title}: {ann.url}")
トークン使用量は入力11,516、出力495、合計12,011でした。入力側が大きいのは、検索結果のスニペットがコンテキストに載るためです。
パターン2: 技術的な質問
response = client.responses.create(
model=MODEL,
instructions="あなたは親切なアシスタントです。必ず日本語で回答してください。",
input="bedrock mantle GPT モデルを Lambdaレイヤで実行する方法を教えて",
tools=[{"type": "web_search", "external_web_access": False}],
)
検索クエリの展開
技術的な質問では、より多くの検索パターンが生成されます。
{
"type": "web_search_call",
"action": {
"type": "search",
"query": "Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
"queries": [
"Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
"site:docs.aws.amazon.com Amazon Bedrock Mantle GPT Lambda",
"site:aws.amazon.com/bedrock Mantle GPT"
]
}
}
追加の検索ではドキュメントやGitHubを対象にしたクエリも実行されます。
{
"type": "web_search_call",
"action": {
"type": "search",
"query": "site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
"queries": [
"site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
"site:github.com/aws aws-bedrock-token-generator-python Lambda",
"site:docs.aws.amazon.com/lambda/latest/dg layers python dependencies"
]
}
}
最終回答と引用
検索2回とページ取得1回を経て、11件の引用を含む詳細な回答が返りました。
{
"type": "message",
"phase": "final_answer",
"content": [
{
"type": "output_text",
"text": "以下は、**Amazon Bedrock Mantle 経由の GPT モデルを、Python Lambda+Lambda Layer から呼び出す構成**です...",
"annotations": [
{
"type": "url_citation",
"title": "Inference using Responses API - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
"start_index": 278,
"end_index": 473
},
{
"type": "url_citation",
"title": "Endpoints supported by Amazon Bedrock - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/en_us/bedrock/latest/userguide/endpoints.html",
"start_index": 278,
"end_index": 473
}
]
}
]
}
参照されたソース(引用11件・ユニークURL 4件から抜粋):
docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.htmldocs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.htmlaws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/
response.outputの構造
response.outputには検索から回答生成までの全過程が含まれます。
| type | 内容 |
|---|---|
reasoning |
思考過程(暗号化) |
web_search_call |
検索(action.type: search)またはページ取得(action.type: open_page) |
message |
最終回答 + annotations |
モデルは複数回の検索とページ取得を自律的に実行し、必要な情報を収集してから回答を生成します。全文は記事末尾の「response.output全文」を参照してください。
まとめ
Bedrock上のGPTモデルに最新情報を参照させたい場面でも、検索基盤を自前で用意する必要がなくなりました。今回の検証では、OpenAI API向けのtools指定をそのまま利用できました。
response.outputを見ると、モデルが複数回の検索とページ取得を自律的に実行していることが分かります。今回試したAWS関連の2クエリでは、検索クエリにsite:docs.aws.amazon.comやsite:aws.amazon.comといったドメイン制限が付与され、AWSの公式ドキュメントやブログが多く参照されました。
external_web_access: Trueで外部Webからの取得が可能になれば、検索対象が広がりユースケースも増えそうです。
response.output全文(IDマスク済み)
パターン1: シンプルなクエリ(週間aws 2026)
[
{
"id": "rs_xxxxx",
"type": "reasoning",
"encrypted_content": "(暗号化された思考過程)"
},
{
"id": "ws_xxxxx",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "週間AWS 2026",
"queries": ["週間AWS 2026", "AWS 週間 2026 日本", "週刊AWS 2026"]
}
},
{
"id": "rs_xxxxx",
"type": "reasoning",
"encrypted_content": "(暗号化された思考過程)"
},
{
"id": "ws_xxxxx",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
"queries": [
"site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8\"",
"site:aws.amazon.com/jp/blogs/news/ \"週刊AWS – 2026/8/3週\"",
"site:aws.amazon.com/jp/blogs/news/ \"週刊AWS\" \"2026/7/27週\""
]
}
},
{
"id": "rs_xxxxx",
"type": "reasoning",
"encrypted_content": "(暗号化された思考過程)"
},
{
"id": "ws_xxxxx",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "open_page",
"url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/"
}
},
{
"id": "msg_xxxxx",
"type": "message",
"role": "assistant",
"status": "completed",
"phase": "final_answer",
"content": [
{
"type": "output_text",
"text": "「**週刊AWS 2026**」をお探しなら、AWS公式ブログの一覧はこちらです...",
"annotations": [
{
"type": "url_citation",
"title": "週刊AWS | Amazon Web Services ブログ",
"url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
"start_index": 41,
"end_index": 124
},
{
"type": "url_citation",
"title": "週刊AWS | Amazon Web Services ブログ",
"url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
"start_index": 499,
"end_index": 582
},
{
"type": "url_citation",
"title": "週刊AWS | Amazon Web Services ブログ",
"url": "https://aws.amazon.com/jp/blogs/news/tag/%E9%80%B1%E5%88%8Aaws/",
"start_index": 715,
"end_index": 798
}
]
}
]
}
]
パターン2: 技術的な質問(Lambdaレイヤで実行する方法)
[
{
"id": "rs_xxxxx",
"type": "reasoning",
"encrypted_content": "(暗号化された思考過程)"
},
{
"id": "ws_xxxxx",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
"queries": [
"Amazon Bedrock Mantle GPT model Lambda layer 実行方法",
"site:docs.aws.amazon.com Amazon Bedrock Mantle GPT Lambda",
"site:aws.amazon.com/bedrock Mantle GPT"
]
}
},
{
"id": "ws_xxxxx",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "search",
"query": "site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
"queries": [
"site:docs.aws.amazon.com/bedrock/latest/userguide bedrock mantle IAM bearer token Lambda",
"site:github.com/aws aws-bedrock-token-generator-python Lambda",
"site:docs.aws.amazon.com/lambda/latest/dg layers python dependencies"
]
}
},
{
"id": "ws_xxxxx",
"type": "web_search_call",
"status": "completed",
"action": {
"type": "open_page",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html"
}
},
{
"id": "msg_xxxxx",
"type": "message",
"role": "assistant",
"status": "completed",
"phase": "final_answer",
"content": [
{
"type": "output_text",
"text": "以下は、**Amazon Bedrock Mantle 経由の GPT モデルを、Python Lambda+Lambda Layer から呼び出す構成**です...",
"annotations": [
{
"type": "url_citation",
"title": "Inference using Responses API - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
"start_index": 278,
"end_index": 473
},
{
"type": "url_citation",
"title": "Endpoints supported by Amazon Bedrock - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/en_us/bedrock/latest/userguide/endpoints.html",
"start_index": 278,
"end_index": 473
},
{
"type": "url_citation",
"title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
"url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
"start_index": 1089,
"end_index": 1224
},
{
"type": "url_citation",
"title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
"url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
"start_index": 2044,
"end_index": 2179
},
{
"type": "url_citation",
"title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
"url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
"start_index": 4776,
"end_index": 4911
},
{
"type": "url_citation",
"title": "GPT-5.6 Luna - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html",
"start_index": 5209,
"end_index": 5456
},
{
"type": "url_citation",
"title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
"url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
"start_index": 5209,
"end_index": 5456
},
{
"type": "url_citation",
"title": "GPT-5.6 Luna - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html",
"start_index": 6647,
"end_index": 6894
},
{
"type": "url_citation",
"title": "Get started with OpenAI GPT-5.6 Sol, Terra, and Luna on Amazon Bedrock",
"url": "https://aws.amazon.com/blogs/machine-learning/get-started-with-openai-gpt-5-6-sol-terra-and-luna-on-amazon-bedrock/",
"start_index": 6647,
"end_index": 6894
},
{
"type": "url_citation",
"title": "Inference using Responses API - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
"start_index": 7275,
"end_index": 7372
},
{
"type": "url_citation",
"title": "Inference using Responses API - Amazon Bedrock",
"url": "https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html",
"start_index": 8069,
"end_index": 8166
}
]
}
]
}
]








