Использую эти наработки нужно внедрить в код представленный ниже с учетом
import sys
import io
import os

sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8')

from g4f.client import Client

client = Client()
response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[{"role": "user", "content": "Какой цвет у неба?"}],
)
print(response.choices[0].message.content)

чтобы gpt понимал о чем идут расчёты нужно указать
1.Коэффициент финансового риска, U1 ( label_154 ) не выше 1,5 ( label_155 ) К эти расчетам относятся значения из строк: label_156, label_158, label_157, label_159, label_161, label_160
2.Коэффициент обеспеченности собственными \nисточниками финансирования, U2 ( label_170 ) нижняя граница 0,1;\nоптимальное значение:\n U2⩾0,5\n ( label_171 ) К эти расчетам относятся значения из строк: label_172, label_173, label_174, label_175, label_176, label_177
3.Коэффициент финансовой \nнезависимости (автономии), U3 ( label_178 ) U3⩾0,5 ( label_179 ) К эти расчетам относятся значения из строк: label_180, label_181, label_182, label_183, label_184, label_185
4. Коэффициент финансирования, U4 ( label_162 ) U4⩾1;\n оптимальное значение:\nU4=1,5 ( label_163 ) К эти расчетам относятся значения из строк: label_164, label_165, label_166, label_167, label_168, label_169
5.Коэффициент финансовой устойчивости, U5 ( label_147 ) U5⩾0,6 \nРекомендуемое значение –\n 0,8-0,9 ( label_146 ) К эти расчетам относятся значения из строк: label_148, label_149, label_150, label_151, label_152, label_153


from PyQt6.QtCore import pyqtSlot
from PyQt6.QtWidgets import QApplication, QMainWindow, QMessageBox
import sys
import os
from Authorization import Ui_Authorization
from Registration import Ui_Registration
from MainWindow import Ui_MainWindow

DATA_FILE = "user_data.txt"

class AuthorizationWindow(QMainWindow, Ui_Authorization):
    def __init__(self):
        super(AuthorizationWindow, self).__init__()
        self.setupUi(self)

        # Handle "Зарегистрироваться" button click
        self.pushButton_3.clicked.connect(self.open_registration)

        # Handle "Войти" button click
        self.pushButton.clicked.connect(self.login)

        self.user_data = self.load_user_data()

    def load_user_data(self):
        """Load user data from a file."""
        if not os.path.exists(DATA_FILE):
            return {}

        user_data = {}
        with open(DATA_FILE, "r") as file:
            for line in file:
                parts = line.strip().split(",")
                if len(parts) == 2:  # Старый формат, только имя пользователя и пароль
                    username, password = parts
                    email = ""  # Email отсутствует в старом формате
                elif len(parts) == 3:  # Новый формат, включает email
                    username, password, email = parts
                else:
                    continue  # Неправильный формат строки, пропускаем

                user_data[username] = {"password": password, "email": email}
        return user_data

    def save_user_data(self):
        """Save user data to a file."""
        with open(DATA_FILE, "w") as file:
            for username, data in self.user_data.items():
                file.write(f"{username},{data['password']},{data['email']}\n")

    @pyqtSlot()
    def open_registration(self):
        self.registration_window = RegistrationWindow(self)
        self.registration_window.show()

    @pyqtSlot()
    def login(self):
        username = self.lineEdit.text()
        password = self.lineEdit_2.text()

        msg_box = QMessageBox(self)
        msg_box.setStyleSheet("background-color: white;")

        if username in self.user_data and self.user_data[username]["password"] == password:
            msg_box.setText("Вы успешно вошли в систему!")
            msg_box.setIcon(QMessageBox.Icon.Information)

            # Открываем главное окно и закрываем окно авторизации
            self.main_window = MainWindowWindow(self)
            self.main_window.show()
            self.close()
        else:
            msg_box.setText("Неверный логин или пароль!")
            msg_box.setIcon(QMessageBox.Icon.Warning)

        msg_box.exec()

class RegistrationWindow(QMainWindow, Ui_Registration):
    def __init__(self, auth_window):
        super(RegistrationWindow, self).__init__()
        self.setupUi(self)

        # Reference to the authorization window to store user data
        self.auth_window = auth_window

        # Handle "Сохранить" button click
        self.pushButton.clicked.connect(self.save_registration)

    @pyqtSlot()
    def save_registration(self):
        email = self.lineEdit_3.text()
        username = self.lineEdit.text()
        password = self.lineEdit_2.text()
        confirm_password = self.lineEdit_4.text()

        msg_box = QMessageBox(self)
        msg_box.setStyleSheet("background-color: white;")

        if password != confirm_password:
            msg_box.setText("Пароли не совпадают!")
            msg_box.setIcon(QMessageBox.Icon.Warning)
            msg_box.exec()
            return

        self.auth_window.user_data[username] = {"password": password, "email": email}
        self.auth_window.save_user_data()
        msg_box.setText("Регистрация успешна!")
        msg_box.setIcon(QMessageBox.Icon.Information)
        msg_box.exec()

        self.close()

class MainWindowWindow(QMainWindow, Ui_MainWindow):
    def __init__(self, auth_window):
        super(MainWindowWindow, self).__init__()
        self.setupUi(self)
        self.auth_window = auth_window
        self.initialize_signals()

        # Initialize the first tab display
        self.tabWidget.setCurrentIndex(0)

    def initialize_signals(self):
        # Connect comboBox signals to methods
        self.comboBox_3.currentIndexChanged.connect(self.handle_comboBox_3_change)
        self.comboBox_6.currentIndexChanged.connect(self.handle_comboBox_6_change)

        # Connect pushButton signals to methods
        self.pushButton_2.clicked.connect(self.handle_push_button_2)
        self.pushButton_3.clicked.connect(self.handle_push_button_3)

        self.pushButton_2.clicked.connect(self.switch_to_tab8)
        self.pushButton_3.clicked.connect(self.switch_to_tab7)

        self.pushButton_4.clicked.connect(self.handle_addition)

    def handle_comboBox_3_change(self, index):
        if index == 0:  # Index for "1"
            self.tabWidget.setCurrentIndex(0)  # Set to tab3
        elif index == 1:  # Index for "2"
            self.tabWidget.setCurrentIndex(1)  # Set to tab4

    def handle_comboBox_6_change(self, index):
        if index == 0:  # Index for "3"
            self.tabWidget.setCurrentIndex(2)  # Set to tab5

    def handle_push_button_2(self):
        # Set tabWidget to tab2
        self.tabWidget_3.setCurrentIndex(1)

    def handle_push_button_3(self):
        # Set tabWidget to tab (initial tab)
        self.tabWidget_3.setCurrentIndex(0)

    def switch_to_tab8(self):
        # Change the active tab in tabWidget3 to tab7
        self.tabWidget_2.setCurrentIndex(1)

    def switch_to_tab7(self):
        # Change the active tab in tabWidget3 to tab6
        self.tabWidget_2.setCurrentIndex(0)

    #
    # Анализ показателей финансовой устойчивости
    def handle_addition(self):
        # 1 год
        try:
            num1 = float(self.lineEdit_110.text())
            num2 = float(self.lineEdit_126.text())
            num3 = float(self.lineEdit_86.text())
            result = (num1 + num2) / num3
            self.label_156.setText(str(round(result, 3)))
        except ValueError:
            self.label_156.setText("Ошибка ввода")

        try:
            num3 = float(self.lineEdit_86.text())
            num4 = float(self.lineEdit_29.text())
            num5 = float(self.lineEdit_23.text())
            result2 = (num3 - num4) / num5
            self.label_172.setText(str(round(result2, 3)))
        except ValueError:
            self.label_172.setText("Ошибка ввода")

        try:
            num3 = float(self.lineEdit_86.text())
            num6 = float(self.lineEdit_127.text())
            result3 = num3 / num6
            self.label_180.setText(str(round(result3, 3)))
        except ValueError:
            self.label_180.setText("Ошибка ввода")

        try:
            num3 = float(self.lineEdit_86.text())
            num1 = float(self.lineEdit_110.text())
            num2 = float(self.lineEdit_126.text())
            result4 = num3 / (num1 + num2)
            self.label_164.setText(str(round(result4, 3)))
        except ValueError:
            self.label_164.setText("Ошибка ввода")

        try:
            num3 = float(self.lineEdit_86.text())
            num1 = float(self.lineEdit_110.text())
            num6 = float(self.lineEdit_127.text())
            result5 = (num3 + num1) / num6
            self.label_148.setText(str(round(result5, 3)))
        except ValueError:
            self.label_148.setText("Ошибка ввода")

        # 2 год
        try:
            num21 = float(self.lineEdit_116.text())
            num22 = float(self.lineEdit_146.text())
            num23 = float(self.lineEdit_93.text())
            result21 = (num21 + num22) / num23
            self.label_158.setText(str(round(result21, 3)))
        except ValueError:
            self.label_158.setText("Ошибка ввода")

        try:
            num23 = float(self.lineEdit_93.text())
            num24 = float(self.lineEdit_47.text())
            num25 = float(self.lineEdit_66.text())
            result22 = (num23 - num24) / num25
            self.label_173.setText(str(round(result22, 3)))
        except ValueError:
            self.label_173.setText("Ошибка ввода")

        try:
            num23 = float(self.lineEdit_93.text())
            num26 = float(self.lineEdit_147.text())
            result23 = num23 / num26
            self.label_181.setText(str(round(result23, 3)))
        except ValueError:
            self.label_181.setText("Ошибка ввода")

        try:
            num23 = float(self.lineEdit_93.text())
            num21 = float(self.lineEdit_116.text())
            num22 = float(self.lineEdit_146.text())
            result24 = num23 / (num21 + num22)
            self.label_165.setText(str(round(result24, 3)))
        except ValueError:
            self.label_165.setText("Ошибка ввода")

        try:
            num23 = float(self.lineEdit_93.text())
            num21 = float(self.lineEdit_116.text())
            num26 = float(self.lineEdit_147.text())
            result25 = (num23 + num21) / num26
            self.label_149.setText(str(round(result25, 3)))
        except ValueError:
            self.label_149.setText("Ошибка ввода")

        # 3 год
        try:
            num31 = float(self.lineEdit_117.text())
            num32 = float(self.lineEdit_145.text())
            num33 = float(self.lineEdit_100.text())
            result31 = (num31 + num32) / num33
            self.label_157.setText(str(round(result31, 3)))
        except ValueError:
            self.label_157.setText("Ошибка ввода")

        try:
            num33 = float(self.lineEdit_100.text())
            num34 = float(self.lineEdit_48.text())
            num35 = float(self.lineEdit_71.text())
            result32 = (num33 - num34) / num35
            self.label_174.setText(str(round(result32, 3)))
        except ValueError:
            self.label_174.setText("Ошибка ввода")

        try:
            num33 = float(self.lineEdit_100.text())
            num36 = float(self.lineEdit_148.text())
            result33 = num33 / num36
            self.label_182.setText(str(round(result33, 3)))
        except ValueError:
            self.label_182.setText("Ошибка ввода")

        try:
            num33 = float(self.lineEdit_100.text())
            num31 = float(self.lineEdit_117.text())
            num32 = float(self.lineEdit_145.text())
            result34 = num33 / (num31 + num32)
            self.label_166.setText(str(round(result34, 3)))
        except ValueError:
            self.label_166.setText("Ошибка ввода")

        try:
            num33 = float(self.lineEdit_100.text())
            num31 = float(self.lineEdit_117.text())
            num36 = float(self.lineEdit_148.text())
            result35 = (num33 + num31) / num36
            self.label_150.setText(str(round(result35, 3)))
        except ValueError:
            self.label_150.setText("Ошибка ввода")

        # Вывод в labels
        try:
            label_157 = float(self.label_157.text())
            label_156 = float(self.label_156.text())

            diff = label_157 - label_156
            self.label_159.setText(str(round(diff, 3)))

            ratio = label_157 / label_156
            self.label_161.setText(str(round(ratio, 3)))

            percent = (label_157 / label_156) * 100
            self.label_160.setText(str(round(percent, 3)))

        except ValueError:
            self.label_159.setText("Ошибка ввода")
            self.label_161.setText("Ошибка ввода")
            self.label_160.setText("Ошибка ввода")

        try:
            label_174 = float(self.label_174.text())
            label_172 = float(self.label_172.text())

            diff_174_172 = label_174 - label_172
            self.label_175.setText(str(round(diff_174_172, 3)))

            ratio_174_172 = label_174 / label_172
            self.label_176.setText(str(round(ratio_174_172, 3)))

            percent_174_172 = (label_174 / label_172) * 100
            self.label_177.setText(str(round(percent_174_172, 3)))

        except ValueError:
            self.label_175.setText("Ошибка ввода")
            self.label_176.setText("Ошибка ввода")
            self.label_177.setText("Ошибка ввода")

        try:
            label_182 = float(self.label_182.text())
            label_180 = float(self.label_180.text())

            diff_182_180 = label_182 - label_180
            self.label_183.setText(str(round(diff_182_180, 3)))

            ratio_182_180 = label_182 / label_180
            self.label_184.setText(str(round(ratio_182_180, 3)))

            percent_182_180 = (label_182 / label_180) * 100
            self.label_185.setText(str(round(percent_182_180, 3)))

        except ValueError:
            self.label_183.setText("Ошибка ввода")
            self.label_184.setText("Ошибка ввода")
            self.label_185.setText("Ошибка ввода")

        try:
            label_166 = float(self.label_166.text())
            label_164 = float(self.label_164.text())

            diff_166_164 = label_166 - label_164
            self.label_167.setText(str(round(diff_166_164, 3)))

            ratio_166_164 = label_166 / label_164
            self.label_168.setText(str(round(ratio_166_164, 3)))

            percent_166_164 = (label_166 / label_164) * 100
            self.label_169.setText(str(round(percent_166_164, 3)))

        except ValueError:
            self.label_167.setText("Ошибка ввода")
            self.label_168.setText("Ошибка ввода")
            self.label_169.setText("Ошибка ввода")

        try:
            label_150 = float(self.label_150.text())
            label_148 = float(self.label_148.text())

            diff_150_148 = label_150 - label_148
            self.label_151.setText(str(round(diff_150_148, 3)))

            ratio_150_148 = label_150 / label_148
            self.label_152.setText(str(round(ratio_150_148, 3)))

            percent_150_148 = (label_150 / label_148) * 100
            self.label_153.setText(str(round(percent_150_148, 3)))

        except ValueError:
            self.label_151.setText("Ошибка ввода")
            self.label_152.setText("Ошибка ввода")
            self.label_153.setText("Ошибка ввода")


#
def main():
    app = QApplication(sys.argv)

    auth_window = AuthorizationWindow()
    auth_window.show()

    sys.exit(app.exec())

if __name__ == "__main__":
    main()