feat: 添加 Grok AI、Ollama AI

This commit is contained in:
kuaifan 2025-02-21 17:04:59 +08:00
parent 5a7f4efa91
commit 9c1482f9e9
11 changed files with 125 additions and 36 deletions

View File

@ -287,6 +287,7 @@ class SystemController extends AbstractController
* @apiParam {String} type
* - get: 获取(默认)
* - save: 保存设置(参数:[...]
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
@ -322,6 +323,32 @@ class SystemController extends AbstractController
return Base::retSuccess('success', $setting ?: json_decode('{}'));
}
/**
* @api {get} api/system/setting/aibot_defmodels 04. 获取AI默认模型
*
* @apiDescription 获取AI机器人默认模型
* @apiVersion 1.0.0
* @apiGroup system
* @apiName setting__aibot_defmodels
*
* @apiParam {String} type AI类型
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function setting__aibot_defmodels()
{
$type = trim(Request::input('type'));
$models = Setting::AIDefaultModels($type);
if (empty($models)) {
return Base::retError('未找到默认模型');
}
return Base::retSuccess('success', [
'models' => $models
]);
}
/**
* @api {get} api/system/setting/checkin 05. 获取签到设置、保存签到设置(限管理员)
*

View File

@ -81,7 +81,7 @@ class Extranet
}
}
$res = Ihttp::ihttp_request('https://api.openai.com/v1/chat/completions', json_encode([
"model" => "gpt-3.5-turbo",
"model" => "gpt-4o-mini",
"messages" => [
[
"role" => "system",
@ -132,7 +132,7 @@ class Extranet
}
}
$res = Ihttp::ihttp_request('https://api.openai.com/v1/chat/completions', json_encode([
"model" => "gpt-3.5-turbo",
"model" => "gpt-4o-mini",
"messages" => [
[
"role" => "system",

View File

@ -811,3 +811,5 @@ AI机器人不存在
会话不存在或已被删除
开启新会话
历史会话
未找到默认模型

View File

@ -1221,7 +1221,6 @@ OKR 结果分析
AI 机器人
任务相关
请填写名称!
访问OpenAI网站查看
使用代理
支持 http 或 socks 代理
例如http://proxy.com 或 socks5://proxy.com
@ -1919,7 +1918,6 @@ WiFi签到延迟时长为±1分钟。
DeepSeek大语言模型算法是北京深度求索人工智能基础技术研究有限公司推出的深度合成服务算法。
API请求的基础URL路径如果没有请留空
访问DeepSeek网站查看
欢迎词
仪表盘欢迎词,(*)代表用户昵称
@ -1941,3 +1939,11 @@ API请求的基础URL路径如果没有请留空
一行一个模型名称
请选择默认模型
可选数据来自模型列表
使用默认模型列表
未知操作
获取失败
获取成功
Grok是由xAI开发的生成式人工智能聊天机器人旨在通过实时回答用户问题来提供帮助。
Ollama 是一个轻量级、可扩展的框架,旨在让用户能够在本地机器上构建和运行大型语言模型。

View File

@ -14495,18 +14495,6 @@
"id": "Silakan isi nama!",
"ru": "Пожалуйста, заполните имя!"
},
{
"key": "访问OpenAI网站查看",
"zh": "",
"zh-CHT": "訪問OpenAI網站查看",
"en": "Visit OpenAI website to view",
"ko": "OpenAI 웹사이트에서 확인",
"ja": "OpenAIウェブサイトにアクセスして確認",
"de": "Besuchen Sie die OpenAI-Website, um es anzusehen",
"fr": "Visitez le site Web d'OpenAI pour voir",
"id": "Kunjungi situs web OpenAI untuk melihat",
"ru": "Посетите веб-сайт OpenAI для просмотра"
},
{
"key": "使用代理",
"zh": "",
@ -28067,18 +28055,6 @@
"id": "Jalur URL dasar untuk permintaan API, biarkan kosong jika tidak ada",
"ru": "Базовый путь URL для запроса API, оставить пустым, если отсутствует"
},
{
"key": "访问DeepSeek网站查看",
"zh": "",
"zh-CHT": "訪問DeepSeek網站查看",
"en": "Visit the DeepSeek website to view",
"ko": "DeepSeek 웹사이트 방문하여 보기",
"ja": "DeepSeekのウェブサイトを訪問して確認してください",
"de": "Besuchen Sie die DeepSeek-Website, um zu sehen",
"fr": "Visitez le site Web de DeepSeek pour voir",
"id": "Kunjungi situs web DeepSeek untuk melihat",
"ru": "Посетите веб-сайт DeepSeek, чтобы просмотреть"
},
{
"key": "欢迎词",
"zh": "",
@ -28319,4 +28295,4 @@
"id": "Data opsional berasal dari daftar model",
"ru": "Опционные данные взяты из списка моделей"
}
]
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -56,14 +56,20 @@
</p>
</div>
<div class="ivu-modal-wrap-apply-body">
<ul class="ivu-modal-wrap-ul" v-if="aibotType == 1">
<ul class="ai-list" v-if="aibotType == 1">
<li v-for="(item, key) in aibotList" :key="key">
<img class="apply-icon" :src="item.src">
<h4>{{ item.label }}</h4>
<p class="desc" @click="openDetail(item.desc)">{{ item.desc }}</p>
<p class="btn" @click="onGoToChat(item.value)">{{ $L('开始聊天') }}</p>
<div class="load" v-if="aibotDialogSearchLoad == item.value">
<Loading />
<div class="ai-img">
<img :src="item.src">
</div>
<div class="ai-info">
<h4>{{ item.label }}</h4>
<p class="ai-desc" @click="openDetail(item.desc)">{{ item.desc }}</p>
<ul class="ai-modal">
<li>aa</li>
<li>22</li>
<li>cc</li>
</ul>
<Button type="primary" :loading="aibotDialogSearchLoad == item.value" @click="onGoToChat(item.value)">{{ $L('开始聊天') }}</Button>
</div>
</li>
</ul>

View File

@ -402,6 +402,78 @@
}
}
.ai-list {
list-style-type: none;
overflow: hidden;
border-radius: 3px;
margin-right: -10px;
> li {
border: 1px solid #eeeeee;
padding: 16px;
position: relative;
margin-bottom: 12px;
border-radius: 5px;
display: flex;
align-items: flex-start;
.ai-img {
margin-right: 20px;
flex-shrink: 0;
> img {
width: 60px;
height: 60px;
border-radius: 8px;
object-fit: cover;
}
}
.ai-info {
flex: 1;
h4 {
font-size: 18px;
color: #333;
margin: 0 0 10px 0;
line-height: 24px;
font-weight: 500;
}
.ai-desc {
font-size: 14px;
color: #666;
line-height: 1.6;
margin-bottom: 15px;
}
.ai-modal {
display: flex;
flex-wrap: wrap;
gap: 8px;
list-style-type: none;
margin-bottom: 12px;
> li {
padding: 4px 12px;
background: #f5f5f5;
border-radius: 15px;
font-size: 13px;
color: #666;
border: none;
margin: 0;
&:hover {
background: #e8e8e8;
color: #333;
}
}
}
}
}
}
// 机器人
.ai-tabs {
position: absolute;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB