File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ def __init__(self, profile=None):
167
167
setattr (self , key , value )
168
168
169
169
self ._client = None
170
+ self ._spinner = yaspin (Spinners .simpleDots , text = "" )
170
171
171
172
def to_dict (self ):
172
173
"""Convert current settings to dictionary"""
@@ -230,8 +231,7 @@ async def async_respond(self):
230
231
max_tokens = model_info ["max_tokens" ]
231
232
232
233
while True :
233
- spinner = yaspin (Spinners .simpleDots , text = "" )
234
- spinner .start ()
234
+ self ._spinner .start ()
235
235
236
236
enable_prompt_caching = False
237
237
betas = [COMPUTER_USE_BETA_FLAG ]
@@ -267,7 +267,7 @@ async def async_respond(self):
267
267
268
268
for chunk in raw_response :
269
269
if first_token :
270
- spinner .stop ()
270
+ self . _spinner .stop ()
271
271
first_token = False
272
272
273
273
if isinstance (chunk , BetaRawContentBlockStartEvent ):
@@ -674,9 +674,11 @@ def chat(self):
674
674
675
675
print ()
676
676
except KeyboardInterrupt :
677
+ self ._spinner .stop ()
677
678
print ()
678
679
pass
679
680
except Exception as e :
681
+ self ._spinner .stop ()
680
682
print (traceback .format_exc ())
681
683
print ("\n \n \033 [91mAn error has occurred.\033 [0m" )
682
684
if sys .stdin .isatty (): # Only prompt if in interactive mode
You can’t perform that action at this time.
0 commit comments