先决条件

以下示例需要 trello 库和 Trello API 凭据,这些凭据可以通过遵循 Trello 的开发者文档获得。

pip install -U trello

设置以下环境变量:

export TRELLO_API_KEY="YOUR_API_KEY"
export TRELLO_API_SECRET="YOUR_API_SECRET"
export TRELLO_TOKEN="YOUR_TOKEN"

示例

下面的代理将创建一个名为 ai-agent 的看板,并在其中创建名为 tododoing 的列表,然后在每个列表中创建名为 create agent 的卡片。

from agno.agent import Agent
from agno.tools.trello import TrelloTools

agent = Agent(
    instructions=[
        "You are a Trello management assistant that helps organize and manage Trello boards, lists, and cards",
        "Help users with tasks like:",
        "- Creating and organizing boards, lists, and cards",
        "- Moving cards between lists",
        "- Retrieving board and list information",
        "- Managing card details and descriptions",
        "Always confirm successful operations and provide relevant board/list/card IDs and URLs",
        "When errors occur, provide clear explanations and suggest solutions",
    ],
    tools=[TrelloTools()],
    show_tool_calls=True,
)

agent.print_response(
    "Create a board called ai-agent and inside it create list called 'todo' and 'doing' and inside each of them create card called 'create agent'",
    stream=True,
)

Toolkit 功能

FunctionDescription
create_card在指定的看板和列表中创建新卡片。
get_board_lists获取指定 Trello 看板上的所有列表。
move_card将卡片移动到不同的列表。
get_cards从指定的列表中检索所有卡片。
create_board创建一个新的 Trello 看板。
create_list在指定的看板上创建新列表。
list_boards列出已认证用户可访问的所有 Trello 看板。

Toolkit 参数

这些参数会传递给 TrelloTools 构造函数。

ParameterTypeDefaultDescription
api_keyOptional[str]NoneTrello API 密钥。默认为 TRELLO_API_KEY 环境变量。
api_secretOptional[str]NoneTrello API 密钥。默认为 TRELLO_API_SECRET 环境变量。
tokenOptional[str]NoneTrello token。默认为 TRELLO_TOKEN 环境变量。
create_cardboolTrue启用 create_card 工具。
get_board_listsboolTrue启用 get_board_lists 工具。
move_cardboolTrue启用 move_card 工具。
get_cardsboolTrue启用 get_cards 工具。
create_boardboolTrue启用 create_board 工具。
create_listboolTrue启用 create_list 工具。
list_boardsboolTrue启用 list_boards 工具。

list_boards 的看板筛选选项

list_boards 函数接受一个 board_filter 参数,该参数有以下选项:

  • all (默认)
  • open
  • closed
  • organization
  • public
  • starred

开发者资源