Files
Jordan Ritter 534cd1efa7 fix(showcase): D5 integration fixes across 12 frameworks
Per-framework fixes to pass D5 e2e-deep probes:
- agno: deduplicate agent_server routes
- claude-sdk-python: handle ParsedContentBlockStopEvent (SDK v0.97+)
- claude-sdk-typescript: remove orphan tool-rendering page
- crewai-crews: add backend tool_rendering agent + shared_state fix
- google-adk: add AGUIToolset to all ADK agents for frontend tools
- langgraph-typescript: remove stale import
- langroid: emit ToolCallResultEvent for backend tools + fix adapter
- llamaindex: v2 provider import, book_call stub, PYTHONPATH fix
- ms-agent-python: disable Responses API store for aimock compat
- pydantic-ai: simplify gen-ui page component
- spring-ai: raise tool iteration cap (1→5) + fix connection pooling
- strands: shared tools symlink + requirements update
2026-04-29 19:40:10 -07:00

62 lines
1.7 KiB
Python

"""Sales todos tool implementation."""
from __future__ import annotations
import uuid
from typing import Optional
from .types import SalesTodo
INITIAL_TODOS: list[SalesTodo] = [
SalesTodo(
id="st-001",
title="Follow up with Acme Corp on enterprise proposal",
stage="proposal",
value=85000,
dueDate="2026-04-15",
assignee="Sarah Chen",
completed=False,
),
SalesTodo(
id="st-002",
title="Qualify lead from TechFlow demo request",
stage="prospect",
value=42000,
dueDate="2026-04-18",
assignee="Mike Johnson",
completed=False,
),
SalesTodo(
id="st-003",
title="Send contract to DataViz Inc for final review",
stage="negotiation",
value=120000,
dueDate="2026-04-20",
assignee="Sarah Chen",
completed=False,
),
]
def manage_sales_todos_impl(todos: list[dict]) -> list[SalesTodo]:
"""Assign UUIDs to any todos missing an ID, then return the updated list."""
result: list[SalesTodo] = []
for todo in todos:
result.append(SalesTodo(
id=todo.get("id") or str(uuid.uuid4()),
title=todo.get("title", ""),
stage=todo.get("stage", "prospect"),
value=todo.get("value", 0),
dueDate=todo.get("dueDate", ""),
assignee=todo.get("assignee", ""),
completed=todo.get("completed", False),
))
return result
def get_sales_todos_impl(current_todos: Optional[list[dict]] = None) -> list[SalesTodo]:
"""Return current todos or initial defaults if none provided."""
if current_todos is not None:
return manage_sales_todos_impl(current_todos)
return list(INITIAL_TODOS)