Explorar el Código

Added an explicit update so that the log element displays after first llm call

Cam hace 1 año
padre
commit
3003fac7b4
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      examples/chat_with_ai/log_callback_handler.py

+ 1 - 0
examples/chat_with_ai/log_callback_handler.py

@@ -13,6 +13,7 @@ class NiceGuiLogElementCallbackHandler(BaseCallbackHandler):
 
 
     def print_text(self, message: str) -> None:
     def print_text(self, message: str) -> None:
         self.element.push(message)
         self.element.push(message)
+        self.element.update()
 
 
     def on_chain_start(
     def on_chain_start(
         self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any
         self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any