Files
agents-from-scratch-ts/python/tools/default/email_tools.py
T
2025-04-29 14:58:04 -07:00

20 lines
605 B
Python

from typing import Literal
from pydantic import BaseModel
from langchain_core.tools import tool
@tool
def write_email(to: str, subject: str, content: str) -> str:
"""Write and send an email."""
# Placeholder response - in real app would send email
return f"Email sent to {to} with subject '{subject}'"
@tool
def triage_email(category: Literal["ignore", "notify", "respond"]) -> str:
"""Triage an email into one of three categories: ignore, notify, respond."""
return f"Classification Decision: {category}"
@tool
class Done(BaseModel):
"""E-mail has been sent."""
done: bool