package com.seer.teach.common.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
 * @Author: Captain
 * @Description: Llm配置类
 * @Date: 2025-05-12 18:42
 */
@Component
@ConditionalOnProperty(prefix = "largeModel", name = "ip")
public class LlmConfig implements InitializingBean {

    @Value("${largeModel.ip:}")
    private String ip;

    @Value("${largeModel.questionsCorrect:}")
    private String questionsCorrect;

    @Value("${largeModel.getPlanQuestions:}")
    private String getPlanQuestions;

    @Value("${largeModel.recommendChapters:}")
    private String recommendChapters;

    @Value("${largeModel.planCoverImage:}")
    private String planCoverImage;

    @Value("${largeModel.tts}")
    private String tts;

    @Value("${largeModel.stt}")
    private String stt;

    @Value("${largeModel.getComment}")
    private String getComment;

    @Value("${largeModel.sseAiChat}")
    private String sseAiChat;

    @Value("${largeModel.sseStudy}")
    private String sseStudy;

    @Value("${largeModel.sseAiCorrect}")
    private String sseAiCorrect;

    @Value("${largeModel.ocr}")
    private String ocr;

    @Value("${largeModel.processUpload}")
    private String processUpload;

    @Value("${largeModel.getContextAboutSingleQuestion}")
    private String getContextAboutSingleQuestion;

    @Value("${largeModel.getTextBase64}")
    private String getTextBase64;

    public static String IP;

    public static String QUESTIONS_CORRECT;

    public static String GET_PLAN_QUESTIONS;

    public static String RECOMMEND_CHAPTERS;

    public static String PLAN_COVER_IMAGE;

    public static String TTS;

    public static String STT;

    public static String GET_COMMENT;

    public static String SSE_AI_CHAT;

    public static String SSE_STUDY;

    public static String SSE_AI_CORRECT;

    public static String OCR;

    public static String PROCESS_UPLOAD;

    public static String GET_CONTEXT_ABOUT_SINGLE_QUESTION;

    public static String GET_TEXT_BASE64;

    @Override
    public void afterPropertiesSet(){
        IP = ip;
        QUESTIONS_CORRECT = questionsCorrect;
        RECOMMEND_CHAPTERS = recommendChapters;
        PLAN_COVER_IMAGE = planCoverImage;
        TTS = tts;
        STT = stt;
        GET_COMMENT = getComment;
        SSE_AI_CHAT = sseAiChat;
        SSE_STUDY = sseStudy;
        SSE_AI_CORRECT = sseAiCorrect;
        GET_PLAN_QUESTIONS = getPlanQuestions;
        OCR = ocr;
        PROCESS_UPLOAD = processUpload;
        GET_CONTEXT_ABOUT_SINGLE_QUESTION = getContextAboutSingleQuestion;
        GET_TEXT_BASE64 = getTextBase64;
    }
}
