- Intent classification with LLM structured output (single/multi/ambiguous) - Discount agent with apply_discount and generate_coupon tools - Interrupt manager with 30-min TTL auto-expiration and retry prompts - Webhook escalation module with exponential backoff retry (max 3) - Three vertical industry templates (e-commerce, SaaS, fintech) - Template loading in AgentRegistry - Enhanced supervisor prompt with dynamic agent descriptions - 153 tests passing, 90.18% coverage
20 lines
718 B
Python
20 lines
718 B
Python
"""Fallback agent tools -- handles unmatched intents and clarification requests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from langchain_core.tools import tool
|
|
|
|
|
|
@tool
|
|
def fallback_respond(query: str) -> str:
|
|
"""Provide a helpful response when the user's intent doesn't match a specific agent."""
|
|
return (
|
|
"I'm here to help with order inquiries and actions. "
|
|
"Here's what I can do:\n"
|
|
"- Check order status (e.g., 'What is the status of order 1042?')\n"
|
|
"- Get tracking information (e.g., 'Track order 1042')\n"
|
|
"- Cancel an order (e.g., 'Cancel order 1042')\n"
|
|
"- Apply discounts or generate coupons\n\n"
|
|
"Could you please rephrase your request?"
|
|
)
|