Files

32 lines
978 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""端到端验证:大模型 + 知识库生成回复(不真发,不写真实好友历史)。"""
import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
try:
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
except AttributeError:
pass
import wechat_ai_reply as eng
questions = [
"你好,你们能做抖音数据采集吗?",
"你们公司是做什么业务的?",
"帮我看看有没有浏览器自动化的工具",
]
for q in questions:
kb = eng._kb.search(q)
print("\n===== 客户问: %s =====" % q)
print("知识库命中: %s" % ("是" if kb else "否"))
if kb:
head = kb.strip().split("\n", 1)[0][:60]
print(" 命中笔记: %s ..." % head)
if eng._llm.available:
msgs, kb_hit = eng._build_messages("wxid_verify_demo", q)
reply = eng._llm.chat(msgs)
print("LLM 回复: %s" % reply)
print("-" * 60)