mirror of
https://github.com/yv1ing/MollyAudit.git
synced 2025-09-16 14:55:50 +08:00
14 lines
323 B
Python
14 lines
323 B
Python
from langchain_core.callbacks import BaseCallbackHandler
|
|
|
|
|
|
class CustomCallbackHandler(BaseCallbackHandler):
|
|
def __init__(self):
|
|
self.temp_content = ''
|
|
|
|
def on_llm_new_token(self, token: str, **kwargs) -> None:
|
|
self.temp_content += token
|
|
|
|
def on_llm_end(self, response, **kwargs):
|
|
pass
|
|
|