1515 rai_success ,
1616 rai_validate_team_config ,
1717)
18- from common .services .json_service import JsonService
18+ from src . backend . v3 . common .services .team_service import TeamService
1919from kernel_agents .agent_factory import AgentFactory
2020from common .database .database_factory import DatabaseFactory
2121from v3 .models .orchestration_models import AgentType
@@ -393,10 +393,10 @@ async def upload_team_config_endpoint(request: Request, file: UploadFile = File(
393393
394394 # Initialize memory store and service
395395 memory_store = await DatabaseFactory .get_database (user_id = user_id )
396- json_service = JsonService (memory_store )
396+ team_service = TeamService (memory_store )
397397
398398 # Validate model deployments
399- models_valid , missing_models = await json_service .validate_team_models (
399+ models_valid , missing_models = await team_service .validate_team_models (
400400 json_data
401401 )
402402 if not models_valid :
@@ -421,7 +421,7 @@ async def upload_team_config_endpoint(request: Request, file: UploadFile = File(
421421 )
422422
423423 # Validate search indexes
424- search_valid , search_errors = await json_service .validate_team_search_indexes (
424+ search_valid , search_errors = await team_service .validate_team_search_indexes (
425425 json_data
426426 )
427427 if not search_valid :
@@ -447,15 +447,15 @@ async def upload_team_config_endpoint(request: Request, file: UploadFile = File(
447447
448448 # Validate and parse the team configuration
449449 try :
450- team_config = await json_service .validate_and_parse_team_config (
450+ team_config = await team_service .validate_and_parse_team_config (
451451 json_data , user_id
452452 )
453453 except ValueError as e :
454454 raise HTTPException (status_code = 400 , detail = str (e ))
455455
456456 # Save the configuration
457457 try :
458- team_id = await json_service .save_team_configuration (team_config )
458+ team_id = await team_service .save_team_configuration (team_config )
459459 except ValueError as e :
460460 raise HTTPException (
461461 status_code = 500 , detail = f"Failed to save configuration: { str (e )} "
@@ -546,10 +546,10 @@ async def get_team_configs_endpoint(request: Request):
546546 try :
547547 # Initialize memory store and service
548548 memory_store = await DatabaseFactory .get_database (user_id = user_id )
549- json_service = JsonService (memory_store )
549+ team_service = TeamService (memory_store )
550550
551551 # Retrieve all team configurations
552- team_configs = await json_service .get_all_team_configurations (user_id )
552+ team_configs = await team_service .get_all_team_configurations (user_id )
553553
554554 # Convert to dictionaries for response
555555 configs_dict = [config .model_dump () for config in team_configs ]
@@ -624,10 +624,10 @@ async def get_team_config_by_id_endpoint(team_id: str, request: Request):
624624 try :
625625 # Initialize memory store and service
626626 memory_store = await DatabaseFactory .get_database (user_id = user_id )
627- json_service = JsonService (memory_store )
627+ team_service = TeamService (memory_store )
628628
629629 # Retrieve the specific team configuration
630- team_config = await json_service .get_team_configuration (team_id , user_id )
630+ team_config = await team_service .get_team_configuration (team_id , user_id )
631631
632632 if team_config is None :
633633 raise HTTPException (status_code = 404 , detail = "Team configuration not found" )
@@ -690,10 +690,10 @@ async def delete_team_config_endpoint(team_id: str, request: Request):
690690 try :
691691 # Initialize memory store and service
692692 memory_store = await DatabaseFactory .get_database (user_id = user_id )
693- json_service = JsonService (memory_store )
693+ team_service = TeamService (memory_store )
694694
695695 # Delete the team configuration
696- deleted = await json_service .delete_team_configuration (team_id , user_id )
696+ deleted = await team_service .delete_team_configuration (team_id , user_id )
697697
698698 if not deleted :
699699 raise HTTPException (status_code = 404 , detail = "Team configuration not found" )
@@ -741,9 +741,9 @@ async def get_model_deployments_endpoint(request: Request):
741741 )
742742
743743 try :
744- json_service = JsonService ()
745- deployments = await json_service .list_model_deployments ()
746- summary = await json_service .get_deployment_status_summary ()
744+ team_service = TeamService ()
745+ deployments = await team_service .list_model_deployments ()
746+ summary = await team_service .get_deployment_status_summary ()
747747 return {"deployments" : deployments , "summary" : summary }
748748 except Exception as e :
749749 logging .error (f"Error retrieving model deployments: { str (e )} " )
@@ -773,8 +773,8 @@ async def get_search_indexes_endpoint(request: Request):
773773 )
774774
775775 try :
776- json_service = JsonService ()
777- summary = await json_service .get_search_index_summary ()
776+ team_service = TeamService ()
777+ summary = await team_service .get_search_index_summary ()
778778 return {"search_summary" : summary }
779779 except Exception as e :
780780 logging .error (f"Error retrieving search indexes: { str (e )} " )
0 commit comments