Skip to content

Commit 4734135

Browse files
amihalikDouweM
andauthored
Handle include_pending=false for bank_support example (#1912)
Co-authored-by: Douwe Maan <douwe@pydantic.dev>
1 parent 1ed1073 commit 4734135

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/pydantic_ai_examples/bank_support.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ async def customer_name(cls, *, id: int) -> str | None:
2626

2727
@classmethod
2828
async def customer_balance(cls, *, id: int, include_pending: bool) -> float:
29-
if id == 123 and include_pending:
30-
return 123.45
29+
if id == 123:
30+
if include_pending:
31+
return 123.45
32+
else:
33+
return 100.00
3134
else:
3235
raise ValueError('Customer not found')
3336

0 commit comments

Comments
 (0)