tool_def = FunctionDefinition(
name="end_call",
description="End the conversation ONLY when the user explicitly says goodbye, farewell, or clearly indicates they want to end the call (e.g., 'bye', 'goodbye', 'talk to you later', 'I'm hanging up'). Do NOT end the call for brief responses like 'thanks', 'okay', 'got it', or simple acknowledgments - just return to listening mode instead.",
parameters=FunctionParameters(
type="object",
properties={
"farewell_message": FunctionProperty(
type="string",
description="Final message to say before ending the call",
),
"reason": FunctionProperty(
type="string",
description="Why the call is ending (e.g., 'user said goodbye', 'conversation concluded', 'user requested to end')",
),
},
required=["farewell_message", "reason"],
),
)