File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,6 @@ async def async_respond(self):
262
262
elif isinstance (chunk , BetaRawContentBlockDeltaEvent ):
263
263
if chunk .delta .type == "text_delta" :
264
264
md .feed (chunk .delta .text )
265
- yield {"type" : "chunk" , "chunk" : chunk .delta .text }
266
265
await asyncio .sleep (0 )
267
266
if current_block and current_block .type == "text" :
268
267
current_block .text += chunk .delta .text
@@ -291,7 +290,6 @@ async def async_respond(self):
291
290
delattr (current_block , "partial_json" )
292
291
else :
293
292
md .feed ("\n " )
294
- yield {"type" : "chunk" , "chunk" : "\n " }
295
293
await asyncio .sleep (0 )
296
294
297
295
for attr in [
@@ -305,6 +303,8 @@ async def async_respond(self):
305
303
response_content .append (current_block )
306
304
current_block = None
307
305
306
+ edit .close ()
307
+
308
308
response = BetaMessage (
309
309
id = str (uuid .uuid4 ()),
310
310
content = response_content ,
@@ -406,8 +406,6 @@ async def async_respond(self):
406
406
tool_result_content : list [BetaToolResultBlockParam ] = []
407
407
for content_block in cast (list [BetaContentBlock ], response .content ):
408
408
if content_block .type == "tool_use" :
409
- edit .close ()
410
-
411
409
if user_approval in ["y" , "a" ]:
412
410
result = await tool_collection .run (
413
411
name = content_block .name ,
Original file line number Diff line number Diff line change @@ -313,8 +313,9 @@ def flush(self):
313
313
pass # No need to flush since we render when we get a complete command
314
314
315
315
def close (self ):
316
- if self .json_obj and self .json_obj .get ("action" ) == "screenshot" :
317
- SchemaRenderer .print_separator ("┴" , newline = True )
316
+ if self .json_obj and self .json_obj .get ("name" ) == "computer" :
317
+ if set (self .json_obj .keys ()) == {"name" , "action" }:
318
+ SchemaRenderer .print_separator ("┴" , newline = True )
318
319
319
320
320
321
class InsertRenderer (ContentRenderer ):
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ readme = "README.md"
13
13
[tool .poetry .dependencies ]
14
14
15
15
# Required dependencies
16
- python = " >=3.8 ,<4"
16
+ python = " >=3.9 ,<4"
17
17
litellm = " ^1.52.3"
18
18
anthropic = " ^0.39.0"
19
19
pygments = " ^2.18.0"
@@ -23,6 +23,7 @@ prompt-toolkit = "^3.0.48"
23
23
pyte = " ^0.8.2"
24
24
screeninfo = " ^0.8.1"
25
25
readchar = " ^4.2.1"
26
+ pillow = " ^11.0.0"
26
27
27
28
[build-system ]
28
29
requires = [" poetry-core>=1.0.0" ]
You can’t perform that action at this time.
0 commit comments