@@ -359,7 +359,7 @@ async def async_respond(self, user_input=None):
359
359
current_block .partial_json += chunk .delta .partial_json
360
360
361
361
if hasattr (current_block , "name" ):
362
- if edit .name == None :
362
+ if edit .name is None :
363
363
edit .name = current_block .name
364
364
edit .feed (chunk .delta .partial_json )
365
365
@@ -673,7 +673,7 @@ async def async_respond(self, user_input=None):
673
673
# Fix ollama
674
674
stream = False
675
675
actual_model = self .model .replace ("ollama/" , "openai/" )
676
- if self .api_base == None :
676
+ if self .api_base is None :
677
677
api_base = "http://localhost:11434/v1/"
678
678
else :
679
679
api_base = self .api_base
@@ -812,28 +812,28 @@ async def async_respond(self, user_input=None):
812
812
self ._spinner .stop ()
813
813
first_token = False
814
814
815
- if message == None :
815
+ if message is None :
816
816
message = chunk .choices [0 ].delta
817
817
818
818
if chunk .choices [0 ].delta .content :
819
819
md .feed (chunk .choices [0 ].delta .content )
820
820
await asyncio .sleep (0 )
821
821
822
- if message .content == None :
822
+ if message .content is None :
823
823
message .content = chunk .choices [0 ].delta .content
824
- elif chunk .choices [0 ].delta .content != None :
824
+ elif chunk .choices [0 ].delta .content is not None :
825
825
message .content += chunk .choices [0 ].delta .content
826
826
827
827
if chunk .choices [0 ].delta .tool_calls :
828
828
if chunk .choices [0 ].delta .tool_calls [0 ].id :
829
- if message .tool_calls == None or chunk .choices [
829
+ if message .tool_calls is None or chunk .choices [
830
830
0
831
831
].delta .tool_calls [0 ].id not in [
832
832
t .id for t in message .tool_calls
833
833
]:
834
834
edit .close ()
835
835
edit = ToolRenderer ()
836
- if message .tool_calls == None :
836
+ if message .tool_calls is None :
837
837
message .tool_calls = []
838
838
message .tool_calls .append (
839
839
chunk .choices [0 ].delta .tool_calls [0 ]
@@ -848,9 +848,9 @@ async def async_respond(self, user_input=None):
848
848
tool_name = (
849
849
chunk .choices [0 ].delta .tool_calls [0 ].function .name
850
850
)
851
- if edit .name == None :
851
+ if edit .name is None :
852
852
edit .name = tool_name
853
- if current_tool_call .function .name == None :
853
+ if current_tool_call .function .name is None :
854
854
current_tool_call .function .name = tool_name
855
855
if chunk .choices [0 ].delta .tool_calls [0 ].function .arguments :
856
856
arguments_delta = (
0 commit comments