@@ -66,7 +66,7 @@ async def get(self):
66
66
history = ChatHistory (
67
67
messages = self .chat_history , pending_messages = self .pending_messages
68
68
)
69
- self .finish (history .json ())
69
+ self .finish (history .model_dump_json ())
70
70
71
71
72
72
class RootChatHandler (JupyterHandler , websocket .WebSocketHandler ):
@@ -494,7 +494,7 @@ def get(self):
494
494
495
495
# Finally, yield response.
496
496
response = ListProvidersResponse (providers = providers )
497
- self .finish (response .json ())
497
+ self .finish (response .model_dump_json ())
498
498
499
499
500
500
class EmbeddingsModelProviderHandler (ProviderHandler ):
@@ -517,7 +517,7 @@ def get(self):
517
517
providers = sorted (providers , key = lambda p : p .name )
518
518
519
519
response = ListProvidersResponse (providers = providers )
520
- self .finish (response .json ())
520
+ self .finish (response .model_dump_json ())
521
521
522
522
523
523
class GlobalConfigHandler (BaseAPIHandler ):
@@ -535,7 +535,7 @@ def get(self):
535
535
if not config :
536
536
raise HTTPError (500 , "No config found." )
537
537
538
- self .finish (config .json ())
538
+ self .finish (config .model_dump_json ())
539
539
540
540
@web .authenticated
541
541
def post (self ):
@@ -587,7 +587,7 @@ def get(self):
587
587
588
588
# if no selected LLM, return an empty response
589
589
if not self .config_manager .lm_provider :
590
- self .finish (response .json ())
590
+ self .finish (response .model_dump_json ())
591
591
return
592
592
593
593
for id , chat_handler in self .chat_handlers .items ():
@@ -616,7 +616,7 @@ def get(self):
616
616
617
617
# sort slash commands by slash id and deliver the response
618
618
response .slash_commands .sort (key = lambda sc : sc .slash_id )
619
- self .finish (response .json ())
619
+ self .finish (response .model_dump_json ())
620
620
621
621
622
622
class AutocompleteOptionsHandler (BaseAPIHandler ):
@@ -640,7 +640,7 @@ def get(self):
640
640
641
641
# if no selected LLM, return an empty response
642
642
if not self .config_manager .lm_provider :
643
- self .finish (response .json ())
643
+ self .finish (response .model_dump_json ())
644
644
return
645
645
646
646
partial_cmd = self .get_query_argument ("partialCommand" , None )
@@ -666,7 +666,7 @@ def get(self):
666
666
response .options = (
667
667
self ._get_slash_command_options () + self ._get_context_provider_options ()
668
668
)
669
- self .finish (response .json ())
669
+ self .finish (response .model_dump_json ())
670
670
671
671
def _get_slash_command_options (self ) -> List [ListOptionsEntry ]:
672
672
options = []
0 commit comments