Spaces:
Build error
Build error
| from agents.gather_agent import Gather_Agent | |
| from agents.check_agent import Check_Agent | |
| from agents.response_agent import Response_Agent | |
| from agents.planner_agent import Planner_Agent | |
| gather_agent = Gather_Agent() | |
| check_agent = Check_Agent() | |
| response_agent = Response_Agent() | |
| planner_agent = Planner_Agent() | |
| isComplete = False | |
| chat_history = "" | |
| helper_anwser = "Hello, can you tell me your trip details and constraints so I can give you great recomendations?" | |
| user_input = input("Helper: " + helper_anwser + "\nUser: ") | |
| def send_message(user_input, chat_history): | |
| isComplete = False | |
| helper_anwser = "" | |
| _input_gather = gather_agent.format_prompt(input=user_input, history=chat_history) | |
| parsed_result_gather = gather_agent.get_parsed_result(_input_gather) | |
| _input_check = check_agent.format_prompt(input=parsed_result_gather) | |
| isComplete = check_agent.get_parsed_result(_input_check) | |
| if isComplete == False: | |
| _input_response = response_agent.format_prompt(input=parsed_result_gather) | |
| helper_anwser = response_agent.get_parsed_result(_input_response) | |
| return isComplete, helper_anwser, parsed_result_gather | |
| def get_itenerary(parsed_result_gather): | |
| _input_planner = planner_agent.format_prompt(parsed_result_gather) | |
| return planner_agent.get_itenerary(_input_planner) | |
| while isComplete == False: | |
| isComplete, helper_anwser, parsed_result_gather = send_message(user_input, chat_history) | |
| if isComplete == False: | |
| chat_history += "User: " + user_input + "\nHelper: " + helper_anwser + "\n" | |
| user_input = input("Helper: " + helper_anwser + "\nUser: ") | |
| print(parsed_result_gather) | |
| print(get_itenerary(parsed_result_gather)) | |
| _input_places = planner_agent.format_instructions_places(parsed_result_gather) | |
| parsed_result_places = planner_agent.get_places_from_itenerary(_input_places) | |
| print(planner_agent.get_itenerary(_input_planner)) |