rights reserved. Amazon Confidential and Trademark. 60 Bedrock Converse API LLM との Request/Response, ToolUse の Input, Output を message 配列として組み立て、 Amazon Bedrock の Converse API に送信することで、AI エージェントの動作を実現します [ { "role": "user", "content": [{"text": "東京都墨田区の天気は?"}], }, { "role": "assistant", "content": [ { "toolUse": { "input": {"city": "墨田区", "prefecture": "東京都"}, "name": "get_weather", "toolUseId": "tooluse_UwHeZGCnSQusfLrwCp9CcQ", } }, ], }, { "role": "user", "content": [ { "toolResult": { "content": [{"text": "東京都, 墨田区 の天気は晴れで,最高気温は22度です."}] "toolUseId": "tooluse_UwHeZGCnSQusfLrwCp9CcQ", } } ], }, { "role": "assistant", "content": [ { "text": "分かりました。東京都墨田区の天気は晴れで、最高気温は22度だそうです。晴れの天気で気温も高め なので、過ごしやすい1日になりそうですね。外出する際は軽めの服装がおすすめです。" } ], }, ] 0 1 2 3 ・・・ ユーザーからのメッセージ ・LLM のレスポンス ・ToolUse のインプット ・ToolUse で指定された関数実行結果 ・ToolUse のアウトプット LLM からのメッセージ