pangukitsappdev.callback package

Submodules

pangukitsappdev.callback.DebugConsoleCallbackHandler module

class pangukitsappdev.callback.DebugConsoleCallbackHandler.DebugConsoleCallbackHandler(**kwargs: Any)

基类:ConsoleCallbackHandler

Only for debug,打印解析后的prompt数据供调试使用

on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) Any

Start a trace for an LLM run.

on_text(text: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) Any

Run on arbitrary text.

pangukitsappdev.callback.StreamCallbackHandler module

class pangukitsappdev.callback.StreamCallbackHandler.StreamCallbackHandler

基类:BaseCallbackHandler

on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], **kwargs: Any) Any

对话模型开始时运行 :param serialized: 序列化model :param messages: 对话信息

on_llm_end(response: LLMResult, **kwargs: Any) Any

对话模型结束时运行 :param response: 模型结果

on_llm_error(error: BaseException, **kwargs: Any) Any

对话模型出错时运行 :param error: 异常信息

on_llm_new_token(token: str, **kwargs: Any) Any

流式每个新token生成时调用 :param token: 流式生成token

Module contents