OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  todozi:Todozi 艾森豪威尔矩阵管理 API 与 LangChain 工具集成

todozi:Todozi 艾森豪威尔矩阵管理 API 与 LangChain 工具集成

 
  sandbox ·  2026-02-18 11:29:08 · 3 次点击  · 0 条评论  

名称: todozi
描述: "Todozi 艾森豪威尔矩阵 API 客户端 + LangChain 工具。可创建矩阵、任务、目标、笔记;支持列表/搜索/更新;批量操作;Webhook 集成。分类包括:do(立即执行)、done(已完成)、dream(梦想/目标)、delegate(委派)、defer(推迟)、dont(不做)。"


Todozi

快速开始

作为 SDK 使用:

from skills.todozi.scripts.todozi import TodoziClient

client = TodoziClient(api_key="your_key")
matrices = await client.list_matrices()
task = await client.create_task("构建功能", priority="high")
await client.complete_item(task.id)

作为 LangChain 工具使用:

from skills.todozi.scripts.todozi import TODOZI_TOOLS
# 添加到智能体工具列表中

SDK 概览

类名 用途
TodoziClient 异步 API 客户端
TodoziTask 任务数据类
TodoziMatrix 矩阵数据类
TodoziStats 统计数据类

环境变量

export TODOZI_API_KEY=your_key
export TODOZI_BASE=https://todozi.com/api  # 可选,默认已提供

客户端方法

矩阵操作

# 列出所有矩阵
matrices = await client.list_matrices()

# 创建矩阵
matrix = await client.create_matrix("工作", category="do")

# 获取矩阵
matrix = await client.get_matrix("matrix_id")

# 删除矩阵
await client.delete_matrix("matrix_id")

任务 / 目标 / 笔记

# 创建任务
task = await client.create_task(
    title="评审 PR",
    priority="high",
    due_date="2026-02-01",
    description="检查新功能",
    tags=["pr", "review"],
)

# 创建目标
goal = await client.create_goal("发布 v2 版本", priority="high")

# 创建笔记
note = await client.create_note("记得给妈妈打电话")

# 获取项目
item = await client.get_item("item_id")

# 更新项目
updated = await client.update_item("item_id", {"title": "新标题", "priority": "low"})

# 完成项目
await client.complete_item("item_id")

# 删除项目
await client.delete_item("item_id")

列表查询

# 列出任务(支持过滤)
tasks = await client.list_tasks(status="todo", priority="high")

# 列出目标
goals = await client.list_goals()

# 列出笔记
notes = await client.list_notes()

# 列出所有项目
all_items = await client.list_all()

搜索

仅搜索: 标题、描述、标签(不搜索内容)

results = await client.search(
    query="pr",
    type_="task",          # task, goal 或 note
    status="pending",
    priority="high",
    category="do",
    tags=["review"],
    limit=10,
)

批量操作

# 批量更新
await client.bulk_update([
    {"id": "id1", "title": "已更新"},
    {"id": "id2", "priority": "low"},
])

# 批量完成
await client.bulk_complete(["id1", "id2"])

# 批量删除
await client.bulk_delete(["id1", "id2"])

Webhooks

# 创建 Webhook
webhook = await client.create_webhook(
    url="https://yoururl.com/todozi",
    events=["item.created", "item.completed"],
)

# 列出 Webhooks
webhooks = await client.list_webhooks()

# 更新 Webhook
await client.update_webhook(webhook_id, url, ["*"])

# 删除 Webhook
await client.delete_webhook(webhook_id)

系统功能

# 获取统计信息
stats = await client.get_stats()

# 健康检查
health = await client.health_check()

# 验证 API 密钥
valid = await client.validate_api_key()

# 注册(获取 API 密钥)
keys = await client.register(webhook="https://url.com")

LangChain 工具

本技能提供 @tool 装饰的函数,便于智能体集成:

from skills.todozi.scripts.todozi import TODOZI_TOOLS

# 可用工具:
# - todozi_create_task(title, priority, due_date, description, thread_id, tags)
# - todozi_list_tasks(status, priority, thread_id, limit)
# - todozi_complete_task(task_id)
# - todozi_get_stats()
# - todozi_search(query, type_, status, priority, limit)
# - todozi_list_matrices()

分类说明

分类 描述
do 立即执行(紧急且重要)
delegate 委派(紧急但不重要)
defer 推迟(不紧急但重要)
done 已完成项目
dream 目标/梦想(不紧急且不重要)
dont 不做(既不紧急也不重要)

常用模式

自动创建默认矩阵:

task = await client.create_task("我的任务")  # 若不存在,会自动创建“默认”矩阵

获取统计信息及完成率:

stats = await client.get_stats()
rate = stats.completed_tasks / stats.total_tasks * 100 if stats.total_tasks > 0 else 0

多条件搜索:

results = await client.search("feature", type_="task", status="pending", priority="high")

批量完成任务:

tasks = await client.list_tasks(status="todo")
ids = [t.id for t in tasks[:5]]
await client.bulk_complete(ids)
3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor