INNER CODE UNIT · Python

lambda_handler

aws-samples/serverless-samples · apigw-ai-agents/strands-lambda/api-builder-agent/src/main.py:92

def lambda_handler(event, context):
    """
    Lambda function to generate OpenAPI specification, Infrastructure as Code template and code samples for API implementation
    """
    logger.info(f"Processing event: {json.dumps(event, default=str)}")

    try:
        request = event["request"]

        agent = Agent(
            model=bedrock_model, 
            system_prompt=SYSTEM_PROMPT,
            description="Agent that accepts API requirements and builds IaC, code placeholders and examples"
            )
        logger.info("Agent initialized successfully")

        response = agent(request)
        logger.info(f"Response: {response}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…