package cn.com.poc.thirdparty.resource.demand.ai.function;

import cn.com.poc.agent_application.entity.Variable;
import cn.com.poc.thirdparty.resource.demand.ai.function.document_understanding.DocumentUnderstandIngFunction;
import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;

import static org.apache.poi.hslf.record.RecordTypes.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = SingleContextInitializer.class)
@WebAppConfiguration
public class DocumentUnderstandingFunctionTest {

    @Resource
    DocumentUnderstandIngFunction documentUnderstandIngFunction;

    @Test
    public void testDoFunction() {
        String content = "{\"file_url\": \"https://gsst-poe-sit.gz.bcebos.com/data/20241127/1732704249980.docx\",\"question\":\"駕駛執照上的二維碼內載有什麼資料？\"}";
        String identifier = UUID.randomUUID().toString();
        String RESULT = documentUnderstandIngFunction.doFunction(content, identifier);
        System.out.println(RESULT);
    }

    @Test
    public void testGetDesc() {
        System.out.println(documentUnderstandIngFunction.getDesc());
    }

    @Test
    public void testGetLLMConfig() {
        System.out.println(documentUnderstandIngFunction.getLLMConfig());
    }

    @Test
    public void testGetLLMConfigToVariableStructure() {
        List<Variable> variableStructure = Mockito.mock(List.class);
        System.out.println(documentUnderstandIngFunction.getLLMConfig(variableStructure));
    }
}
