Provide sample LongRunningFunctionTool runner script and documentation

PiperOrigin-RevId: 764475345
This commit is contained in:
Selcuk Gun
2025-05-28 16:59:16 -07:00
committed by Copybara-Service
parent 2a8ca06c3e
commit 609b3a572c
3 changed files with 245 additions and 2 deletions

View File

@@ -22,14 +22,20 @@ from google.genai import types
def reimburse(purpose: str, amount: float) -> str:
"""Reimburse the amount of money to the employee."""
return {'status': 'ok'}
return {
'status': 'ok',
}
def ask_for_approval(
purpose: str, amount: float, tool_context: ToolContext
) -> dict[str, Any]:
"""Ask for approval for the reimbursement."""
return {'status': 'pending'}
return {
'status': 'pending',
'amount': amount,
'ticketId': 'reimbursement-ticket-001',
}
root_agent = Agent(