# #!/usr/bin/env python
# import sys
# import warnings

# from datetime import datetime

# from latest_ai_development.crew import LatestAiDevelopment

# warnings.filterwarnings("ignore", category=SyntaxWarning, module="pysbd")

# # This main file is intended to be a way for you to run your
# # crew locally, so refrain from adding unnecessary logic into this file.
# # Replace with inputs you want to test with, it will automatically
# # interpolate any tasks and agents information

# def run():
#     """
#     Run the crew.
#     """
#     inputs = {
#         'topic': "Artificial Intelligence",
#         'Name': 'John P.',
#         'Job_Title': 'Product Manager',
#         'Experience': '7 years',
#         'Skills': 'Product Roadmapping, Agile, User Research, Market Analysis, Cross-functional Leadership, KPI Management',
#         'Level':"Basic",
#         'available_time': '6 hours'
#     }
    
#     try:
#         LatestAiDevelopment().crew().kickoff(inputs=inputs)
#     except Exception as e:
#         raise Exception(f"An error occurred while running the crew: {e}")



from fastapi import FastAPI
from user_journey_service.api.endpoints import router as api_router ###crew_service.api.endpoints import router as api_router  # adjust import to your service path

app = FastAPI(
    title="CrewAI Microservice",
    version="1.0.0",
    openapi_url="/api/v1/openapi.json",
)

# Include the CrewAI endpoint router
app.include_router(api_router, prefix="/api/v1")

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(
        "user_journey_service.main:app",  # update to your actual module path
        host= "0.0.0.0",    ###############  "20.124.9.142", 
        port=8004,  # or whichever port you prefer
        timeout_keep_alive=300,
        reload=True
    )
