import asyncio from AgenticInterfaces.KafkaClient import KafkaClient bootstrap_servers = "kafka:9092" response_topic = "response_llm_topic" async def print_received_messages(message): print("Получено сообщение:", message["text"]) async def receive_messages(): kafka_client = KafkaClient(topic=response_topic, bootstrap_servers=bootstrap_servers, group_id="response-group") await kafka_client.start() try: await kafka_client.consume_messages(print_received_messages) finally: await kafka_client.stop() asyncio.run(receive_messages())