@@ -30,12 +30,15 @@ class TestNewCassetteFormat(unittest.IsolatedAsyncioTestCase):
3030 async def test_recording_persists_an_ordered_transcript_keyed_by_input (self ):
3131 response = AgentResponse (
3232 transcript = [
33- {"type" : "ai" , "tool_calls" : [{"name" : "job_search_tool" , "args" : {"query" : "python" }, "id" : "c1" }],
34- "uses" : {"input_token" : 117 , "output_token" : 22 , "cache_token" : 0 , "total_token" : 139 },
35- "response_time" : 12.0 },
36- {"type" : "tool_response" , "content_type" : "json" , "content" : "[{\" id\" : 2}]" , "response_time" : 5.0 },
33+ {
34+ "type" : "ai" ,
35+ "tool_calls" : [{"name" : "job_search_tool" , "args" : {"query" : "python" }, "id" : "c1" }],
36+ "uses" : {"input_token" : 117 , "output_token" : 22 , "cache_token" : 0 , "total_token" : 139 },
37+ "response_time" : 12.0 ,
38+ },
39+ {"type" : "tool_response" , "content_type" : "json" , "content" : '[{"id": 2}]' , "response_time" : 5.0 },
3740 ],
38- content = "[{ \ " id\ " : 2}]" ,
41+ content = '[{ "id": 2}]' ,
3942 tool_calls = [{"name" : "job_search_tool" , "args" : {"query" : "python" }, "id" : "c1" }],
4043 )
4144 with tempfile .TemporaryDirectory () as tmp :
@@ -57,11 +60,15 @@ async def test_recording_persists_an_ordered_transcript_keyed_by_input(self):
5760 async def test_replaying_a_new_format_cassette_reconstructs_tool_calls (self ):
5861 response = AgentResponse (
5962 transcript = [
60- {"type" : "ai" , "tool_calls" : [{"name" : "job_search_tool" , "args" : {"query" : "python" }, "id" : "c1" }],
61- "uses" : {"input_token" : 117 , "output_token" : 22 }, "response_time" : 12.0 },
62- {"type" : "tool_response" , "content_type" : "json" , "content" : "[{\" id\" : 2}]" , "response_time" : 5.0 },
63+ {
64+ "type" : "ai" ,
65+ "tool_calls" : [{"name" : "job_search_tool" , "args" : {"query" : "python" }, "id" : "c1" }],
66+ "uses" : {"input_token" : 117 , "output_token" : 22 },
67+ "response_time" : 12.0 ,
68+ },
69+ {"type" : "tool_response" , "content_type" : "json" , "content" : '[{"id": 2}]' , "response_time" : 5.0 },
6370 ],
64- content = "[{ \ " id\ " : 2}]" ,
71+ content = '[{ "id": 2}]' ,
6572 tool_calls = [{"name" : "job_search_tool" , "args" : {"query" : "python" }, "id" : "c1" }],
6673 )
6774 with tempfile .TemporaryDirectory () as tmp :
0 commit comments