refactor: plugins dir + opt-in langfuse via __getattr__ guard
- mv langfuse_tracing.py -> plugins/langfuse_tracing.py - llmcore: load plugin lazily inside __getattr__ when langfuse_config present (PEP 562 module __getattr__ naturally fires only once after globals().update) - llmcore: extract _record_usage() from 4 scattered [Cache] print sites - agentmain: /resume scans only latest 10 files
This commit is contained in:
@@ -111,7 +111,7 @@ class GeneraticAgent:
|
||||
display_queue.put({'done': smart_format(f"✅ session.{k} = {repr(v)}", max_str_len=500), 'source': 'system'})
|
||||
return None
|
||||
if raw_query.strip() == '/resume':
|
||||
return r'用re.findall(r"<history>\\n\[(?:USER\|Agent)\].*?</history>", content, re.DOTALL) 扫temp/model_responses/下各文件(除本PID),取每文件最后一个匹配(注意JSON里换行是字面\\n)作为该会话内容,按mtime倒序,每个用一句话总结聊了什么让我选择;选定后再简单读该文件末尾作为聊天基础'
|
||||
return r'用re.findall(r"<history>\\n\[(?:USER\|Agent)\].*?</history>", content, re.DOTALL) 扫temp/model_responses/下时间最近的10个文件(除本PID),取每文件最后一个匹配(注意JSON里换行是字面\\n)作为该会话内容,按mtime倒序,每个用一句话总结聊了什么让我选择;选定后再简单读该文件末尾作为聊天基础'
|
||||
return raw_query
|
||||
|
||||
def run(self):
|
||||
|
||||
Reference in New Issue
Block a user