Complete the basic process of code audit

This commit is contained in:
2025-02-09 00:59:35 +08:00
parent eaff2123e7
commit 32e61b8d24
7 changed files with 244 additions and 1 deletions

13
audit/callback.py Normal file
View File

@@ -0,0 +1,13 @@
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