This is a simple serverless agent that uses weather and location APIs to get the weather information for a given location.
It is built with Strands Agents SDK using http_request tool and AWS Bedrock with Amazon Nova Micro model integration.
- Python (v3.12 or later) (for the Python Lambda function)
- Node.js (v20 or later)
- Serverless Framework (v3 or later)
- AWS CLI (v2 or later)
- AWS Account (with IAM permissions to deploy Lambda functions)
- AWS credentials configured on your machine
Run the following commands to set up the project:
npm installUse the Serverless Framework to invoke the function locally. You can use the --data flag to pass a JSON object with the prompt field containing your query.
sls invoke local -f weather --data '{"prompt": "What is the weather in Seattle?"}'You can also use the region field (with option "US" or "IT") to specify the region for the weather query:
sls invoke local -f weather --data '{"prompt": "What is the weather in Pavia?", "region": "IT"}'Make sure you have configured your AWS credentials and have the necessary permissions to deploy Lambda functions.
You can read more about configuring AWS credentials in the AWS CLI documentation
or use the aws configure command to set them up interactively.
You can also use serverless framework to set up your AWS credentials by running:
sls config credentials --provider aws --key YOUR_AWS_ACCESS_KEY_ID --secret YOUR_AWS_SECRET_ACCESS_KEYThen, run the following command to deploy the function to AWS:
sls deploy