24 lines
609 B
Python
24 lines
609 B
Python
|
|
import sys
|
||
|
|
import os
|
||
|
|
|
||
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||
|
|
|
||
|
|
from app import read_document_content
|
||
|
|
|
||
|
|
doc_id = '3cac70d6-cd02-493e-a08a-c7794927e7b4'
|
||
|
|
|
||
|
|
print(f"=== 测试文档读取功能 ===\n")
|
||
|
|
print(f"文档ID: {doc_id}\n")
|
||
|
|
|
||
|
|
content = read_document_content(doc_id)
|
||
|
|
|
||
|
|
if content:
|
||
|
|
print(f"✓ 成功读取文档内容")
|
||
|
|
print(f"内容长度: {len(content)} 字符")
|
||
|
|
print(f"\n前200字符:")
|
||
|
|
print(content[:200])
|
||
|
|
print("\n✓ 文档读取功能正常!")
|
||
|
|
else:
|
||
|
|
print("✗ 未能读取文档内容")
|
||
|
|
print("请检查文件是否存在或格式是否正确")
|