fix callback use client_id (#993)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-04 12:53:55 -03:00 committed by GitHub
commit a308585d01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,8 +123,8 @@ class AsyncStreamingLLMCallbackHandler(AsyncCallbackHandler):
class StreamingLLMCallbackHandler(BaseCallbackHandler):
"""Callback handler for streaming LLM responses."""
def __init__(self, websocket):
self.websocket = websocket
def __init__(self, client_id: str):
self.client_id = client_id
def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
resp = ChatResponse(message=token, type="stream", intermediate_steps="")