This commit is contained in:
2024-07-18 11:34:48 +08:00
parent 256396fee7
commit dce740a5e0
3 changed files with 10 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ class Reportty
* authorwh * authorwh
*/ */
function createReport(){ function createReport(){
Tools::log_to_write_txt(['input'=>input()]);
//header('Content-Type: text/event-stream'); //header('Content-Type: text/event-stream');
//header('Cache-Control: no-cache'); //header('Cache-Control: no-cache');
//header('Connection: keep-alive'); //header('Connection: keep-alive');
@@ -73,6 +74,9 @@ class Reportty
$chatobj->setBefore($content); $chatobj->setBefore($content);
$chatobj->returnAnswer($question,$config,$answer_json_arr); $chatobj->returnAnswer($question,$config,$answer_json_arr);
Tools::log_to_write_txt($chatobj->post_msg_body);
$res_content = []; $res_content = [];
//把返回的报告保存起来 //把返回的报告保存起来
foreach ($answer_json_arr as $josn){ foreach ($answer_json_arr as $josn){

View File

@@ -8,6 +8,7 @@ class ChatGPT extends BaseChat
public $apiKey = ''; public $apiKey = '';
public $model = ''; public $model = '';
private $messages = []; private $messages = [];
public $post_msg_body;
public function __construct() public function __construct()
{ {
@@ -94,6 +95,7 @@ class ChatGPT extends BaseChat
} }
$post_msg_body['messages'] = $this->messages; $post_msg_body['messages'] = $this->messages;
$postData = json_encode($post_msg_body); $postData = json_encode($post_msg_body);
$this->post_msg_body = $post_msg_body;
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

View File

@@ -45,6 +45,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
let dataid = $('#add_follow_report').attr('data-id'); let dataid = $('#add_follow_report').attr('data-id');
//添加随访记录 //添加随访记录
layer.msg(111); layer.msg(111);
let url = 'tt/Followup/addfollowup';
$.post(url,{report_dataid:dataid},function (res) {
},'html');
}); });
Controller.api.bindevent(); Controller.api.bindevent();