This commit is contained in:
@@ -74,14 +74,14 @@ async def test_tool_calling(agent_service):
|
||||
print(f"使用 user_id: {user_id}")
|
||||
|
||||
# 发送需要 RAG 搜索的问题
|
||||
print("\n发送消息: '请告诉我,打虎英雄是谁?'")
|
||||
print("\n发送消息: '请告诉我,黄双银在魔王大陆的故事?'")
|
||||
result = await agent_service.process_message(
|
||||
"请告诉我,打虎英雄是谁?", thread_id, "local", user_id
|
||||
"请告诉我,黄双银在魔王大陆的故事?", thread_id, "local", user_id
|
||||
)
|
||||
print(f"回复: {result['reply'][:200]}...")
|
||||
|
||||
# 检查是否调用了 RAG 工具(回复中会有水浒传相关内容)
|
||||
if "武松" in result['reply'] or "李忠" in result['reply'] or "水浒传" in result['reply']:
|
||||
# 检查是否调用了 RAG 工具(回复中会有黄双银相关内容)
|
||||
if "黄双银" in result['reply']:
|
||||
print("\n✅ 工具调用测试通过!")
|
||||
return True
|
||||
else:
|
||||
|
||||
@@ -20,14 +20,14 @@ async def test_index_builder():
|
||||
|
||||
# 创建 IndexBuilder 实例
|
||||
builder = IndexBuilder(
|
||||
collection_name="test_collection",
|
||||
collection_name="rag_documents",
|
||||
splitter_type=SplitterType.PARENT_CHILD,
|
||||
parent_chunk_size=1000,
|
||||
child_chunk_size=200
|
||||
)
|
||||
|
||||
# 测试文档路径
|
||||
test_file = os.path.join(os.path.dirname(__file__), "..", "data", "user_docs", "a.txt")
|
||||
test_file = os.path.join(os.path.dirname(__file__), "..", "data", "user_docs", "doublestory.txt")
|
||||
|
||||
if os.path.exists(test_file):
|
||||
# 构建索引
|
||||
|
||||
Reference in New Issue
Block a user