MCPcopy Index your code
hub / github.com/google/adk-python / process_input

Function process_input

contributing/samples/workflows/nested_workflow/agent.py:25–32  ·  view source on GitHub ↗

Validates the input is a valid 4-digit year.

(node_input: str)

Source from the content-addressed store, hash-verified

23
24
25def process_input(node_input: str):
26 """Validates the input is a valid 4-digit year."""
27 match = re.search(r"\b\d{4}\b", node_input)
28 if not match:
29 yield Event(message="Please provide a valid 4-digit year (e.g., 1955).")
30 raise ValueError("Invalid year format.")
31
32 yield Event(state={"year": match.group(0)})
33
34
35find_name = Agent(

Callers

nothing calls this directly

Calls 3

EventClass · 0.90
searchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected