@ -84,12 +84,13 @@ class LLModelPromptContext(ctypes.Structure):
( " repeat_last_n " , ctypes . c_int32 ) ,
( " repeat_last_n " , ctypes . c_int32 ) ,
( " context_erase " , ctypes . c_float ) ]
( " context_erase " , ctypes . c_float ) ]
PromptCallback = ctypes . CFUNCTYPE ( ctypes . c_bool , ctypes . c_int32 )
ResponseCallback = ctypes . CFUNCTYPE ( ctypes . c_bool , ctypes . c_int32 , ctypes . c_char_p )
ResponseCallback = ctypes . CFUNCTYPE ( ctypes . c_bool , ctypes . c_int32 , ctypes . c_char_p )
RecalculateCallback = ctypes . CFUNCTYPE ( ctypes . c_bool , ctypes . c_bool )
RecalculateCallback = ctypes . CFUNCTYPE ( ctypes . c_bool , ctypes . c_bool )
llmodel . llmodel_prompt . argtypes = [ ctypes . c_void_p ,
llmodel . llmodel_prompt . argtypes = [ ctypes . c_void_p ,
ctypes . c_char_p ,
ctypes . c_char_p ,
ResponseCallback,
PromptCallback,
ResponseCallback ,
ResponseCallback ,
RecalculateCallback ,
RecalculateCallback ,
ctypes . POINTER ( LLModelPromptContext ) ]
ctypes . POINTER ( LLModelPromptContext ) ]
@ -218,7 +219,7 @@ class LLModel:
llmodel . llmodel_prompt ( self . model ,
llmodel . llmodel_prompt ( self . model ,
prompt ,
prompt ,
Response Callback( self . _prompt_callback ) ,
Prompt Callback( self . _prompt_callback ) ,
ResponseCallback ( self . _response_callback ) ,
ResponseCallback ( self . _response_callback ) ,
RecalculateCallback ( self . _recalculate_callback ) ,
RecalculateCallback ( self . _recalculate_callback ) ,
context )
context )
@ -232,7 +233,7 @@ class LLModel:
# Empty prompt callback
# Empty prompt callback
@staticmethod
@staticmethod
def _prompt_callback ( token_id , response ):
def _prompt_callback ( token_id ):
return True
return True
# Empty response callback method that just prints response to be collected
# Empty response callback method that just prints response to be collected