@@ -1431,8 +1431,6 @@ def llm(messages: list[ModelMessage], info: AgentInfo) -> ModelResponse:
14311431 ToolCallPart ('get_price' , {'fruit' : 'grape' }, tool_call_id = 'get_price_grape' ),
14321432 ToolCallPart ('buy' , {'fruit' : 'apple' }, tool_call_id = 'buy_apple' ),
14331433 ToolCallPart ('buy' , {'fruit' : 'banana' }, tool_call_id = 'buy_banana' ),
1434- ToolCallPart ('buy' , {'fruit' : 'pear' }, tool_call_id = 'buy_pear' ),
1435- ToolCallPart ('buy' , {'fruit' : 'grape' }, tool_call_id = 'buy_grape' ),
14361434 ]
14371435 )
14381436 else :
@@ -1480,10 +1478,8 @@ def buy(fruit: str):
14801478 ToolCallPart (tool_name = 'get_price' , args = {'fruit' : 'grape' }, tool_call_id = 'get_price_grape' ),
14811479 ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'apple' }, tool_call_id = 'buy_apple' ),
14821480 ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'banana' }, tool_call_id = 'buy_banana' ),
1483- ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'pear' }, tool_call_id = 'buy_pear' ),
1484- ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'grape' }, tool_call_id = 'buy_grape' ),
14851481 ],
1486- usage = RequestUsage (input_tokens = 68 , output_tokens = 40 ),
1482+ usage = RequestUsage (input_tokens = 68 , output_tokens = 30 ),
14871483 model_name = 'function:llm:' ,
14881484 timestamp = IsDatetime (),
14891485 ),
@@ -1532,8 +1528,6 @@ def buy(fruit: str):
15321528 calls = [
15331529 ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'apple' }, tool_call_id = 'buy_apple' ),
15341530 ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'banana' }, tool_call_id = 'buy_banana' ),
1535- ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'pear' }, tool_call_id = 'buy_pear' ),
1536- ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'grape' }, tool_call_id = 'buy_grape' ),
15371531 ],
15381532 )
15391533 )
@@ -1548,16 +1542,6 @@ def buy(fruit: str):
15481542 content = 'I bought a banana' ,
15491543 metadata = {'fruit' : 'banana' , 'price' : 100.0 },
15501544 ),
1551- 'buy_pear' : ToolReturn (
1552- return_value = True ,
1553- content = 'I bought a pear' ,
1554- metadata = {'fruit' : 'pear' , 'price' : 100.0 },
1555- ),
1556- 'buy_grape' : ToolReturn (
1557- return_value = True ,
1558- content = 'I bought a grape' ,
1559- metadata = {'fruit' : 'grape' , 'price' : 100.0 },
1560- ),
15611545 },
15621546 ),
15631547 )
@@ -1579,10 +1563,8 @@ def buy(fruit: str):
15791563 ToolCallPart (tool_name = 'get_price' , args = {'fruit' : 'grape' }, tool_call_id = 'get_price_grape' ),
15801564 ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'apple' }, tool_call_id = 'buy_apple' ),
15811565 ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'banana' }, tool_call_id = 'buy_banana' ),
1582- ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'pear' }, tool_call_id = 'buy_pear' ),
1583- ToolCallPart (tool_name = 'buy' , args = {'fruit' : 'grape' }, tool_call_id = 'buy_grape' ),
15841566 ],
1585- usage = RequestUsage (input_tokens = 68 , output_tokens = 40 ),
1567+ usage = RequestUsage (input_tokens = 68 , output_tokens = 30 ),
15861568 model_name = 'function:llm:' ,
15871569 timestamp = IsDatetime (),
15881570 ),
@@ -1622,25 +1604,11 @@ def buy(fruit: str):
16221604 ),
16231605 ToolReturnPart (
16241606 tool_name = 'buy' ,
1625- content = 'I bought a banana' ,
1607+ content = True ,
16261608 tool_call_id = 'buy_banana' ,
16271609 metadata = {'fruit' : 'banana' , 'price' : 100.0 },
16281610 timestamp = IsDatetime (),
16291611 ),
1630- ToolReturnPart (
1631- tool_name = 'buy' ,
1632- content = True ,
1633- tool_call_id = 'buy_pear' ,
1634- metadata = {'fruit' : 'pear' , 'price' : 100.0 },
1635- timestamp = IsDatetime (),
1636- ),
1637- ToolReturnPart (
1638- tool_name = 'buy' ,
1639- content = True ,
1640- tool_call_id = 'buy_grape' ,
1641- metadata = {'fruit' : 'grape' , 'price' : 100.0 },
1642- timestamp = IsDatetime (),
1643- ),
16441612 UserPromptPart (
16451613 content = [
16461614 'The price of apple is 10.0.' ,
@@ -1649,18 +1617,14 @@ def buy(fruit: str):
16491617 timestamp = IsDatetime (),
16501618 ),
16511619 UserPromptPart (
1652- content = 'I bought a pear' ,
1653- timestamp = IsDatetime (),
1654- ),
1655- UserPromptPart (
1656- content = 'I bought a grape' ,
1620+ content = 'I bought a banana' ,
16571621 timestamp = IsDatetime (),
16581622 ),
16591623 ]
16601624 ),
16611625 ModelResponse (
16621626 parts = [TextPart (content = 'Done!' )],
1663- usage = RequestUsage (input_tokens = 133 , output_tokens = 41 ),
1627+ usage = RequestUsage (input_tokens = 124 , output_tokens = 31 ),
16641628 model_name = 'function:llm:' ,
16651629 timestamp = IsDatetime (),
16661630 ),
0 commit comments