mirror of
				https://github.com/yv1ing/MollyAudit.git
				synced 2025-09-16 14:55:50 +08:00 
			
		
		
		
	Complete the basic process of code audit
This commit is contained in:
		
							
								
								
									
										13
									
								
								audit/callback.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								audit/callback.py
									
									
									
									
									
										Normal 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 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user