= . = = = =2 = json
boto3
client boto3 ( )
model_id prompt formatted_prompt prompt response client (
modelId model_id,
body json. (
{
:prompt,
}
),
)
response_body json. (response[ ]. ())
(json. (response_json, indent , ensure_ascii False)) client invoke_model dumps loads read print dumps "bedrock-runtime", region_name="us-east-1" "arn:aws:bedrock:us-west-1:{先ほどのモデル}"
"東京都の歴史を説明してください"
"prompt" "body" f"""<s>[INST] Human: { }[/INST]
Assistant: """