Spaces:
Running
Running
#!/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() |