代码提交同步
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\ai\controller;
|
||||
|
||||
use app\common\util\JwtUtil;
|
||||
use think\facade\Env;
|
||||
|
||||
class DouBaoAI
|
||||
@@ -31,12 +32,17 @@ class DouBaoAI
|
||||
{
|
||||
$this->__init();
|
||||
|
||||
$content = input('content','');
|
||||
if (empty($content)){
|
||||
return json_encode(['code' => 500, 'msg' => '提示词缺失']);
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
$params = [
|
||||
'model' => 'doubao-1-5-pro-32k-250115',
|
||||
'messages' => [
|
||||
['role' => 'system', 'content' => '你是人工智能助手.'],
|
||||
['role' => 'user', 'content' => '厦门天气'],
|
||||
['role' => 'user', 'content' => $content],
|
||||
],
|
||||
/*'extra_headers' => [
|
||||
'x-is-encrypted' => true
|
||||
|
||||
Reference in New Issue
Block a user