CreateAgentActionGroup와 함께 사용 AWS SDK또는 CLI - Amazon Bedrock

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

CreateAgentActionGroup와 함께 사용 AWS SDK또는 CLI

다음 코드 예시에서는 CreateAgentActionGroup을 사용하는 방법을 보여 줍니다.

작업 예제는 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 다음 코드 예제에서는 컨텍스트 내에서 이 작업을 확인할 수 있습니다.

Python
SDK파이썬용 (보토3)
참고

더 많은 정보가 있습니다. GitHub 전체 예제를 찾아 설치 및 실행 방법을 알아보십시오. AWS 코드 예제 리포지토리.

에이전트 작업 그룹을 생성합니다.

def create_agent_action_group( self, name, description, agent_id, agent_version, function_arn, api_schema ): """ Creates an action group for an agent. An action group defines a set of actions that an agent should carry out for the customer. :param name: The name to give the action group. :param description: The description of the action group. :param agent_id: The unique identifier of the agent for which to create the action group. :param agent_version: The version of the agent for which to create the action group. :param function_arn: The ARN of the Lambda function containing the business logic that is carried out upon invoking the action. :param api_schema: Contains the OpenAPI schema for the action group. :return: Details about the action group that was created. """ try: response = self.client.create_agent_action_group( actionGroupName=name, description=description, agentId=agent_id, agentVersion=agent_version, actionGroupExecutor={"lambda": function_arn}, apiSchema={"payload": api_schema}, ) agent_action_group = response["agentActionGroup"] except ClientError as e: logger.error(f"Error: Couldn't create agent action group. Here's why: {e}") raise else: return agent_action_group
  • 자세한 API 내용은 CreateAgentActionGroup을 참조하십시오. AWS SDK파이썬 (Boto3) API 참조용.

전체 목록은 다음과 같습니다. AWS SDK개발자 가이드 및 코드 예제는 을 참조하십시오이 서비스를 다음과 함께 사용 AWS SDK. 이 항목에는 시작에 대한 정보와 이전 SDK 버전에 대한 세부 정보도 포함되어 있습니다.