アクショングループ内でのエージェントの Computer Use ツールを指定する
CreateAgentActionGroup API オペレーションまたは UpdateAgentActionGroup API オペレーションで、エージェントが使用できるツールを指定できます。インラインエージェントの場合は、InvokeInlineAgent API オペレーションでツールを指定します。
アクショングループの parentActionGroupSignature で、次の値からツールタイプを指定します。
-
ANTHROPIC.Computer
-
ANTHROPIC.TextEditor
-
ANTHROPIC.Bash
次のコード例は、エージェントが使用する ANTHROPIC.Computer ツールを指定するアクショングループを作成する方法を説明しています。
def create_agent_action_group(client, agent_id, agent_version): """ Creates an action group that specifies the ANTHROPIC.Computer tool for the agent. Args: client: Boto3 bedrock-agent client agent_id (str): ID of the agent agent_version (str): Version of the agent Returns: dict: Response from create_agent_action_group API call """ try: response = client.create_agent_action_group( agentId=agent_id, agentVersion=agent_version, actionGroupName="my_computer", actionGroupState="ENABLED", parentActionGroupSignature="ANTHROPIC.Computer", parentActionGroupSignatureParams={ "type": "computer_20241022" } ) return response except ClientError as e: print(f"Error: {e}")