diff --git a/wrapper.py b/wrapper.py index d2d461e..7e4c83e 100644 --- a/wrapper.py +++ b/wrapper.py @@ -2,10 +2,11 @@ from database import search_database from geocoder import validate_address from new_parser_test import parse from route import build_route +from ouput_chat import RouteDescriber import json if __name__=='__main__': - user_input = parse() + user_input,conversation_history = parse() user_input = json.loads(user_input) print(user_input) query =user_input['tags'] @@ -25,9 +26,18 @@ if __name__=='__main__': n_nodes = len(mapping) allow_extend = any(v[1] for v in mapping.values()) print(len(mapping),allow_extend) - route =0 + route_otp =0 if allow_extend: - while n_nodes <= 5 and (route := build_route(found_points, mapping, user_position, user_time, n_nodes,strategy='random') or route): n_nodes += 1 + while n_nodes <= 5 and (route_otp := build_route(found_points, mapping, user_position, user_time, n_nodes,strategy='random') or route_otp): n_nodes += 1 else: - route= build_route(found_points, mapping, user_position, user_time, n_nodes,strategy='random') - print(route) \ No newline at end of file + route_otp= build_route(found_points, mapping, user_position, user_time, n_nodes,strategy='random') + route, places = route_otp + dscb = RouteDescriber() + print(conversation_history) + description = dscb.generate_route_description(places,conversation_history) + print(route) + print(description) + for pl in places: print(pl) + q = input('ЗАГЛУШКА') + answer = dscb.answer_question(q) + print(answer)