MCPcopy Create free account
hub / github.com/CopilotKit/OpenGenerativeUI / manage_todos

Function manage_todos

apps/agent/src/todos.py:19–37  ·  view source on GitHub ↗

Manage the current todos.

(todos: list[Todo], runtime: ToolRuntime)

Source from the content-addressed store, hash-verified

17
18@tool
19def manage_todos(todos: list[Todo], runtime: ToolRuntime) -> Command:
20 """
21 Manage the current todos.
22 """
23 # Ensure all todos have IDs that are unique
24 for todo in todos:
25 if "id" not in todo or not todo["id"]:
26 todo["id"] = str(uuid.uuid4())
27
28 # Update the state
29 return Command(update={
30 "todos": todos,
31 "messages": [
32 ToolMessage(
33 content="Successfully updated todos",
34 tool_call_id=runtime.tool_call_id
35 )
36 ]
37 })
38
39@tool
40def get_todos(runtime: ToolRuntime):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected