AWS Lambda
Prerequisites
The following example requires the boto3 library.
1uv pip install openai boto3Example
The following agent will use AWS Lambda to list all Lambda functions in our AWS account and invoke a specific Lambda function.
1from kern.agent import Agent2from kern.tools.aws_lambda import AWSLambdaTools34# Create an Agent with the AWSLambdaTool5agent = Agent(6 tools=[AWSLambdaTools(region_name="us-east-1")],7 name="AWS Lambda Agent",8 )910# Example 1: List all Lambda functions11agent.print_response("List all Lambda functions in our AWS account", markdown=True)1213# Example 2: Invoke a specific Lambda function14agent.print_response("Invoke the 'hello-world' Lambda function with an empty payload", markdown=True)Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
region_name | str | "us-east-1" | AWS region name where Lambda functions are located. |
enable_list_functions | bool | True | Enable the list_functions functionality. |
enable_invoke_function | bool | True | Enable the invoke_function functionality. |
all | bool | False | Enable all functionality. |
Toolkit Functions
| Function | Description |
|---|---|
list_functions | Lists all Lambda functions available in the AWS account. |
invoke_function | Invokes a specific Lambda function with an optional payload. Takes function_name and optional payload parameters. |
Developer Resources
- View Tools