Daniel Marques commited on
Commit
fac2b5c
1 Parent(s): 194045e

feat: add backend

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -37,10 +37,11 @@ class Delete(BaseModel):
37
  websocket_state = None
38
 
39
  class MyCustomSyncHandler(AsyncCallbackHandler):
40
- async def on_llm_new_token(self, token: str, **kwargs) -> None:
41
  print(f"{websocket_state}")
42
 
43
- await websocket_state.send_text(f"token: {token}")
 
44
 
45
  print(f"token: {token}")
46
 
 
37
  websocket_state = None
38
 
39
  class MyCustomSyncHandler(AsyncCallbackHandler):
40
+ def on_llm_new_token(self, token: str, **kwargs) -> None:
41
  print(f"{websocket_state}")
42
 
43
+ asyncio.sleep(1.5)
44
+ websocket_state.send_text(f"token: {token}")
45
 
46
  print(f"token: {token}")
47