Especificación de las herramientas de uso del equipo para el agente en un grupo de acciones
Puede especificar las herramientas disponibles para el agente en la operación de la API CreateAgentActionGroup o UpdateAgentActionGroup. Para los agentes insertados, la herramienta se especifica en la operación de la API InvokeInlineAgent.
En parentActionGroupSignature del grupo de acciones, se especifica el tipo de herramienta desde los siguientes valores:
-
ANTHROPIC.Computer
-
ANTHROPIC.TextEditor
-
ANTHROPIC.Bash
En los siguientes ejemplos de código se muestra cómo crear un grupo de acciones que especifique la herramienta ANTHROPIC.Computer que debe usar el agente.
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}")