File size: 1,908 Bytes
b4ea9c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3

import sys
import pkg_resources

print("πŸ” Version Information:")
print(f"Python: {sys.version}")
print()

packages_to_check = [
    'gradio', 'gradio-client', 'pydantic', 'pydantic-core', 
    'langchain', 'langchain-core', 'langgraph', 'typing-extensions',
    'fastapi', 'starlette', 'uvicorn'
]

for package in packages_to_check:
    try:
        version = pkg_resources.get_distribution(package).version
        print(f"{package}: {version}")
    except pkg_resources.DistributionNotFound:
        print(f"{package}: NOT INSTALLED")
    except Exception as e:
        print(f"{package}: ERROR - {e}")

print()
print("πŸ” Critical Type Checking:")
try:
    from typing_extensions import TypedDict
    print("βœ… TypedDict import successful")
except Exception as e:
    print(f"❌ TypedDict import failed: {e}")

try:
    from pydantic import BaseModel, Field
    print("βœ… Pydantic imports successful")
    
    # Test schema generation
    class TestModel(BaseModel):
        name: str = Field(description="Test field")
    
    schema = TestModel.model_json_schema()
    print(f"βœ… Pydantic schema generation successful: {type(schema)}")
    
    # Check for boolean values in schema
    def check_schema_values(obj, path=""):
        if isinstance(obj, dict):
            for k, v in obj.items():
                if isinstance(v, bool):
                    print(f"πŸ” Found boolean in schema at {path}.{k}: {v}")
                elif isinstance(v, (dict, list)):
                    check_schema_values(v, f"{path}.{k}")
        elif isinstance(obj, list):
            for i, item in enumerate(obj):
                if isinstance(item, (dict, list)):
                    check_schema_values(item, f"{path}[{i}]")
    
    check_schema_values(schema)
    
except Exception as e:
    print(f"❌ Pydantic test failed: {e}")
    import traceback
    traceback.print_exc()