stage10-amazon-bedrock-action-validation.py
TEXT FILE426 B · Public source code for developers, search crawlers and AI agents
1def validate(action, arguments):
2 if action != "bitcoin_balance" or arguments != {"net": "test", "type": "segwit"}:
3 raise ValueError("unsupported action")
4 return {"net": "test", "type": "segwit"}
5
6assert validate("bitcoin_balance", {"net": "test", "type": "segwit"})["net"] == "test"
7try:
8 validate("bitcoin_send", {})
9except ValueError:
10 pass
11else:
12 raise AssertionError("unexpected action accepted")Read-only source · Select a line number to link directly · Raw download above
