From 5e247d4b83f51a6d085200841ce75f6723fb765a Mon Sep 17 00:00:00 2001 From: ViktorSemericov Date: Wed, 29 Oct 2025 19:29:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20wrapper.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wrapper.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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)