代码提交
This commit is contained in:
@@ -20,8 +20,8 @@ class BaseController extends Controller
|
||||
parent::__construct();
|
||||
|
||||
// 从环境变量获取配置
|
||||
$this->apiUrl = Env::get('ai.api_url');
|
||||
$this->accessToken = Env::get('ai.token');
|
||||
$this->apiUrl = Env::get('cozeAi.api_url');
|
||||
$this->accessToken = Env::get('cozeAi.token');
|
||||
|
||||
// 设置请求头
|
||||
$this->headers = [
|
||||
|
||||
@@ -101,7 +101,7 @@ class ConversationController extends BaseController
|
||||
public function create($is_internal = false)
|
||||
{
|
||||
try {
|
||||
$bot_id = Env::get('ai.bot_id');
|
||||
$bot_id = Env::get('cozeAi.bot_id');
|
||||
$userInfo = request()->userInfo;
|
||||
$uid = $userInfo['id'];
|
||||
$companyId = $userInfo['companyId'];
|
||||
@@ -117,7 +117,7 @@ class ConversationController extends BaseController
|
||||
];
|
||||
$messages[] = [
|
||||
'role' => 'assistant',
|
||||
'content' => Env::get('ai.content'),
|
||||
'content' => Env::get('cozeAi.content'),
|
||||
'type' => 'answer',
|
||||
'content_type' => 'text',
|
||||
];
|
||||
@@ -145,7 +145,7 @@ class ConversationController extends BaseController
|
||||
'chat_id' => $conversation['id'],
|
||||
'conversation_id' => $conversation['id'],
|
||||
'bot_id' => $bot_id,
|
||||
'content' => Env::get('ai.content'),
|
||||
'content' => Env::get('cozeAi.content'),
|
||||
'content_type' => 'text',
|
||||
'role' => 'assistant',
|
||||
'type' => 'answer',
|
||||
@@ -177,7 +177,7 @@ class ConversationController extends BaseController
|
||||
public function createChat()
|
||||
{
|
||||
try {
|
||||
$bot_id = Env::get('ai.bot_id');
|
||||
$bot_id = Env::get('cozeAi.bot_id');
|
||||
$conversation_id = input('conversation_id','');
|
||||
$question = input('question','');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user