> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Lambda

## 前提条件

以下示例需要 `boto3` 库。

```shell theme={null}
pip install openai boto3
```

## 示例

下面的代理将使用 AWS Lambda 列出我们 AWS 账户中的所有 Lambda 函数，并调用一个特定的 Lambda 函数。

```python cookbook/tools/aws_lambda_tools.py theme={null}

from agno.agent import Agent
from agno.tools.aws_lambda import AWSLambdaTools


# 创建一个包含 AWSLambdaTool 的 Agent
agent = Agent(
    tools=[AWSLambdaTools(region_name="us-east-1")],
    name="AWS Lambda Agent",
    show_tool_calls=True,
)

# 示例 1：列出所有 Lambda 函数
agent.print_response("List all Lambda functions in our AWS account", markdown=True)

# 示例 2：调用一个特定的 Lambda 函数
agent.print_response("Invoke the 'hello-world' Lambda function with an empty payload", markdown=True)
```

## Toolkit 参数

| 参数            | 类型    | 默认值           | 描述                     |
| ------------- | ----- | ------------- | ---------------------- |
| `region_name` | `str` | `"us-east-1"` | Lambda 函数所在的 AWS 区域名称。 |

## Toolkit 函数

| 函数                | 描述                                                                    |
| ----------------- | --------------------------------------------------------------------- |
| `list_functions`  | 列出 AWS 账户中所有可用的 Lambda 函数。                                            |
| `invoke_function` | 使用可选的 payload 调用一个特定的 Lambda 函数。接受 `function_name` 和可选的 `payload` 参数。 |

## 开发者资源

* 查看 [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/aws_lambda.py)
* 查看 [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/tools/aws_lambda_tools.py)
