You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
#!/usr/bin/env python3
|
|
"""
|
|
测试修复后的查询功能
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
from deepsearcher.configuration import Configuration, init_config
|
|
from deepsearcher.online_query import query
|
|
|
|
def test_query_fix():
|
|
"""测试修复后的查询功能"""
|
|
print("=== 测试修复后的查询功能 ===")
|
|
|
|
# 初始化配置
|
|
config = Configuration()
|
|
init_config(config)
|
|
|
|
try:
|
|
print("开始查询...")
|
|
result_text, retrieval_results = query("什么是Milvus?", max_iter=1)
|
|
|
|
print(f"查询完成!")
|
|
print(f"结果长度: {len(result_text) if result_text else 0}")
|
|
print(f"检索结果数量: {len(retrieval_results) if retrieval_results else 0}")
|
|
|
|
if result_text:
|
|
print(f"结果预览: {result_text[:200]}...")
|
|
|
|
except Exception as e:
|
|
import traceback
|
|
print(f"查询失败: {e}")
|
|
print(f"错误详情: {traceback.format_exc()}")
|
|
|
|
if __name__ == "__main__":
|
|
test_query_fix()
|
|
|