| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Http\Controllers\Api\v1;
- use App\Http\Controllers\Api\webApp;
- use App\Services\DeepSeekService;
- use thiagoalessio\TesseractOCR\TesseractOCR;
- /**
- * 测试
- * Class TestController
- * @package App\Http\Controllers\Api
- */
- class TestController extends webApp
- {
- public function check()
- {
- $result = (new TesseractOCR(ATTACHMENT_PATH.'/temp/20250922/answer1.jpeg'))->lang('chi_sim')->run();
- dump($result);
- return 66;
- $data = [
- // 'answer'=> '表达了诗人孤独、愁苦的心境和对时光流逝的感慨。',
- 'answer'=> 'https://shuati.derkj.com/uploads/temp/20250922/answer1.jpeg',
- 'score'=>10,
- 'topic'=> 'https://shuati.derkj.com/uploads/temp/20250922/topic2.png',
- // 'topic'=> '2.请简述一下杜甫的诗《登高》中“无边落木萧萧下,不尽长江滚滚来”这两句诗描绘了怎样的景象?表达了诗人怎样的情感?',
- 'type'=> 2
- ];
- $result = DeepSeekService::make()->upload('/temp/20250922/topic2.jpeg');
- // $result = DeepSeekService::make()->apiRequest($data,'deepseek-chat');
- dump($result);
- // $papers = [28,29];
- // $datas = [];
- // $topics = ExamTopicModel::where(['paper_id'=>27])->orderBy('id')->get();
- // $topics = $topics? $topics->toArray() : [];
- // foreach ($papers as $paperId){
- // foreach($topics as &$item){
- // unset($item['id']);
- // $item['paper_id'] = $paperId;
- // $datas[] = $item;
- // }
- // }
- //
- // ExamTopicModel::insert($datas);
- // var_dump($topics);
- }
- }
|