open-webui/backend/test_import.py
google-labs-jules[bot] 60d0a30bf3 I've made a correction to the UserModel import in the agents router.
This resolved an ImportError (cannot import name 'User' from 'open_webui.models.auths') by changing the import for UserModel in `backend/open_webui/routers/agents.py` to correctly point to `open_webui.models.users`.

The original error prevented the agents router from loading. This change ensures the router can find the correct User model definition.

Note: I also found a missing 'typer' dependency, which I will address next.
2025-05-29 05:04:15 +00:00

14 lines
430 B
Python

import sys
import os
# Add the backend directory to sys.path to allow direct import of open_webui
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
try:
from open_webui.routers.agents import router as agents_router
print("Successfully imported agents_router!")
except ImportError as e:
print(f"Failed to import agents_router: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")