

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# アクショングループ内でのエージェントの Computer Use ツールを指定する
<a name="agent-computer-use-create-action-group"></a>

 [CreateAgentActionGroup](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html) API オペレーションまたは [UpdateAgentActionGroup](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html) API オペレーションで、エージェントが使用できるツールを指定できます。インラインエージェントの場合は、[InvokeInlineAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeInlineAgent.html) 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}")
```