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

import cn.com.poc.thirdparty.resource.demand.ai.function.long_document_reader.LongDocumentReaderFunction;
import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import org.junit.runner.RunWith;
import org.junit.Test;
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.UUID;

/**
 * @author alex.yao
 * @date 2025/5/12
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = SingleContextInitializer.class)
@WebAppConfiguration
public class LongDocumentReaderFunctionTest {

    @Resource
    LongDocumentReaderFunction longDocumentReaderFunction;

    @Test
    public void test_function(){
        String content = "{\"file_url\": \"https://gsst-poe-sit.gz.bcebos.com/data/20250410/1744277235901.pdf\",\"question\":\"Can a registered Grade C electrical worker work on the electrical work of a Grade A electrical worker?\"}";
        String identifier = UUID.randomUUID().toString();
        AbstractFunctionResult<String> result = longDocumentReaderFunction.doFunction(content, identifier,null ,null);
        System.out.println(result.getFunctionResult());
    }


}
