File size: 1,270 Bytes
81e3673
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

import os
import sys
from unittest.mock import MagicMock

# Fix path
sys.path.append(os.path.join(os.getcwd(), 'backend'))
sys.path.append(os.getcwd())

# Mock
sys.modules['anthropic'] = MagicMock()
sys.modules['google.generativeai'] = MagicMock()
sys.modules['zhipuai'] = MagicMock()
sys.modules['instructor'] = MagicMock()

def test_debug():
    try:
        from enhanced_ai_workflow_endpoints import RealAIWorkflowService
        print("Class imported successfully.")
        print("Attributes in RealAIWorkflowService:")
        found = False
        for x in dir(RealAIWorkflowService):
            if "get_" in x:
                print(f" - {x}")
                if "get_session" in x: found = True
        
        if not found:
            print("CRITICAL: get_session NOT found in dir()")
                
        service = RealAIWorkflowService()
        print("Instance created.")
        try:
            service.get_session("test")
            print("get_session called successfully.")
        except Exception as e:
            print(f"get_session failed: {e}")

    except ImportError as e:
        print(f"ImportError: {e}")
    except Exception as e:
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    test_debug()