#!/usr/bin/env python3 """ Run script for the Intelligent Research System UI. This script launches the Gradio interface for the research system. """ import argparse from ui.gradio_interface import GradioInterface def parse_args(): """Parse command line arguments.""" parser = argparse.ArgumentParser(description="Run the Intelligent Research System UI") parser.add_argument( "--share", action="store_true", help="Create a public link for sharing" ) parser.add_argument( "--port", type=int, default=7860, help="Port to run the server on" ) parser.add_argument( "--debug", action="store_true", help="Run in debug mode" ) return parser.parse_args() def main(): """Main function to run the UI.""" args = parse_args() print("Starting Intelligent Research System UI...") # Create interface and initialize async components import asyncio interface = GradioInterface() # Run the async initialization in the event loop loop = asyncio.get_event_loop() loop.run_until_complete(interface.async_init()) # Launch with the specified arguments interface.launch( share=args.share, server_port=args.port, debug=args.debug ) if __name__ == "__main__": main()