#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
测试版本 - 逐步排查问题
"""
print("Step 0: Script started")

import json
print("Step 1: json imported")

import os
print("Step 2: os imported")

import sys
print("Step 3: sys imported")

import time
print("Step 4: time imported")

import asyncio
print("Step 5: asyncio imported")

from pathlib import Path
print("Step 6: Path imported")

from typing import List, Dict, Any
print("Step 7: typing imported")

# 不设置编码，看看是否是编码问题
print("Step 8: About to add path")

sys.path.insert(0, str(Path(__file__).parent.parent.parent))
print("Step 9: Path added")

from dotenv import load_dotenv
print("Step 10: dotenv imported")

project_root = Path(__file__).parent.parent.parent
env_path = project_root / '.env'
load_dotenv(env_path)
print(f"Step 11: .env loaded from {env_path}")

print("Step 12: About to import PostgreSQLStore")
from knowhub.knowhub_db.pg_store import PostgreSQLStore
print("Step 13: PostgreSQLStore imported")

print("Step 14: About to import embeddings")
from knowhub.embeddings import get_embedding
print("Step 15: embeddings imported")

print("Step 16: About to import qwen")
from agent.llm.qwen import qwen_llm_call
print("Step 17: qwen imported")

print("\n=== All imports successful! ===")
print("Script can proceed normally.")
